Package echo.util
Class FileUtil
- java.lang.Object
-
- echo.util.FileUtil
-
public class FileUtil extends java.lang.Object
Used to interface with file system
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
appendToFile
private java.io.File
basePath
private java.lang.String
encoding
private boolean
forceOverwrite
private java.lang.String
fromFile
private PluginLog
mavenPluginLog
private static java.lang.String
READING_INPUT_FROM
private java.lang.String
toFile
-
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 void
checkForNonWritableFile(java.io.File saveFile)
private java.io.InputStream
getFileFromRelativeOrClassPath(java.io.File basePath, java.lang.String file)
java.lang.String
getFromFile()
Retrieves the message from the location in attribute fromFileprivate void
makeFileWritable(java.io.File saveFile)
void
saveToFile(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.IOException
Retrieves 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
-
-