Class ItemArchive


  • public class ItemArchive
    extends Object
    Encapsulates the Item in the context of the DSpace Archive Format
    • Field Detail

      • dtomList

        protected List<org.dspace.app.itemupdate.DtoMetadata> dtomList
      • undoDtomList

        protected List<org.dspace.app.itemupdate.DtoMetadata> undoDtomList
      • undoAddContents

        protected List<UUID> undoAddContents
      • item

        protected Item item
      • dir

        protected File dir
      • dirname

        protected String dirname
    • Constructor Detail

      • ItemArchive

        protected ItemArchive()
    • Method Detail

      • create

        public static ItemArchive create​(Context context,
                                         File dir,
                                         String itemField)
                                  throws Exception
        factory method Minimal requirements for dublin_core.xml for this application is the presence of dc.identifier.uri which must contain the handle for the item
        Parameters:
        context - - The DSpace context
        dir - - The directory File in the source archive
        itemField - - The metadata field in which the Item identifier is located if null, the default is the handle in the dc.identifier.uri field
        Returns:
        ItemArchive object
        Throws:
        Exception - if error
      • getItem

        public Item getItem()
        Getter for the DSpace item referenced in the archive
        Returns:
        DSpace item
      • getDirectory

        public File getDirectory()
        Getter for directory in archive on disk
        Returns:
        directory in archive
      • getDirectoryName

        public String getDirectoryName()
        Getter for directory name in archive
        Returns:
        directory name in archive
      • addUndoMetadataField

        public void addUndoMetadataField​(org.dspace.app.itemupdate.DtoMetadata dtom)
        Add metadata field to undo list
        Parameters:
        dtom - DtoMetadata (represents metadata field)
      • getMetadataFields

        public List<org.dspace.app.itemupdate.DtoMetadata> getMetadataFields()
        Getter for list of metadata fields
        Returns:
        list of metadata fields
      • addUndoDeleteContents

        public void addUndoDeleteContents​(UUID bitstreamId)
        Add bitstream id to delete contents file
        Parameters:
        bitstreamId - bitstream ID