Package zeroecho.sdk.content.builtin
Class PlainFile
java.lang.Object
zeroecho.sdk.content.builtin.PlainFile
- All Implemented Interfaces:
DataContent,PlainContent
A
PlainContent implementation that reads content from a file-like
URL.-
Field Summary
Fields inherited from interface zeroecho.sdk.content.api.DataContent
DEFAULT_MAX_READ_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns anInputStreamfor reading from the file.voidsetInput(DataContent input) Connects this content to the output of a previous stage in the pipeline.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface zeroecho.sdk.content.api.DataContent
toBytes, toText
-
Constructor Details
-
PlainFile
Constructs a PlainFile from the specified URL.- Parameters:
location- the file URL; must not be null
-
-
Method Details
-
setInput
Connects this content to the output of a previous stage in the pipeline.This method is used to supply the input data that this content will process (e.g., a
PlainContentbeing encrypted, or an encrypted content being decrypted).PlainFilerepresents the start of aDataContentchain and therefore must not have any input. Calling this method with a non-nullargument will result in an exception.- Specified by:
setInputin interfaceDataContent- Parameters:
input- the precedingDataContent, which must benull- Throws:
IllegalArgumentException- ifinputis notnull
-
getStream
Returns anInputStreamfor reading from the file.- Specified by:
getStreamin interfaceDataContent- Returns:
- an
InputStreamfrom the URL - Throws:
IOException- if an I/O error occurs opening the stream
-