Class FileEditor
- java.lang.Object
-
- com.sun.identity.install.tools.util.FileEditor
-
public class FileEditor extends Object
Class that provides functionality to match the "lines" with specified pattern and remove them from the specified file.
-
-
Field Summary
Fields Modifier and Type Field Description static StringLINE_SEPstatic StringSTR_TEMP_FILE_SUFFIX
-
Constructor Summary
Constructors Constructor Description FileEditor(String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandeleteLines(DeletePattern pattern)booleandeleteLines(Set matchPatterns)MapgetPatternOccurences(Set matchPatterns)
-
-
-
Field Detail
-
LINE_SEP
public static final String LINE_SEP
-
STR_TEMP_FILE_SUFFIX
public static final String STR_TEMP_FILE_SUFFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FileEditor
public FileEditor(String fileName)
-
-
Method Detail
-
deleteLines
public boolean deleteLines(Set matchPatterns) throws Exception
- Parameters:
matchPatterns- a Set of DeletePatterns- Returns:
- true if all the patterns were found and deleted. False if some patterns were not found. In such cases no changes are made to the file.
- Throws:
Exception
-
deleteLines
public boolean deleteLines(DeletePattern pattern) throws Exception
- Throws:
Exception
-
-