Package org.fcrepo.kernel.impl.models
Class BinaryImpl
- java.lang.Object
-
- org.fcrepo.kernel.impl.models.FedoraResourceImpl
-
- org.fcrepo.kernel.impl.models.BinaryImpl
-
- All Implemented Interfaces:
Binary
,FedoraResource
public class BinaryImpl extends FedoraResourceImpl implements Binary
Implementation of a Non-RDF resource.- Author:
- bbpennel
-
-
Field Summary
-
Fields inherited from class org.fcrepo.kernel.impl.models.FedoraResourceImpl
fedoraId, resourceFactory, transaction
-
-
Constructor Summary
Constructors Constructor Description BinaryImpl(FedoraId fedoraID, Transaction transaction, PersistentStorageSessionManager pSessionManager, ResourceFactory resourceFactory, UserTypesCache userTypesCache)
Construct the binary
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStream
getContent()
Collection<URI>
getContentDigests()
Get the pre-calculated content digest for the binary payloadlong
getContentSize()
FedoraResource
getDescription()
Get the description for this resourceString
getExternalURL()
String
getFilename()
Return the file name for the binary contentString
getMimeType()
List<URI>
getSystemTypes(boolean forRdf)
Get only the system defined types from their RDF.RdfStream
getTriples()
Return the RDF properties for this resource.Boolean
isProxy()
Boolean
isRedirect()
protected void
setContentSize(Long contentSize)
protected void
setDigests(Collection<URI> digests)
protected void
setExternalHandling(String externalHandling)
protected void
setExternalUrl(String externalUrl)
protected void
setFilename(String filename)
protected void
setMimeType(String mimeType)
-
Methods inherited from class org.fcrepo.kernel.impl.models.FedoraResourceImpl
findMementoByDatetime, getAcl, getArchivalGroupId, getChildren, getContainer, getCreatedBy, getCreatedDate, getDescribedResource, getEtagValue, getFedoraId, getId, getInteractionModel, getLastModifiedBy, getLastModifiedDate, getMementoDatetime, getOriginalResource, getParent, getParentId, getSession, getStateToken, getTimeMap, getTypes, getUserTypes, hasProperty, hasType, isAcl, isMemento, isOriginalResource, resolveSystemTypes, setArchivalGroupId, setCreatedBy, setCreatedDate, setEtag, setInteractionModel, setIsArchivalGroup, setIsMemento, setLastModifiedBy, setLastModifiedDate, setMementoDatetime, setParentId, setStateToken, setTypes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.fcrepo.kernel.api.models.Binary
getExternalURI
-
Methods inherited from interface org.fcrepo.kernel.api.models.FedoraResource
findMementoByDatetime, getAcl, getArchivalGroupId, getChildren, getChildren, getContainer, getCreatedBy, getCreatedDate, getDescribedResource, getEtagValue, getFedoraId, getId, getInteractionModel, getLastModifiedBy, getLastModifiedDate, getMementoDatetime, getOriginalResource, getParent, getParentId, getStateToken, getTimeMap, getTypes, getUserTypes, hasProperty, hasType, isAcl, isMemento, isOriginalResource
-
-
-
-
Constructor Detail
-
BinaryImpl
public BinaryImpl(FedoraId fedoraID, Transaction transaction, PersistentStorageSessionManager pSessionManager, ResourceFactory resourceFactory, UserTypesCache userTypesCache)
Construct the binary- Parameters:
fedoraID
- fedora identifiertransaction
- transactionpSessionManager
- session managerresourceFactory
- resource factoryuserTypesCache
- the user types cache
-
-
Method Detail
-
getContent
public InputStream getContent()
- Specified by:
getContent
in interfaceBinary
- Returns:
- The InputStream of content associated with this datastream.
-
getContentSize
public long getContentSize()
- Specified by:
getContentSize
in interfaceBinary
- Returns:
- The size in bytes of content associated with this datastream.
-
getContentDigests
public Collection<URI> getContentDigests()
Description copied from interface:Binary
Get the pre-calculated content digest for the binary payload- Specified by:
getContentDigests
in interfaceBinary
- Returns:
- a URI with the format algorithm:value
-
isRedirect
public Boolean isRedirect()
- Specified by:
isRedirect
in interfaceBinary
- Returns:
- Whether or not this binary is a redirect to another resource
-
getExternalURL
public String getExternalURL()
- Specified by:
getExternalURL
in interfaceBinary
- Returns:
- the external url for this binary if present, or null.
-
getMimeType
public String getMimeType()
- Specified by:
getMimeType
in interfaceBinary
- Returns:
- The MimeType of content associated with this datastream.
-
getFilename
public String getFilename()
Description copied from interface:Binary
Return the file name for the binary content- Specified by:
getFilename
in interfaceBinary
- Returns:
- original file name for the binary content, or the object's id.
-
getDescription
public FedoraResource getDescription()
Description copied from interface:FedoraResource
Get the description for this resource- Specified by:
getDescription
in interfaceFedoraResource
- Overrides:
getDescription
in classFedoraResourceImpl
- Returns:
- the description for this resource
-
setExternalHandling
protected void setExternalHandling(String externalHandling)
- Parameters:
externalHandling
- the externalHandling to set
-
setExternalUrl
protected void setExternalUrl(String externalUrl)
- Parameters:
externalUrl
- the externalUrl to set
-
setContentSize
protected void setContentSize(Long contentSize)
- Parameters:
contentSize
- the contentSize to set
-
setFilename
protected void setFilename(String filename)
- Parameters:
filename
- the filename to set
-
setMimeType
protected void setMimeType(String mimeType)
- Parameters:
mimeType
- the mimeType to set
-
setDigests
protected void setDigests(Collection<URI> digests)
- Parameters:
digests
- the digests to set
-
getSystemTypes
public List<URI> getSystemTypes(boolean forRdf)
Description copied from interface:FedoraResource
Get only the system defined types from their RDF.- Specified by:
getSystemTypes
in interfaceFedoraResource
- Overrides:
getSystemTypes
in classFedoraResourceImpl
- Parameters:
forRdf
- whether we only want types for displaying in a RDF body.- Returns:
- a list of types from the user provided RDF.
-
getTriples
public RdfStream getTriples()
Description copied from interface:FedoraResource
Return the RDF properties for this resource.- Specified by:
getTriples
in interfaceFedoraResource
- Overrides:
getTriples
in classFedoraResourceImpl
- Returns:
- the RDF properties of this object.
-
-