Package echo.util
Class FileUtil
- java.lang.Object
-
- echo.util.FileUtil
-
public class FileUtil extends java.lang.ObjectUsed to interface with file system
-
-
Field Summary
Fields Modifier and Type Field Description private booleanappendToFileprivate java.io.FilebasePathprivate java.lang.Stringencodingprivate booleanforceOverwriteprivate java.lang.StringfromFileprivate PluginLogmavenPluginLogprivate static java.lang.StringREADING_INPUT_FROMprivate java.lang.StringtoFile
-
Constructor Summary
Constructors Constructor Description FileUtil(PluginParameters parameters, PluginLog mavenPluginLog)Create a new instance of the FileUtil
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckForNonWritableFile(java.io.File saveFile)private java.io.InputStreamgetFileFromRelativeOrClassPath(java.io.File basePath, java.lang.String file)java.lang.StringgetFromFile()Retrieves the message from the location in attribute fromFileprivate voidmakeFileWritable(java.io.File saveFile)voidsaveToFile(java.lang.String message)Saves text output
-
-
-
Field Detail
-
READING_INPUT_FROM
private static final java.lang.String READING_INPUT_FROM
- See Also:
- Constant Field Values
-
mavenPluginLog
private final PluginLog mavenPluginLog
-
encoding
private final java.lang.String encoding
-
fromFile
private final java.lang.String fromFile
-
basePath
private final java.io.File basePath
-
toFile
private final java.lang.String toFile
-
appendToFile
private final boolean appendToFile
-
forceOverwrite
private final boolean forceOverwrite
-
-
Constructor Detail
-
FileUtil
public FileUtil(PluginParameters parameters, PluginLog mavenPluginLog)
Create a new instance of the FileUtil- Parameters:
parameters- The user-supplied plugin parametersmavenPluginLog- Wrapper for Maven internal plugin logger
-
-
Method Detail
-
saveToFile
public void saveToFile(java.lang.String message)
Saves text output- Parameters:
message- The text to save
-
checkForNonWritableFile
private void checkForNonWritableFile(java.io.File saveFile)
-
makeFileWritable
private void makeFileWritable(java.io.File saveFile)
-
getFromFile
public java.lang.String getFromFile() throws java.io.IOExceptionRetrieves the message from the location in attribute fromFile- Returns:
- Content of the default sort order file
- Throws:
java.io.IOException
-
getFileFromRelativeOrClassPath
private java.io.InputStream getFileFromRelativeOrClassPath(java.io.File basePath, java.lang.String file) throws java.io.IOException- Throws:
java.io.IOException
-
-