Package org.fcrepo.persistence.common
Class ResourceHeaderUtils
- java.lang.Object
-
- org.fcrepo.persistence.common.ResourceHeaderUtils
-
public class ResourceHeaderUtils extends Object
Helper utilities for populate resource headers- Author:
- bbpennel
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ResourceHeadersImpl
newResourceHeaders(FedoraId parentId, FedoraId fedoraId, String interactionModel)
Construct and populate minimal headers expected for a new resourcestatic void
populateBinaryHeaders(ResourceHeadersImpl headers, String mimetype, String filename, long filesize, Collection<URI> digests)
Populate general binary resource headersstatic void
populateExternalBinaryHeaders(ResourceHeadersImpl headers, String externalUrl, String externalHandling)
Populate external binary related headersstatic void
touchCreationHeaders(ResourceHeadersImpl headers, String userPrincipal)
Update creation headers to the current statestatic void
touchCreationHeaders(ResourceHeadersImpl headers, String userPrincipal, Instant createdDate)
Update creation headers to the current state.static void
touchMementoCreateHeaders(ResourceHeadersImpl headers)
static void
touchMementoCreateHeaders(ResourceHeadersImpl headers, Instant versionDate)
Update the mementoCreatedDate headerstatic void
touchModificationHeaders(ResourceHeadersImpl headers, String userPrincipal)
Update modification headers to the current statestatic void
touchModificationHeaders(ResourceHeadersImpl headers, String userPrincipal, Instant modifiedDate)
Update modification headers to the current state
-
-
-
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 parentfedoraId
- identifier of the new resourceinteractionModel
- 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 updateuserPrincipal
- 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 updateuserPrincipal
- user principal performing the changecreatedDate
- 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 updateuserPrincipal
- 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 updateuserPrincipal
- user principal performing the changemodifiedDate
- 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.
-
touchMementoCreateHeaders
public static void touchMementoCreateHeaders(ResourceHeadersImpl headers)
-
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 updatemimetype
- mimetypefilename
- filenamefilesize
- filesizedigests
- digests
-
populateExternalBinaryHeaders
public static void populateExternalBinaryHeaders(ResourceHeadersImpl headers, String externalUrl, String externalHandling)
Populate external binary related headers- Parameters:
headers
- headers object to updateexternalUrl
- url of external binary contentexternalHandling
- handling for the external content
-
-