Class FileManagerImpl

  • All Implemented Interfaces:
    FileManager, java.rmi.Remote

    public class FileManagerImpl
    extends java.lang.Object
    implements FileManager
    • Constructor Summary

      Constructors 
      Constructor Description
      FileManagerImpl()  
    • Method Summary

      All Methods Instance Methods Concrete 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileManagerImpl

        public FileManagerImpl()
    • Method Detail

      • logFileName

        public final java.lang.String logFileName​(java.lang.String loggerName,
                                                  java.lang.String testStepId)
        Description copied from interface: FileManager
        Determine the file name for the given logger and step id pair
        Specified by:
        logFileName in interface FileManager
        Returns:
        the file name
      • newTmpFileName

        public final java.lang.String newTmpFileName()
                                              throws java.io.IOException
        Description copied from interface: FileManager
        Generate the temporary file name
        Specified by:
        newTmpFileName in interface FileManager
        Returns:
        the temporary file name
        Throws:
        java.io.IOException
      • readFromFile

        public final byte[] readFromFile​(java.lang.String fileName,
                                         long offset)
                                  throws java.io.IOException
        Description copied from interface: FileManager
        Read the next batch of bytes from the remote file
        Specified by:
        readFromFile in interface FileManager
        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

        public final void writeToFile​(java.lang.String fileName,
                                      byte[] buff)
                               throws java.io.IOException
        Description copied from interface: FileManager
        Write some bytes to the remote file. Blocks until all the bytes are written.
        Specified by:
        writeToFile in interface FileManager
        buff - the bytes to write to the remote file another IOException
        Throws:
        java.io.IOException
      • fileSize

        public final long fileSize​(java.lang.String fileName)
        Specified by:
        fileSize in interface FileManager
      • truncateFile

        public final void truncateFile​(java.lang.String fileName,
                                       long size)
                                throws java.io.IOException
        Specified by:
        truncateFile in interface FileManager
        Throws:
        java.io.IOException
      • deleteFile

        public final void deleteFile​(java.lang.String fileName)
                              throws java.io.IOException
        Specified by:
        deleteFile in interface FileManager
        Throws:
        java.io.IOException