Package org.fcrepo.migration.foxml
Class FoxmlInputStreamFedoraObjectProcessor.Foxml11DatastreamVersion
- java.lang.Object
-
- org.fcrepo.migration.foxml.FoxmlInputStreamFedoraObjectProcessor.Foxml11DatastreamVersion
-
- All Implemented Interfaces:
DatastreamVersion
- Enclosing class:
- FoxmlInputStreamFedoraObjectProcessor
public class FoxmlInputStreamFedoraObjectProcessor.Foxml11DatastreamVersion extends Object implements DatastreamVersion
-
-
Constructor Summary
Constructors Constructor Description Foxml11DatastreamVersion(DatastreamInfo dsInfo, XMLStreamReader reader)foxml datastream version.
-
Method Summary
All Methods Instance Methods Concrete 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.Optional<File>getFile()Get the file backing this datastream if it exists.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.
-
-
-
Constructor Detail
-
Foxml11DatastreamVersion
public Foxml11DatastreamVersion(DatastreamInfo dsInfo, XMLStreamReader reader) throws XMLStreamException
foxml datastream version.- Parameters:
dsInfo- the datastream informationreader- the reader- Throws:
XMLStreamException- xml stream exception
-
-
Method Detail
-
getFile
public Optional<File> getFile()
Description copied from interface:DatastreamVersionGet the file backing this datastream if it exists. Used by fcrepo-migration-validator in order to get direct access to files.- Specified by:
getFilein interfaceDatastreamVersion- Returns:
- the file
-
getDatastreamInfo
public DatastreamInfo getDatastreamInfo()
Description copied from interface:DatastreamVersionGets the information about the datastream for which this is a version. (which in turn can be queried to get information about the object).- Specified by:
getDatastreamInfoin interfaceDatastreamVersion- Returns:
DatastreamInfo
-
getVersionId
public String getVersionId()
Description copied from interface:DatastreamVersionGets the id for this version.- Specified by:
getVersionIdin interfaceDatastreamVersion- Returns:
- version id
-
getMimeType
public String getMimeType()
Description copied from interface:DatastreamVersionGets the mime type for this version.- Specified by:
getMimeTypein interfaceDatastreamVersion- Returns:
- mime-type
-
getLabel
public String getLabel()
Description copied from interface:DatastreamVersionGets the label for this version.- Specified by:
getLabelin interfaceDatastreamVersion- Returns:
- label
-
getCreated
public String getCreated()
Description copied from interface:DatastreamVersionGets the date when this version was created.- Specified by:
getCreatedin interfaceDatastreamVersion- Returns:
- creation date
-
getAltIds
public String getAltIds()
Description copied from interface:DatastreamVersionGets the altIDs value for this version.- Specified by:
getAltIdsin interfaceDatastreamVersion- Returns:
- alternate IDs
-
getFormatUri
public String getFormatUri()
Description copied from interface:DatastreamVersionGets the format URI for this version.- Specified by:
getFormatUriin interfaceDatastreamVersion- Returns:
- format URI
-
getSize
public long getSize()
Description copied from interface:DatastreamVersionGets the size (in bytes) for the content of this datastream version.- Specified by:
getSizein interfaceDatastreamVersion- Returns:
- size
-
getContentDigest
public ContentDigest getContentDigest()
Description copied from interface:DatastreamVersionGets the content digest (if available) for this version.- Specified by:
getContentDigestin interfaceDatastreamVersion- Returns:
ContentDigest
-
getContent
public InputStream getContent() throws IOException
Description copied from interface:DatastreamVersionGets access to the content of this datastream. When text, the encoding can be expected to be UTF-8.- Specified by:
getContentin interfaceDatastreamVersion- Returns:
of content- Throws:
IOException- when unable to access the stream
-
getExternalOrRedirectURL
public String getExternalOrRedirectURL()
Description copied from interface:DatastreamVersionReturns the URL to which an External (X) or Redirect (R) datastream points. Throws IllegalStateException if this isn't an external or redirect datastream.- Specified by:
getExternalOrRedirectURLin interfaceDatastreamVersion- Returns:
- URL of datastream
-
isFirstVersionIn
public boolean isFirstVersionIn(ObjectReference obj)
Description copied from interface:DatastreamVersionDetermines if this is the first version of a datastream.- Specified by:
isFirstVersionInin interfaceDatastreamVersion- Parameters:
obj- to be tested whether is first version- Returns:
- True if this is the first version, false otherwise.
-
isLastVersionIn
public boolean isLastVersionIn(ObjectReference obj)
Description copied from interface:DatastreamVersionDetermines if this is the last version of a datastream.- Specified by:
isLastVersionInin interfaceDatastreamVersion- Parameters:
obj- to be tested whether is last version- Returns:
- True if this is the last version, false otherwise.
-
-