Interface FileManager

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void deleteFile​(java.lang.String fileName)  
      long fileSize​(java.lang.String fileName)  
      java.lang.String logFileName​(java.lang.String loggerName, java.lang.String testStepId)
      Determine the file name for the given logger and step id pair
      java.lang.String newTmpFileName()
      Generate the temporary file name
      byte[] readFromFile​(java.lang.String fileName, long offset)
      Read the next batch of bytes from the remote file
      void truncateFile​(java.lang.String fileName, long size)  
      void writeToFile​(java.lang.String fileName, byte[] buff)
      Write some bytes to the remote file.
    • Field Detail

      • EMPTY

        static final byte[] EMPTY
      • READ_OPTIONS

        static final java.nio.file.OpenOption[] READ_OPTIONS
      • WRITE_OPEN_OPTIONS

        static final java.nio.file.OpenOption[] WRITE_OPEN_OPTIONS
      • APPEND_OPEN_OPTIONS

        static final java.nio.file.OpenOption[] APPEND_OPEN_OPTIONS
      • TMP_DIR

        static final java.nio.file.Path TMP_DIR
    • Method Detail

      • logFileName

        java.lang.String logFileName​(java.lang.String loggerName,
                                     java.lang.String testStepId)
                              throws java.io.IOException
        Determine the file name for the given logger and step id pair
        Parameters:
        loggerName -
        testStepId -
        Returns:
        the file name
        Throws:
        java.io.IOException
      • newTmpFileName

        java.lang.String newTmpFileName()
                                 throws java.io.IOException
        Generate the temporary file name
        Returns:
        the temporary file name
        Throws:
        java.io.IOException
      • readFromFile

        byte[] readFromFile​(java.lang.String fileName,
                            long offset)
                     throws java.io.IOException
        Read the next batch of bytes from the remote file
        Returns:
        The bytes been read, may return empty buffer in case of EOF
        Throws:
        java.io.EOFException - if end of file is reached
        java.io.IOException
      • writeToFile

        void writeToFile​(java.lang.String fileName,
                         byte[] buff)
                  throws java.io.IOException
        Write some bytes to the remote file. Blocks until all the bytes are written.
        Parameters:
        buff - the bytes to write to the remote file another IOException
        Throws:
        java.io.IOException
      • fileSize

        long fileSize​(java.lang.String fileName)
               throws java.io.IOException
        Throws:
        java.io.IOException
      • truncateFile

        void truncateFile​(java.lang.String fileName,
                          long size)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • deleteFile

        void deleteFile​(java.lang.String fileName)
                 throws java.io.IOException
        Throws:
        java.io.IOException