Cache Pattern instance
This commit is contained in:
parent
c41f564832
commit
158119a26b
|
@ -620,12 +620,14 @@ public final class FileUtilities {
|
||||||
return path.replace('\\', '/');
|
return path.replace('\\', '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Pattern PATH_SEPARATORS = Pattern.compile("\\s*[\\\\/]+\\s*");
|
||||||
|
|
||||||
public static String replacePathSeparators(CharSequence path) {
|
public static String replacePathSeparators(CharSequence path) {
|
||||||
return replacePathSeparators(path, " ");
|
return replacePathSeparators(path, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String replacePathSeparators(CharSequence path, String replacement) {
|
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) {
|
public static String md5(String string) {
|
||||||
|
|
Loading…
Reference in New Issue