code: public boolean isValidPosixFileName(String name) {
      for (int i = 0; i < name.length(); i++) {
        char c = name.charAt(i);
        if (i == 0) {
          if (c == '-') {
            return false;
          }
        }
        if (!isValidPosixFileChar(c)) {
          return false;
        }
      }
      return true;
    }
docs: Test whether filename is a valid posix filename
  A posix filename must contain characters A-Za-z0-9._- and - must not be
  the first character