Interface FileManager
-
- All Superinterfaces:
java.rmi.Remote
- All Known Subinterfaces:
FileManagerService
- All Known Implementing Classes:
FileManagerImpl,FileManagerServiceImpl
public interface FileManager extends java.rmi.Remote
-
-
Field Summary
Fields Modifier and Type Field Description static java.nio.file.OpenOption[]APPEND_OPEN_OPTIONSstatic byte[]EMPTYstatic FileManagerINSTANCEstatic java.nio.file.OpenOption[]READ_OPTIONSstatic java.nio.file.PathTMP_DIRstatic java.nio.file.OpenOption[]WRITE_OPEN_OPTIONS
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Field Detail
-
INSTANCE
static final FileManager INSTANCE
-
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.IOExceptionDetermine 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.IOExceptionGenerate 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.IOExceptionRead 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 reachedjava.io.IOException
-
writeToFile
void writeToFile(java.lang.String fileName, byte[] buff) throws java.io.IOExceptionWrite 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
-
-