Class TemporaryBytesManager

java.lang.Object
org.genesys.filerepository.service.ftp.TemporaryBytesManager

@Component public class TemporaryBytesManager extends Object
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 Details

    • TemporaryBytesManager

      public TemporaryBytesManager()
  • Method Details

    • newFile

      public OutputStream newFile(FtpUser user, Path path) throws IOException
      Create a local file for writing. On stream close push the file to BytesStorageService
      Parameters:
      user - the user
      path - the path
      Returns:
      the output stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • readTempFileToBytes

      protected byte[] readTempFileToBytes(File tempFile) throws IOException
      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 file
      offset - 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 user
      repositoryFile - the repository file
      offset - the offset
      Returns:
      the output stream
      Throws:
      IOException - Signals that an I/O exception has occurred.