Interface FileCodec

  • All Known Implementing Classes:
    PathFileCodec

    public interface FileCodec
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String read​(java.lang.String file)
      Reads the specified file
      void write​(java.lang.String file, java.lang.String content)
      Writes the provided data to the specified file
    • Method Detail

      • read

        java.lang.String read​(java.lang.String file)
                       throws java.lang.IllegalStateException
        Reads the specified file
        Parameters:
        file - the file to read
        Returns:
        a list of all the lines in the specified file, or null when the file does not exist
        Throws:
        java.lang.IllegalStateException - if something unexpected happened while reading the file
      • write

        void write​(java.lang.String file,
                   java.lang.String content)
            throws java.lang.IllegalStateException
        Writes the provided data to the specified file
        Parameters:
        file - the file to write to
        content - the data to write
        Throws:
        java.lang.IllegalStateException - if something unexpected happened while writing the file