Class ResourceHeaderUtils

    • Method Detail

      • newResourceHeaders

        public static ResourceHeadersImpl newResourceHeaders​(FedoraId parentId,
                                                             FedoraId fedoraId,
                                                             String interactionModel)
        Construct and populate minimal headers expected for a new resource
        Parameters:
        parentId - identifier of the parent
        fedoraId - identifier of the new resource
        interactionModel - interaction model of the resource
        Returns:
        new resource headers object
      • touchCreationHeaders

        public static void touchCreationHeaders​(ResourceHeadersImpl headers,
                                                String userPrincipal)
        Update creation headers to the current state
        Parameters:
        headers - headers object to update
        userPrincipal - user principal performing the change
      • touchCreationHeaders

        public static void touchCreationHeaders​(ResourceHeadersImpl headers,
                                                String userPrincipal,
                                                Instant createdDate)
        Update creation headers to the current state.
        Parameters:
        headers - headers object to update
        userPrincipal - user principal performing the change
        createdDate - time created. Defaults to now if not provided.
      • touchModificationHeaders

        public static void touchModificationHeaders​(ResourceHeadersImpl headers,
                                                    String userPrincipal)
        Update modification headers to the current state
        Parameters:
        headers - headers object to update
        userPrincipal - user principal performing the change
      • touchModificationHeaders

        public static void touchModificationHeaders​(ResourceHeadersImpl headers,
                                                    String userPrincipal,
                                                    Instant modifiedDate)
        Update modification headers to the current state
        Parameters:
        headers - headers object to update
        userPrincipal - user principal performing the change
        modifiedDate - modified time. Defaults to now if not provided.
      • touchMementoCreateHeaders

        public static void touchMementoCreateHeaders​(ResourceHeadersImpl headers,
                                                     Instant versionDate)
        Update the mementoCreatedDate header
        Parameters:
        headers - headers object to update.
        versionDate - time this version is created.
      • populateBinaryHeaders

        public static void populateBinaryHeaders​(ResourceHeadersImpl headers,
                                                 String mimetype,
                                                 String filename,
                                                 long filesize,
                                                 Collection<URI> digests)
        Populate general binary resource headers
        Parameters:
        headers - headers object to update
        mimetype - mimetype
        filename - filename
        filesize - filesize
        digests - digests
      • populateExternalBinaryHeaders

        public static void populateExternalBinaryHeaders​(ResourceHeadersImpl headers,
                                                         String externalUrl,
                                                         String externalHandling)
        Populate external binary related headers
        Parameters:
        headers - headers object to update
        externalUrl - url of external binary content
        externalHandling - handling for the external content