class FileSystem {

	private static URL toShortestURL(String url, URLClassLoader classLoader) {
		final String endPattern = URL_PATH_SEPARATOR + "$"; //$NON-NLS-1$
		final URL[] classpath = classLoader.getURLs();

		for (final URL path : classpath) {
			final String sp = path.toExternalForm().replaceAll(endPattern, ""); //$NON-NLS-1$
			if (url.startsWith(sp)) {
				final StringBuilder buffer = new StringBuilder("resource:"); //$NON-NLS-1$
				buffer.append(url.substring(sp.length()).replaceAll(
						"^" + URL_PATH_SEPARATOR, "")); //$NON-NLS-1$ //$NON-NLS-2$
				try {
					return new URL(buffer.toString());
				} catch (MalformedURLException e) {
					//
				}
			}
		}

		return null;
	}

	private  FileSystem();

}