1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-02 08:25:02 -04:00

Cache Pattern instance

This commit is contained in:
Reinhard Pointner 2016-02-22 04:34:08 +00:00
parent c41f564832
commit 158119a26b

View File

@ -620,12 +620,14 @@ public final class FileUtilities {
return path.replace('\\', '/');
}
private static final Pattern PATH_SEPARATORS = Pattern.compile("\\s*[\\\\/]+\\s*");
public static String replacePathSeparators(CharSequence path) {
return replacePathSeparators(path, " ");
}
public static String replacePathSeparators(CharSequence path, String replacement) {
return Pattern.compile("\\s*[\\\\/]+\\s*").matcher(path).replaceAll(replacement);
return PATH_SEPARATORS.matcher(path).replaceAll(replacement);
}
public static String md5(String string) {