docs: @Pure
  	public static URL convertFileToURL(File file, boolean allowRelativePath) {
  		if (file == null) {
  			return null;
  		}
  		try {
  			File thefile = file;
  			if (FileSystem.isWindowsNativeFilename(file.toString())) {
  				thefile = FileSystem.normalizeWindowsNativeFilename(file.toString());
  				if (thefile == null) {
  					thefile = file;
  				}
  			}
  			final URL url;
  			if (thefile.isAbsolute() || !allowRelativePath) {
  				url = thefile.toURI().toURL();
  			} else {
  				final String[] elements = FileSystem.split(thefile);
  				final StringBuilder path = new StringBuilder();
  				for (final String element : elements) {
  					if (path.length() > 0) {
  						path.append(FileSystem.URL_PATH_SEPARATOR);
  					}
  					path.append(element);
  				}
  				url = new URL(URISchemeType.FILE.name().toLowerCase(), null, path.toString());
  			}
  			return FileSystem.toShortestURL(url);
  		} catch (MalformedURLException e) {
  			return null;
  		}
  	}