public class PathsUtils
extends java.lang.Object
| Constructor and Description |
|---|
PathsUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
escapeRegexChars(java.lang.String pattern)
Adds escape character before each one of the following chars: "*?[]$^.{}|()"
|
static java.lang.String |
escapeSpecialChars(java.lang.String str) |
static java.lang.String |
pathToRegExp(java.lang.String path) |
static java.lang.String |
reformatRegexp(java.lang.String sourceString,
java.lang.String destString,
java.util.regex.Pattern regexPattern) |
static java.lang.String |
removeUnescapedChar(java.lang.String stringToRemoveFrom,
java.lang.Character characterToRemove)
The method removes all unescaped instances of the provided Char from the provided String.
|
static java.util.Map<java.lang.String,java.lang.String> |
replaceFilesName(java.lang.String targetPath,
java.lang.String srcPath) |
static java.lang.String |
substringBeforeFirstRegex(java.lang.String baseDir)
Returns a substring from the beginning of the string till the first regex chars: "*?[]$^.{}|()"
|
public static java.lang.String reformatRegexp(java.lang.String sourceString,
java.lang.String destString,
java.util.regex.Pattern regexPattern)
public static java.lang.String substringBeforeFirstRegex(java.lang.String baseDir)
baseDir - the Stringpublic static java.lang.String escapeRegexChars(java.lang.String pattern)
pattern - the provided Stringpublic static java.lang.String pathToRegExp(java.lang.String path)
public static java.util.Map<java.lang.String,java.lang.String> replaceFilesName(java.lang.String targetPath,
java.lang.String srcPath)
targetPath - the path which the file name will be taken targetDir/targetPath/targetFileNamesrcPath - the path which the file name will be replace srcDir/srcPath/srcFileNamepublic static java.lang.String removeUnescapedChar(java.lang.String stringToRemoveFrom,
java.lang.Character characterToRemove)
stringToRemoveFrom - the string to apply the method oncharacterToRemove - the character to remove from the stringpublic static java.lang.String escapeSpecialChars(java.lang.String str)