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
Modifier and TypeFieldDescriptionprotected static Logger
The binary's loggerprotected String
the binary's hashFields inherited from class org.ametys.cms.data.NamedResource
_filename
Fields inherited from class org.ametys.cms.data.Resource
_buffer, _encoding, _lastModificationDate, _mimeType, _repositoryData, _tmpFile
-
Constructor Summary
ConstructorDescriptionBinary()
Default constructorBinary
(RepositoryData repositoryData, String hash) Constructor to use when reading the binary from the repository -
Method Summary
Modifier and TypeMethodDescriptionprotected void
closeOutputStream
(ByteArrayOutputStream outputStream) Closes the givenOutputStream
getHash()
Retrieves the hash of the resource's datagetName()
Retrieves the file's nameMethods inherited from class org.ametys.cms.data.NamedResource
getFilename, setFilename
Methods inherited from class org.ametys.cms.data.Resource
getEncoding, getInputStream, getLastModificationDate, getLength, getMimeType, getOutputStream, getRepositoryData, setEncoding, setInputStream, setLastModificationDate, setMimeType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:Resource
Closes the givenOutputStream
- Overrides:
closeOutputStream
in classResource
- Parameters:
outputStream
- theOutputStream
to 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:File
Retrieves the file's name
-