Class TemporaryBytesManager
java.lang.Object
org.genesys.filerepository.service.ftp.TemporaryBytesManager
This little beast manages a local copy of bytes for the FTP service. It makes
a local copy of the bytes, allows for downloading, updating and synchronizing
back to the
BytesStorageService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateInputStream(org.genesys.filerepository.model.RepositoryFile repositoryFile, long offset) Creates the input stream.createOutputStream(FtpUser user, org.genesys.filerepository.model.RepositoryFile repositoryFile, long offset) Creates the output stream.Create a local file for writing.protected byte[]readTempFileToBytes(File tempFile) Read temp file to bytes.
-
Constructor Details
-
TemporaryBytesManager
public TemporaryBytesManager()
-
-
Method Details
-
newFile
Create a local file for writing. On stream close push the file toBytesStorageService- Parameters:
user- the userpath- the path- Returns:
- the output stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
readTempFileToBytes
Read temp file to bytes.- Parameters:
tempFile- the temp file- Returns:
- the byte[]
- Throws:
IOException- Signals that an I/O exception has occurred.
-
createInputStream
public InputStream createInputStream(org.genesys.filerepository.model.RepositoryFile repositoryFile, long offset) throws IOException Creates the input stream.- Parameters:
repositoryFile- the repository fileoffset- the offset- Returns:
- the input stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
createOutputStream
public OutputStream createOutputStream(FtpUser user, org.genesys.filerepository.model.RepositoryFile repositoryFile, long offset) throws IOException Creates the output stream.- Parameters:
user- the userrepositoryFile- the repository fileoffset- the offset- Returns:
- the output stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-