Class BitstreamRestRepository

    • Constructor Detail

      • BitstreamRestRepository

        @Autowired
        public BitstreamRestRepository​(org.dspace.content.service.BitstreamService dsoService)
    • Method Detail

      • findOne

        @PreAuthorize("hasPermission(#id, \'BITSTREAM\', \'METADATA_READ\')")
        public BitstreamRest findOne​(org.dspace.core.Context context,
                                     UUID id)
        Description copied from class: DSpaceRestRepository
        Method to implement to support retrieval of a specific REST object instance
        Specified by:
        findOne in class DSpaceRestRepository<BitstreamRest,​UUID>
        Parameters:
        context - the dspace context
        id - the rest object id
        Returns:
        the REST object identified by its ID
      • findAll

        @PreAuthorize("hasAuthority(\'ADMIN\')")
        public org.springframework.data.domain.Page<BitstreamRest> findAll​(org.dspace.core.Context context,
                                                                           org.springframework.data.domain.Pageable pageable)
        Description copied from class: DSpaceRestRepository
        Method to implement to support scroll of entity instances from the collection resource endpoint
        Specified by:
        findAll in class DSpaceRestRepository<BitstreamRest,​UUID>
        Parameters:
        context - the dspace context
        pageable - object embedding the requested pagination info
        Returns:
      • patch

        @PreAuthorize("hasPermission(#id, \'BITSTREAM\', \'WRITE\')")
        protected void patch​(org.dspace.core.Context context,
                             javax.servlet.http.HttpServletRequest request,
                             String apiCategory,
                             String model,
                             UUID id,
                             Patch patch)
                      throws org.dspace.authorize.AuthorizeException,
                             SQLException
        Description copied from class: DSpaceRestRepository
        Method to implement to allow partial update of the REST object via JSON Patch
        Overrides:
        patch in class DSpaceRestRepository<BitstreamRest,​UUID>
        request - the http request
        id - the ID of the target REST object
        patch - the JSON Patch (https://tools.ietf.org/html/rfc6902) operation
        Throws:
        org.dspace.authorize.AuthorizeException
        SQLException
      • delete

        protected void delete​(org.dspace.core.Context context,
                              UUID id)
                       throws org.dspace.authorize.AuthorizeException
        Description copied from class: DSpaceRestRepository
        Method to implement to support delete of a single object instance
        Overrides:
        delete in class DSpaceRestRepository<BitstreamRest,​UUID>
        Parameters:
        context - the dspace context
        id - the id of the rest object to delete
        Throws:
        org.dspace.authorize.AuthorizeException
      • findByItemHandle

        public BitstreamRest findByItemHandle​(String handle,
                                              Integer sequence,
                                              String filename)
        Find the bitstream for the provided handle and sequence or filename. When a bitstream can be found with the sequence ID it will be returned if the user has "METADATA_READ" access.
        Parameters:
        handle - The handle of the item
        sequence - The sequence ID of the bitstream
        filename - The filename of the bitstream
        Returns:
        a Page of BitstreamRest instance matching the user query
      • performBitstreamMove

        public BundleRest performBitstreamMove​(org.dspace.core.Context context,
                                               org.dspace.content.Bitstream bitstream,
                                               org.dspace.content.Bundle targetBundle)
                                        throws SQLException,
                                               IOException,
                                               org.dspace.authorize.AuthorizeException
        Method that will move the bitstream corresponding to the uuid to the target bundle
        Parameters:
        context - The context
        bitstream - The bitstream to be moved
        targetBundle - The target bundle
        Returns:
        The target bundle with the bitstream attached
        Throws:
        SQLException
        IOException
        org.dspace.authorize.AuthorizeException