Package echo.util

Class FileUtil


  • public class FileUtil
    extends java.lang.Object
    Used to interface with file system
    • 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 parameters
        mavenPluginLog - 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