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
Class representing a binary
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.util.POIHolder
POIHolder.Point -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.slf4j.LoggerThe binary's loggerprotected Stringthe binary's hashprotected POIHolder.PointThe coordinates of the point of interestFields 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 namegetPOI()Returns the Point of Interest (POI) associated with this object.voidsetPOI(POIHolder.Point point) Sets the Point of Interest (POI) for this object.Methods 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 -
_poi
The coordinates of the point of interest
-
-
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 -
getPOI
Description copied from interface:POIHolderReturns the Point of Interest (POI) associated with this object.- Specified by:
getPOIin interfacePOIHolder- Returns:
- the
POIHolder.Pointrepresenting the POI, ornullif none is defined
-
setPOI
Sets the Point of Interest (POI) for this object.- Parameters:
point- thePOIHolder.Pointto set as the POI, may benullto remove it
-