private static int mode(Path file) throws IOException {
    if (SystemInfo.isWindows) {
      DosFileAttributeView attrs = Files.getFileAttributeView(file, DosFileAttributeView.class);
      if (attrs != null) {
        DosFileAttributes dosAttrs = attrs.readAttributes();
        int mode = 0;
        if (dosAttrs.isReadOnly()) mode |= Decompressor.Entry.DOS_READ_ONLY;
        if (dosAttrs.isHidden()) mode |= Decompressor.Entry.DOS_HIDDEN;
        return mode;
      }
    }
    else {
      PosixFileAttributeView attrs = Files.getFileAttributeView(file, PosixFileAttributeView.class);
      if (attrs != null) {
        return PosixFilePermissionsUtil.toUnixMode(attrs.readAttributes().permissions());
      }
    }
    return 0;
  }
private static int mode(Path file)