Package org.cdlib.mrt.core
Class FileContent
java.lang.Object
org.cdlib.mrt.core.FileContent
- All Implemented Interfaces:
FileContentInf
Returns both File and File state information
- Author:
- dloy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected File
protected FileComponent
protected String
protected InputStream
protected static final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FileContent
(File file, String checksumType, LoggerInf logger) Constructor that validates passed argumentsprotected
FileContent
(FileComponent fileState, InputStream inputStream, File file) Constructore -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Build FileState information from filegetFile()
Requested FileGet File State informationstatic FileContent
getFileContent
(File file, String checksumType, LoggerInf logger) Factory class for FileContent when FileState does not existstatic FileContent
getFileContent
(File file, LoggerInf logger) Factory class for FileContent when FileState does not existstatic FileContent
getFileContent
(FileComponent fileState, InputStream inputStream, File file) Factory class to return FileContentFile disposition for this passed fileGet InputStream for returned filevoid
Set Filevoid
setFileDisposition
(String fileDisposition) void
setFileState
(FileComponent fileState) Set FileState valuevoid
setInputStream
(InputStream inputStream) Set InputStream
-
Field Details
-
fileContent
-
inputStream
-
file
-
fileDisposition
-
DEFAULT_CHECKSUMTYPE
- See Also:
-
NL
-
-
Constructor Details
-
FileContent
Constructore- Parameters:
fileState
- FileState data for objectinputStream
- input stream to response datafile
- Response file
-
FileContent
Constructor that validates passed arguments- Parameters:
file
- response filelogger
- process logger
-
-
Method Details
-
getFileDisposition
Description copied from interface:FileContentInf
File disposition for this passed file- Specified by:
getFileDisposition
in interfaceFileContentInf
- Returns:
- File disposition;
-
setFileDisposition
-
getFileContent
public static FileContent getFileContent(FileComponent fileState, InputStream inputStream, File file) Factory class to return FileContent- Parameters:
fileState
- FileState data for objectinputStream
- input stream to response datafile
- Response file- Returns:
- Created FileContent object
-
getFileContent
Factory class for FileContent when FileState does not exist- Parameters:
file
- response filelogger
- process logger- Returns:
- FileContent object containing File and FileState
-
getFileContent
Factory class for FileContent when FileState does not exist- Parameters:
file
- response filelogger
- process logger- Returns:
- FileContent object containing File and FileState
-
getFileComponent
Description copied from interface:FileContentInf
Get File State information- Specified by:
getFileComponent
in interfaceFileContentInf
- Returns:
- File State information
-
setFileState
Set FileState value- Parameters:
fileState
- set using this FileState
-
getFile
Description copied from interface:FileContentInf
Requested File- Specified by:
getFile
in interfaceFileContentInf
- Returns:
- Requested File
-
setFile
Set File- Parameters:
file
- set using this File
-
getInputStream
Description copied from interface:FileContentInf
Get InputStream for returned file- Specified by:
getInputStream
in interfaceFileContentInf
- Returns:
- File InputStream
-
setInputStream
Set InputStream- Parameters:
inputStream
- set using this InputStream
-
addFile
Build FileState information from file- Parameters:
file
- response filelogger
- process logger
-
dump
-