清除文件名中的在Windows下不支持的非法字符，包括： \ / : * ? " &lt; &gt; |

@param fileName 文件名（必须不包括路径，否则路径符将被替换）
@return 清理后的文件名
@since 3.3.1
333108
public static String cleanInvalid(String fileName) {
		return StrUtil.isBlank(fileName) ? fileName : ReUtil.delAll(FILE_NAME_INVALID_PATTERN_WIN, fileName);
	}
445080
def sanitize_filename(filename):
    
    sanitized_filename = re.sub(r'[/\\:*?"<>|]', '-', filename)
    sanitized_filename = sanitized_filename.replace('&', 'and')
    sanitized_filename = sanitized_filename.replace('"', '')
    sanitized_filename = sanitized_filename.replace("'", '')
    sanitized_filename = sanitized_filename.replace("/", '')
    sanitized_filename = sanitized_filename.replace("\\", '')

    # Annoying.
    if sanitized_filename[0] == '.':
        sanitized_filename = u'dot' + sanitized_filename[1:]

    return sanitized_filename
650472
protected static boolean isValidFilename(String filename) {
		if (filename == null || filename.length() == 0) {
			throw new NullPointerException("文件名不能为空.");
		}
		if (filename.indexOf("..") != -1) {
			throw new IllegalArgumentException("文件名称不能包含'..'");
		}
		Matcher m = FILENAME_PATTERN.matcher(filename);
		return m.matches();
	}
148366
public File getFileUnchecked(String fileName) {
    validatePathname(fileName);

    return new File(storageDir + separator + fileName);
  }
459007
public static String removeExtension(String fileName) {
		final String separator = FILE_SEPARATOR;
		String filename;
		// Remove the path upto the filename.
		final int lastSeparatorIndex = fileName.lastIndexOf(separator);
		if (lastSeparatorIndex == -1) {
			filename = fileName;
		} else {
			filename = fileName.substring(lastSeparatorIndex + 1);
		}

		// Remove the extension.
		final int extensionIndex = filename.lastIndexOf(".");
		if (extensionIndex == -1) {
			return filename;
		}
		fileName = fileName.substring(0, lastSeparatorIndex);
		return fileName + File.separator + filename.substring(0, extensionIndex);
	}
379582
function removeExtensions(filename) {
    var extension = path.extname(filename);
    while (extension !== '') {
      filename = path.basename(filename, extension);
      extension = path.extname(filename);
    }
    return filename;
  }
1175407
public String removeFileExtension(String fileName) {
        
        int dotIndex = fileName.lastIndexOf(".");
        if (dotIndex > 0) {
            fileName = fileName.substring(0, dotIndex);
        }
        
        return fileName;
    }
1167305
public static String removeSuffix(String filename, String suffix) {
    if (filename.endsWith(suffix)) {
      return filename.substring(0, filename.length() - suffix.length());
    }
    return filename;
  }
295589
public static String extName(String fileName) {
		if (fileName == null) {
			return null;
		}
		int index = fileName.lastIndexOf(StrUtil.DOT);
		if (index == -1) {
			return StrUtil.EMPTY;
		} else {
			String ext = fileName.substring(index + 1);
			// 扩展名中不能包含路径相关的符号
			return StrUtil.containsAny(ext, UNIX_SEPARATOR, WINDOWS_SEPARATOR) ? StrUtil.EMPTY : ext;
		}
	}
297724
@Pure
	public static File removeExtension(File filename) {
		if (filename == null) {
			return null;
		}
		final File dir = filename.getParentFile();
		final String name = filename.getName();
		final int idx = name.lastIndexOf(getFileExtensionCharacter());
		if (idx < 0) {
			return filename;
		}
		return new File(dir, name.substring(0, idx));
	}
892647
public static function sanitizeFilename($filename) {
        $filename = (string) $filename;

        $strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]", "}", "\\", "|", ";", ":", "\"", "'",
            "&#8216;", "&#8217;", "&#8220;", "&#8221;", "&#8211;", "&#8212;", "â€”", "â€“", ",", "<", ">", "/", "?", "\0");
        $clean = trim(str_replace($strip, '', $filename));
        $clean = preg_replace('/\s+/', "-", $clean);
        if (empty($clean)) {
            throw new CM_Exception_Invalid('Invalid filename.');
        }
        return $clean;
    }
645389
private static final String getExtension(String fileName) {
		return fileName.indexOf('.') == -1 ? null : fileName.substring(fileName.lastIndexOf('.') + 1);
	}
119921
public static String[] splitFileName(String fileName) {
	int pos = fileName.lastIndexOf('.');
	if (pos == -1) {
	    return new String[] { fileName };
	}
	return new String[] { fileName.substring(0, pos), fileName.substring(pos + 1) };
    }
1080260
private static int getIndexFromFilename(String fileName) {
        // remove the beginning of the file name
        String resStr = fileName.replace(
                latestMOTDSerializedFileName.substring(0, latestMOTDSerializedFileName.indexOf("{index}")), "");

        // remove the end of the file name
        resStr = resStr.replace(
                latestMOTDSerializedFileName.substring(latestMOTDSerializedFileName.indexOf("{index}") + 7), "");

        return Integer.parseInt(resStr);
    }
165954
private static String removeStartingDots(String fileName) {
        // machte unter OS X/Linux Probleme, zB. bei dem Titel: "....Paula"
        while (!fileName.isEmpty() && (fileName.startsWith("."))) {
            fileName = fileName.substring(1, fileName.length());
        }
        return fileName;
    }
1362305
protected static String trimFileExtension(String fileName) {
		if (fileName.lastIndexOf('.') == -1) {
			return fileName;
		}
		return fileName.substring(0, fileName.lastIndexOf('.'));
	}
241196
public boolean clearValue(String name) {
        String cleanName = cleanupValue(name);
        boolean result = getCurrentValues().containsKey(cleanName);
        getCurrentValues().remove(cleanName);
        return result;
    }