Package de.aristaflow.adept2.util.io
Class FileContent
- java.lang.Object
-
- de.aristaflow.adept2.util.io.RereadableContent
-
- de.aristaflow.adept2.util.io.FileContent
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class FileContent extends RereadableContent
ARereadableContentbased on a file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classFileContent.FileCloseableThis class implements the cleanup without referring to theRereadableContentit cleans up.-
Nested classes/interfaces inherited from class de.aristaflow.adept2.util.io.RereadableContent
RereadableContent.RrcCleanup, RereadableContent.RrcInputStream
-
-
Field Summary
Fields Modifier and Type Field Description protected PathfileThe file containing the content of aRereadableContent.-
Fields inherited from class de.aristaflow.adept2.util.io.RereadableContent
cleanup, existingStreams, finalCleanup, RRC_INPUT_STREAM_SIZE, sha512hash, size
-
-
Constructor Summary
Constructors Constructor Description FileContent(SwitchingOutputStream sos)Creates a newRereadableContentbased on the designated output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InputStreamcreateInputStream()Creates a new input stream for the content.-
Methods inherited from class de.aristaflow.adept2.util.io.RereadableContent
close, equals, getInputStream, getSHA512Hash, getSize, getSize, hashCode
-
-
-
-
Constructor Detail
-
FileContent
public FileContent(SwitchingOutputStream sos) throws IOException
Creates a newRereadableContentbased on the designated output stream.- Parameters:
sos- TheSwitchingOutputStreamproviding the data asPath, its size and its SHA-512 hash.- Throws:
IOException- If the designated output stream has not been closed yet, anIOExceptionwill be thrown.
-
-
Method Detail
-
createInputStream
protected InputStream createInputStream() throws IOException
Description copied from class:RereadableContentCreates a new input stream for the content.- Specified by:
createInputStreamin classRereadableContent- Returns:
- A new input stream for the content. The caller is responsible for closing.
- Throws:
IOException- If there are problems creating a new input stream for the content, anIOExceptionwill be thrown.
-
-