|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.uima.internal.util.ReplaceStringInFiles
public class ReplaceStringInFiles
String replacement utility.
Nested Class Summary | |
---|---|
static class |
ReplaceStringInFiles.ReplacementResult
Result class for string replacement. |
Constructor Summary | |
---|---|
ReplaceStringInFiles()
|
Method Summary | |
---|---|
static int |
indexOfCaseSensitive(java.lang.String mainStr,
java.lang.String argStr,
int start,
boolean caseSensitive)
|
static void |
main(java.lang.String[] args)
Replace a certain string with other strings in files. |
static void |
replaceStringInFiles(java.io.File dir,
java.io.FileFilter fileFilter,
java.lang.String toReplace,
java.lang.String replacement,
boolean caseSensitive)
Replace a string in all files of a directory, recursively. |
static void |
replaceStringInString(java.lang.String text,
java.lang.String toReplace,
java.lang.String replacement,
ReplaceStringInFiles.ReplacementResult res,
boolean caseSensitive)
Replace occurences of toReplace in text by
replacement. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReplaceStringInFiles()
Method Detail |
---|
public static int indexOfCaseSensitive(java.lang.String mainStr, java.lang.String argStr, int start, boolean caseSensitive)
mainStr
- The given string object.argStr
- The given string argument.
-1
is returned.public static final void replaceStringInString(java.lang.String text, java.lang.String toReplace, java.lang.String replacement, ReplaceStringInFiles.ReplacementResult res, boolean caseSensitive)
toReplace
in text
by
replacement.
text
- The text where the replacement should happen.toReplace
- The string that should be replaced.replacement
- The string it should be replaced with.res
- The result object, containing the result string and the number of times replacement
happened.public static final void replaceStringInFiles(java.io.File dir, java.io.FileFilter fileFilter, java.lang.String toReplace, java.lang.String replacement, boolean caseSensitive) throws java.io.IOException
dir
- The directory where replacement should happen.fileFilter
- A file filter for which files replacement should happen.toReplace
- String which should be replaced.replacement
- String it should be replaced with.
java.io.IOException
- Whenever anything goes wrong reading or writing a file.public static void main(java.lang.String[] args)
java org.apache.uima.util.ReplaceStringInFile /home/tom/stuff .prop $ROOT$ /home/tom/root
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |