Class FileManagerImpl
- java.lang.Object
-
- com.emc.mongoose.base.load.step.file.FileManagerImpl
-
- All Implemented Interfaces:
FileManager,java.rmi.Remote
public class FileManagerImpl extends java.lang.Object implements FileManager
-
-
Field Summary
-
Fields inherited from interface com.emc.mongoose.base.load.step.file.FileManager
APPEND_OPEN_OPTIONS, EMPTY, INSTANCE, READ_OPTIONS, TMP_DIR, WRITE_OPEN_OPTIONS
-
-
Constructor Summary
Constructors Constructor Description FileManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteFile(java.lang.String fileName)longfileSize(java.lang.String fileName)java.lang.StringlogFileName(java.lang.String loggerName, java.lang.String testStepId)Determine the file name for the given logger and step id pairjava.lang.StringnewTmpFileName()Generate the temporary file namebyte[]readFromFile(java.lang.String fileName, long offset)Read the next batch of bytes from the remote filevoidtruncateFile(java.lang.String fileName, long size)voidwriteToFile(java.lang.String fileName, byte[] buff)Write some bytes to the remote file.
-
-
-
Method Detail
-
logFileName
public final java.lang.String logFileName(java.lang.String loggerName, java.lang.String testStepId)Description copied from interface:FileManagerDetermine the file name for the given logger and step id pair- Specified by:
logFileNamein interfaceFileManager- Returns:
- the file name
-
newTmpFileName
public final java.lang.String newTmpFileName() throws java.io.IOExceptionDescription copied from interface:FileManagerGenerate the temporary file name- Specified by:
newTmpFileNamein interfaceFileManager- Returns:
- the temporary file name
- Throws:
java.io.IOException
-
readFromFile
public final byte[] readFromFile(java.lang.String fileName, long offset) throws java.io.IOExceptionDescription copied from interface:FileManagerRead the next batch of bytes from the remote file- Specified by:
readFromFilein interfaceFileManager- Returns:
- The bytes been read, may return empty buffer in case of EOF
- Throws:
java.io.EOFException- if end of file is reachedjava.io.IOException
-
writeToFile
public final void writeToFile(java.lang.String fileName, byte[] buff) throws java.io.IOExceptionDescription copied from interface:FileManagerWrite some bytes to the remote file. Blocks until all the bytes are written.- Specified by:
writeToFilein interfaceFileManagerbuff- 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:
fileSizein interfaceFileManager
-
truncateFile
public final void truncateFile(java.lang.String fileName, long size) throws java.io.IOException- Specified by:
truncateFilein interfaceFileManager- Throws:
java.io.IOException
-
deleteFile
public final void deleteFile(java.lang.String fileName) throws java.io.IOException- Specified by:
deleteFilein interfaceFileManager- Throws:
java.io.IOException
-
-