code: public static Set<PosixFilePermission> convertToPermissionsSet(final int aMode) {
          final Set<PosixFilePermission> result = EnumSet.noneOf(PosixFilePermission.class);
  
          if (isSet(aMode, 0400)) {
              result.add(PosixFilePermission.OWNER_READ);
          }
  
          if (isSet(aMode, 0200)) {
              result.add(PosixFilePermission.OWNER_WRITE);
          }
  
          if (isSet(aMode, 0100)) {
              result.add(PosixFilePermission.OWNER_EXECUTE);
          }
  
          if (isSet(aMode, 040)) {
              result.add(PosixFilePermission.GROUP_READ);
          }
  
          if (isSet(aMode, 020)) {
              result.add(PosixFilePermission.GROUP_WRITE);
          }
  
          if (isSet(aMode, 010)) {
              result.add(PosixFilePermission.GROUP_EXECUTE);
          }
  
          if (isSet(aMode, 04)) {
              result.add(PosixFilePermission.OTHERS_READ);
          }
  
          if (isSet(aMode, 02)) {
              result.add(PosixFilePermission.OTHERS_WRITE);
          }
  
          if (isSet(aMode, 01)) {
              result.add(PosixFilePermission.OTHERS_EXECUTE);
          }
  
          return result;
      }
docs: Converts an file permissions mode integer to a PosixFilePermission set.
  
  @param aMode An integer permissions mode.
  @return A PosixFilePermission set