class FileSystem {

	@Pure
	public static String largeBasename(String filename) {
		if (filename == null) {
			return null;
		}
		if (isWindowsNativeFilename(filename)) {
			return largeBasename(normalizeWindowsNativeFilename(filename));
		}

		try {
			return largeBasename(new URL(filename));
		} catch (Exception exception) {
			// No log
		}
		int end = filename.length();
		int idx;
		do {
			end--;
			idx = filename.lastIndexOf(File.separatorChar, end);
		}
		while (idx >= 0 && end >= 0 && idx >= end);
		if (idx < 0) {
			if (end < filename.length() - 1) {
				return filename.substring(0, end + 1);
			}
			return filename;
		}
		return filename.substring(idx + 1, end + 1);
	}

	private  FileSystem();

}