code: public static File newFile(File baseDir, String... segments) {
          File f = baseDir;
          for (String segment : segments) {
              f = new File(f, segment);
          }
          return f;
      }
docs: Return a new File object based on the baseDir and the segments.
  
  This method does not perform any operation on the file system.