Package org.ametys.cms.data
Class Binary
java.lang.Object
org.ametys.cms.data.Resource
org.ametys.cms.data.NamedResource
org.ametys.cms.data.Binary
- All Implemented Interfaces:
File
Class representing a binary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.slf4j.LoggerThe binary's loggerprotected Stringthe binary's hashFields inherited from class org.ametys.cms.data.NamedResource
_filenameFields inherited from class org.ametys.cms.data.Resource
_buffer, _encoding, _lastModificationDate, _mimeType, _repositoryData, _tmpFile -
Constructor Summary
ConstructorsConstructorDescriptionBinary()Default constructorBinary(RepositoryData repositoryData, String hash) Constructor to use when reading the binary from the repository -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseOutputStream(ByteArrayOutputStream outputStream) Closes the givenOutputStreamgetHash()Retrieves the hash of the resource's datagetName()Retrieves the file's nameMethods inherited from class org.ametys.cms.data.NamedResource
getFilename, setFilenameMethods inherited from class org.ametys.cms.data.Resource
getEncoding, getInputStream, getLastModificationDate, getLength, getMimeType, getOutputStream, getRepositoryData, setEncoding, setInputStream, setLastModificationDate, setMimeTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.cms.data.File
getInputStream, getLastModificationDate, getLength, getMimeType, setLastModificationDate, setMimeType
-
Field Details
-
__logger
The binary's logger -
_hash
the binary's hash
-
-
Constructor Details
-
Binary
public Binary()Default constructor -
Binary
Constructor to use when reading the binary from the repository- Parameters:
repositoryData- the repository data containing the resource's datahash- the hash of the resource's data
-
-
Method Details
-
closeOutputStream
Description copied from class:ResourceCloses the givenOutputStream- Overrides:
closeOutputStreamin classResource- Parameters:
outputStream- theOutputStreamto close- Throws:
IOException- if an error occurs while registering the stream
-
getHash
Retrieves the hash of the resource's data- Returns:
- the hash of the resource's data
-
getName
Description copied from interface:FileRetrieves the file's name
-