class FileSystem {

	@Pure
	public static URL convertFileToURL(File file) {
		if (file == null) {
			return null;
		}
		try {
			File thefile = file;
			if (isWindowsNativeFilename(file.toString())) {
				thefile = normalizeWindowsNativeFilename(file.toString());
				if (thefile == null) {
					thefile = file;
				}
			}
			final URL url;
			if (thefile.isAbsolute()) {
				url = thefile.toURI().toURL();
			} else {
				url = new URL(URISchemeType.FILE.name(), "", thefile.toString()); //$NON-NLS-1$
			}
			return toShortestURL(url);
		} catch (MalformedURLException e) {
			return null;
		}
	}

	private  FileSystem();

}