Class FileContent

java.lang.Object
org.cdlib.mrt.core.FileContent
All Implemented Interfaces:
FileContentInf

public class FileContent extends Object implements FileContentInf
Returns both File and File state information
Author:
dloy
  • Field Details

  • Constructor Details

    • FileContent

      protected FileContent(FileComponent fileState, InputStream inputStream, File file)
      Constructore
      Parameters:
      fileState - FileState data for object
      inputStream - input stream to response data
      file - Response file
    • FileContent

      protected FileContent(File file, String checksumType, LoggerInf logger)
      Constructor that validates passed arguments
      Parameters:
      file - response file
      logger - process logger
  • Method Details

    • getFileDisposition

      public String getFileDisposition()
      Description copied from interface: FileContentInf
      File disposition for this passed file
      Specified by:
      getFileDisposition in interface FileContentInf
      Returns:
      File disposition;
    • setFileDisposition

      public void setFileDisposition(String fileDisposition)
    • getFileContent

      public static FileContent getFileContent(FileComponent fileState, InputStream inputStream, File file)
      Factory class to return FileContent
      Parameters:
      fileState - FileState data for object
      inputStream - input stream to response data
      file - Response file
      Returns:
      Created FileContent object
    • getFileContent

      public static FileContent getFileContent(File file, LoggerInf logger)
      Factory class for FileContent when FileState does not exist
      Parameters:
      file - response file
      logger - process logger
      Returns:
      FileContent object containing File and FileState
    • getFileContent

      public static FileContent getFileContent(File file, String checksumType, LoggerInf logger)
      Factory class for FileContent when FileState does not exist
      Parameters:
      file - response file
      logger - process logger
      Returns:
      FileContent object containing File and FileState
    • getFileComponent

      public FileComponent getFileComponent()
      Description copied from interface: FileContentInf
      Get File State information
      Specified by:
      getFileComponent in interface FileContentInf
      Returns:
      File State information
    • setFileState

      public void setFileState(FileComponent fileState)
      Set FileState value
      Parameters:
      fileState - set using this FileState
    • getFile

      public File getFile()
      Description copied from interface: FileContentInf
      Requested File
      Specified by:
      getFile in interface FileContentInf
      Returns:
      Requested File
    • setFile

      public void setFile(File file)
      Set File
      Parameters:
      file - set using this File
    • getInputStream

      public InputStream getInputStream()
      Description copied from interface: FileContentInf
      Get InputStream for returned file
      Specified by:
      getInputStream in interface FileContentInf
      Returns:
      File InputStream
    • setInputStream

      public void setInputStream(InputStream inputStream)
      Set InputStream
      Parameters:
      inputStream - set using this InputStream
    • addFile

      protected void addFile(File file, String checksumType, LoggerInf logger)
      Build FileState information from file
      Parameters:
      file - response file
      logger - process logger
    • dump

      public String dump(String header)