public class FedoraBinaryImpl extends AbstractFedoraBinary
FedoraResourceImpl.RdfGenerator
org.modeshape.jcr.api.JcrTools.BasicOperation, org.modeshape.jcr.api.JcrTools.BrowseContent, org.modeshape.jcr.api.JcrTools.CountNodes, org.modeshape.jcr.api.JcrTools.NodeOperation, org.modeshape.jcr.api.JcrTools.Operation, org.modeshape.jcr.api.JcrTools.PrintNodes, org.modeshape.jcr.api.JcrTools.Variable
DEFAULT_MIME_TYPE
CONTAINER_WEBAC_ACL, contextMap, node
CONTENT_DIGEST, CONTENT_SIZE, DEFAULT_DIGEST_ALGORITHM, FCR_ACL, FCR_FIXITY, FCR_METADATA, FCR_VERSIONS, FEDORA_BINARY, FEDORA_CONTAINER, FEDORA_CREATED, FEDORA_CREATEDBY, FEDORA_LASTMODIFIED, FEDORA_LASTMODIFIEDBY, FEDORA_NON_RDF_SOURCE_DESCRIPTION, FEDORA_PAIRTREE, FEDORA_REPOSITORY_ROOT, FEDORA_RESOURCE, FEDORA_SKOLEM, FEDORA_TIME_MAP, FEDORA_TOMBSTONE, FEDORA_WEBAC_ACL, FILENAME, HAS_MIME_TYPE, LDP_BASIC_CONTAINER, LDP_CONTAINER, LDP_DIRECT_CONTAINER, LDP_HAS_MEMBER_RELATION, LDP_INDIRECT_CONTAINER, LDP_INSERTED_CONTENT_RELATION, LDP_IS_MEMBER_OF_RELATION, LDP_MEMBER_RESOURCE, LDP_NON_RDF_SOURCE, LDP_RDF_SOURCE, MEMENTO, MEMENTO_DATETIME, MEMENTO_ORIGINAL, PROXY_FOR, REDIRECTS_TO
Constructor and Description |
---|
FedoraBinaryImpl(javax.jcr.Node node)
Wrap an existing Node as a Fedora Binary
|
Modifier and Type | Method and Description |
---|---|
Collection<URI> |
checkFixity(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator,
Collection<String> algorithms)
Digest this datastream with the digest algorithms provided
|
void |
delete()
When deleting the binary, we also need to clean up the description document.
|
InputStream |
getContent() |
URI |
getContentDigest()
Get the pre-calculated content digest for the binary payload
|
long |
getContentSize() |
String |
getFilename()
Return the file name for the binary content
|
RdfStream |
getFixity(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator)
Get the fixity of this datastream compared to metadata stored in the repository
|
RdfStream |
getFixity(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator,
URI digestUri,
long size)
Get the fixity of this datastream in a given repository's binary store.
|
String |
getMimeType() |
RdfStream |
getTriples(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator,
Set<? extends TripleCategory> contexts)
Return the RDF properties of this object using the provided contexts
|
protected boolean |
hasDescriptionProperty(String relPath)
Check of the property exists on the description of this binary.
|
static boolean |
hasMixin(javax.jcr.Node node)
Check if the given node is a Fedora binary
|
void |
setContent(InputStream content,
String contentType,
Collection<URI> checksums,
String originalFileName,
StoragePolicyDecisionPoint storagePolicyDecisionPoint)
Sets the content of this Datastream.
|
void |
setExternalContent(String contentType,
Collection<URI> checksums,
String originalFileName,
String externalHandling,
String externalUrl)
Sets the external content reference for this datastream
|
getDescription, getDescriptionNode, getDescriptionNodeOrNull, getMimeTypeValue, getProxyURL, getRedirectURL, isProxy, isRedirect, setContentSize, setProxyURL, setRedirectURL
addType, convertMementoReferences, equals, findMementoByDatetime, findOrCreateAcl, fixDatesIfNecessary, getAcl, getChild, getChildren, getContainer, getCreatedDate, getDescribedResource, getEtagValue, getLastModifiedDate, getMementoDatetime, getNode, getOriginalResource, getPath, getProperty, getSession, getStateToken, getTimeMap, getTriples, getTypes, hashCode, hasProperty, hasType, isAcl, isMemento, isNew, isOriginalResource, isTimeMap, removeReferences, replaceProperties, toString, touch, updateProperties
findOrCreateChild, findOrCreateChild, findOrCreateNode, findOrCreateNode, findOrCreateNode, findOrCreateNode, getNode, getReadable, getStringValue, importContent, importContent, importContent, importContent, importContent, importContent, importContent, isDebug, onEachNode, onEachNodeBelow, print, printNode, printQuery, printQuery, printQuery, printQuery, printSubgraph, printSubgraph, printSubgraph, registerNodeTypes, removeAllChildren, removeAllChildren, repeatedlyWithSession, resourceUrl, setDebug, uploadFile, uploadFile, uploadFile, uploadFileAndBlock, uploadFileAndBlock, uploadFileAndBlock, uploadFilesAndBlock, var, vars, withSession
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getRedirectURI
addType, findMementoByDatetime, findOrCreateAcl, getAcl, getChild, getChildren, getChildren, getContainer, getCreatedDate, getDescribedResource, getEtagValue, getLastModifiedDate, getMementoDatetime, getOriginalResource, getPath, getStateToken, getTimeMap, getTriples, getTypes, hasProperty, hasType, isAcl, isMemento, isNew, isOriginalResource, isTimeMap, replaceProperties, updateProperties
public FedoraBinaryImpl(javax.jcr.Node node)
node
- the nodepublic InputStream getContent()
public void setExternalContent(String contentType, Collection<URI> checksums, String originalFileName, String externalHandling, String externalUrl) throws InvalidChecksumException
FedoraBinary
contentType
- MIME type of content (optional)checksums
- Collection of checksum URIs of the content (optional)originalFileName
- Original file name of the content (optional)externalHandling
- What type of handling the external resource needs (proxy or redirect)externalUrl
- Url for the external resourcejInvalidChecksumException
- if invalid checksum exception occurredpublic void setContent(InputStream content, String contentType, Collection<URI> checksums, String originalFileName, StoragePolicyDecisionPoint storagePolicyDecisionPoint) throws InvalidChecksumException
FedoraBinary
content
- InputStream of binary content to be storedcontentType
- MIME type of content (optional)checksums
- Collection of checksum URIs of the content (optional)originalFileName
- Original file name of the content (optional)storagePolicyDecisionPoint
- Policy decision point for storing the content (optional)InvalidChecksumException
- if invalid checksum exception occurredpublic long getContentSize()
getContentSize
in interface FedoraBinary
getContentSize
in class AbstractFedoraBinary
public URI getContentDigest()
FedoraBinary
getContentDigest
in interface FedoraBinary
getContentDigest
in class AbstractFedoraBinary
public String getMimeType()
public String getFilename()
FedoraBinary
getFilename
in interface FedoraBinary
getFilename
in class AbstractFedoraBinary
public RdfStream getFixity(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator)
FedoraBinary
getFixity
in interface FedoraBinary
getFixity
in class AbstractFedoraBinary
idTranslator
- the id translatorpublic RdfStream getFixity(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator, URI digestUri, long size)
FedoraBinary
idTranslator
- the id translatordigestUri
- the checksum to compare againstsize
- the expected size of the binarypublic Collection<URI> checkFixity(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator, Collection<String> algorithms) throws UnsupportedAlgorithmException
FedoraBinary
idTranslator
- the id translatoralgorithms
- the digest algorithms to be usedUnsupportedAlgorithmException
- if unsupported digest algorithm occurredpublic void delete()
delete
in interface FedoraResource
delete
in class AbstractFedoraBinary
protected boolean hasDescriptionProperty(String relPath)
AbstractFedoraBinary
hasDescriptionProperty
in class AbstractFedoraBinary
relPath
- - path to the propertypublic RdfStream getTriples(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator, Set<? extends TripleCategory> contexts)
FedoraResource
getTriples
in interface FedoraResource
getTriples
in class FedoraResourceImpl
idTranslator
- the property of idTranslatorcontexts
- the provided contextspublic static boolean hasMixin(javax.jcr.Node node)
node
- the given nodeCopyright © 2013–2019 DuraSpace, Inc.. All rights reserved.