private static boolean isWritable(FsPermission currentHDFSDirPermission, FsPermission writableHDFSDirPermission) {
    return (currentHDFSDirPermission.toShort() & writableHDFSDirPermission.toShort())
        == writableHDFSDirPermission.toShort();
  }
Checks if path passed in exists and has writable permissions.
The path will be created if it does not exist.
@param rootHDFSDirPath
@param conf
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java