code: public static short getLocalFileMode(String filePath) throws IOException {
      Set<PosixFilePermission> permission =
          Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class).permissions();
      return translatePosixPermissionToMode(permission);
    }
docs: Gets local file's permission mode.
  
  @param filePath the file path
  @return the file mode in short, e.g. 0777