Class BitstreamResourceAccessByToken

All Implemented Interfaces:
InputStreamSource, Resource

public class BitstreamResourceAccessByToken extends BitstreamResource
This class acts as a AbstractResource used by Spring's framework to send the data in a proper and streamlined way inside the ResponseEntity body. This class' attributes are being used by Spring's framework in the overridden methods so that the proper attributes are given and used in the response. Unlike the BitstreamResource, this resource expects a valid and authorised access token to use when retrieving actual bitstream data. It will either set a special group in the temp context for READ of the bitstream, or turn off authorisation for the lifetime of the temp (autocloseable in try-with-resources) context
Author:
Kim Shepherd
  • Constructor Details

    • BitstreamResourceAccessByToken

      public BitstreamResourceAccessByToken(String name, UUID uuid, UUID currentUserUUID, Set<UUID> currentSpecialGroups, boolean shouldGenerateCoverPage, String accessToken)
  • Method Details

    • fetchDocument

      public void fetchDocument()
      Get the bitstream content using the special temporary context if the request-a-copy access request is properly authenticated and authorised. After this method is called, the bitstream content is updated so the correct input stream can be returned
      Throws:
      IOException