docs: @Pure
  	public static String basename(URL filename) {
  		if (filename == null) {
  			return null;
  		}
  		final String largeBasename = filename.getPath();
  		assert !isWindowsNativeFilename(largeBasename);
  		int end = largeBasename.length();
  		int idx;
  		do {
  			end--;
  			idx = largeBasename.lastIndexOf(URL_PATH_SEPARATOR_CHAR, end);
  		}
  		while (idx >= 0 && end >= 0 && idx >= end);
  		String basename;
  		if (idx < 0) {
  			if (end < largeBasename.length() - 1) {
  				basename = largeBasename.substring(0, end + 1);
  			} else {
  				basename = largeBasename;
  			}
  		} else {
  			basename = largeBasename.substring(idx + 1, end + 1);
  		}
  		idx = basename.lastIndexOf(getFileExtensionCharacter());
  		if (idx >= 0) {
  			basename = basename.substring(0, idx);
  		}
  		return decodeHTMLEntities(basename);
  	}