Package org.fcrepo.migration
Interface DatastreamVersion
-
- All Known Implementing Classes:
FoxmlInputStreamFedoraObjectProcessor.Foxml11DatastreamVersion
public interface DatastreamVersion
An interface defining access to information about a version of a fedora datastream.- Author:
- mdurbin
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAltIds()Gets the altIDs value for this version.InputStreamgetContent()Gets access to the content of this datastream.ContentDigestgetContentDigest()Gets the content digest (if available) for this version.StringgetCreated()Gets the date when this version was created.DatastreamInfogetDatastreamInfo()Gets the information about the datastream for which this is a version.StringgetExternalOrRedirectURL()Returns the URL to which an External (X) or Redirect (R) datastream points.StringgetFormatUri()Gets the format URI for this version.StringgetLabel()Gets the label for this version.StringgetMimeType()Gets the mime type for this version.longgetSize()Gets the size (in bytes) for the content of this datastream version.StringgetVersionId()Gets the id for this version.booleanisFirstVersionIn(ObjectReference obj)Determines if this is the first version of a datastream.booleanisLastVersionIn(ObjectReference obj)Determines if this is the last version of a datastream.
-
-
-
Method Detail
-
getDatastreamInfo
DatastreamInfo getDatastreamInfo()
Gets the information about the datastream for which this is a version. (which in turn can be queried to get information about the object).- Returns:
DatastreamInfo
-
getVersionId
String getVersionId()
Gets the id for this version.- Returns:
- version id
-
getMimeType
String getMimeType()
Gets the mime type for this version.- Returns:
- mime-type
-
getCreated
String getCreated()
Gets the date when this version was created.- Returns:
- creation date
-
getFormatUri
String getFormatUri()
Gets the format URI for this version.- Returns:
- format URI
-
getSize
long getSize()
Gets the size (in bytes) for the content of this datastream version.- Returns:
- size
-
getContentDigest
ContentDigest getContentDigest()
Gets the content digest (if available) for this version.- Returns:
ContentDigest
-
getContent
InputStream getContent() throws IOException
Gets access to the content of this datastream. When text, the encoding can be expected to be UTF-8.- Returns:
of content- Throws:
IllegalStateException- if invoked outside of the call to @{link StreamingFedoraObjectHandler#processDatastreamVersion}IOException- when unable to access the stream
-
getExternalOrRedirectURL
String getExternalOrRedirectURL()
Returns the URL to which an External (X) or Redirect (R) datastream points. Throws IllegalStateException if this isn't an external or redirect datastream.- Returns:
- URL of datastream
-
isFirstVersionIn
boolean isFirstVersionIn(ObjectReference obj)
Determines if this is the first version of a datastream.- Parameters:
obj- to be tested whether is first version- Returns:
- True if this is the first version, false otherwise.
-
isLastVersionIn
boolean isLastVersionIn(ObjectReference obj)
Determines if this is the last version of a datastream.- Parameters:
obj- to be tested whether is last version- Returns:
- True if this is the last version, false otherwise.
-
-