code: private File toFile(File rootDir, String location) {
          File locationFile = rootDir;
          if (location != null) {
              URI locationURI = URI.create(location);
              locationFile = new File(locationURI.getPath());
              if (locationURI.getScheme() == null) {
                  locationFile = new File(rootDir, location);
              } else if (!"file".equals(locationURI.getScheme())) {
                  throw new IllegalArgumentException("Unexpected resources directory: " + location);
              }
          }
          return locationFile;
      }
docs: Converts a location in the gateway configuration file into a file relative to a specified root directory.
  
  @param rootDir
  the root directory
  @param location
  the location (either a file:// URI or a location relative the root directory
  @return the file corresponding to the location