private static void setAttributes(int mode, Path outputFile) throws IOException {
    if (SystemInfo.isWindows) {
      DosFileAttributeView attrs = Files.getFileAttributeView(outputFile, DosFileAttributeView.class);
      if (attrs != null) {
        if ((mode & Entry.DOS_READ_ONLY) != 0) attrs.setReadOnly(true);
        if ((mode & Entry.DOS_HIDDEN) != 0) attrs.setHidden(true);
      }
    }
    else {
      PosixFileAttributeView attrs = Files.getFileAttributeView(outputFile, PosixFileAttributeView.class);
      if (attrs != null) {
        attrs.setPermissions(PosixFilePermissionsUtil.fromUnixMode(mode));
      }
    }
  }
private static void setAttributes(int mode, Path outputFile)