Class InformationResource
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPath that will be used if not overridden byKey.IIIF_1_ENDPOINT_PATHin the application configuration.Fields inherited from class is.galia.resource.AbstractResource
PUBLIC_IDENTIFIER_HEADER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanUses anAuthorizerto determine how to respond to the request.protected booleanUses anAuthorizerto determine how to respond to the request.voiddoGET()Writes a JSON-serialized information instance to the response.voiddoInit()Initialization method, called after all necessary setters have been called but before any request handler method (likeAbstractResource.doGET()etc.)protected org.slf4j.LoggerPart of theResourcecontract.static StringMethods inherited from class is.galia.resource.iiif.IIIFResource
constrainSizeToMaxPixels, getIdentifier, getIdentifierPathComponent, getMetaIdentifier, getPublicIdentifier, getPublicReference, handleAuthInfoForInfoRequest, setLastModifiedHeader, validateScaleMethods inherited from class is.galia.resource.AbstractImageResource
getPageIndex, handleAuthInfo, isBypassingCache, isBypassingCacheRead, redirectToNormalizedScaleConstraintMethods inherited from class is.galia.resource.AbstractResource
authenticateUsingBasic, decodePathComponent, destroy, doDELETE, doHEAD, doOPTIONS, doPATCH, doPOST, doPUT, getCanonicalClientIPAddress, getCommonTemplateVars, getDelegate, getLocalBasePath, getPreferredMediaTypes, getPublicReference, getPublicRootReference, getRepresentationDisposition, getRequest, getRequestContext, getResponse, negotiateContentType, setRequest, setResponseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface is.galia.resource.Resource
destroy, doDELETE, doHEAD, doInit, doOPTIONS, doPATCH, doPOST, doPUT, getRequest, getResponse, setRequest, setResponse
-
Field Details
-
DEFAULT_URI_PATH
Path that will be used if not overridden byKey.IIIF_1_ENDPOINT_PATHin the application configuration.- See Also:
-
-
Constructor Details
-
InformationResource
public InformationResource()
-
-
Method Details
-
getLogger
protected org.slf4j.Logger getLogger()- Specified by:
getLoggerin classAbstractResource
-
getRoutes
Description copied from class:AbstractResourcePart of theResourcecontract.- Specified by:
getRoutesin interfaceResource- Specified by:
getRoutesin classAbstractResource- Returns:
- All routes to which the instance responds.
-
doGET
Writes a JSON-serialized information instance to the response.- Specified by:
doGETin interfaceResource- Overrides:
doGETin classAbstractResource- Throws:
Exception- upon any error. This may be aResourceExceptionto enable a custom status.- See Also:
-
authorize
Description copied from class:AbstractImageResourceUses an
Authorizerto determine how to respond to the request. The response is modified if necessary.The authorization system supports simple boolean authorization which maps to the HTTP 200 and 403 statuses.
Authorization can simultaneously be used in the context of the IIIF Authentication API, where it works a little differently. Here, HTTP 401 is returned instead of 403, and the response body does include image information. (See Interaction with Access-Controlled Resources. This means that IIIF information endpoints should swallow any
ResourceExceptions with HTTP 401 status.- Overrides:
authorizein classAbstractImageResource- Returns:
- Whether authorization was successful.
falseindicates a redirect, and client code should abort. - Throws:
IOException- if there was an I/O error while checking authorization.ResourceException- if authorization resulted in an HTTP 400-level response.
-
authorizeBeforeAccess
Description copied from class:AbstractImageResourceUses an
Authorizerto determine how to respond to the request. The response is modified if necessary.The authorization system supports simple boolean authorization which maps to the HTTP 200 and 403 statuses.
Authorization can simultaneously be used in the context of the IIIF Authentication API, where it works a little differently. Here, HTTP 401 is returned instead of 403, and the response body does include image information. (See Interaction with Access-Controlled Resources. This means that IIIF information endpoints should swallow any
ResourceExceptions with HTTP 401 status.- Overrides:
authorizeBeforeAccessin classAbstractImageResource- Returns:
- Whether authorization was successful.
falseindicates a redirect, and client code should abort. - Throws:
IOException- if there was an I/O error while checking authorization.ResourceException- if authorization resulted in an HTTP 400-level response.
-
getURIPath
- Returns:
- URI path prefix without trailing slash.
-
doInit
Description copied from class:AbstractResourceInitialization method, called after all necessary setters have been called but before any request handler method (like
AbstractResource.doGET()etc.)If an implementation class has anything to do with
image identifiers, it should add the request identifier to therequest context.Overrides must call
super.- Overrides:
doInitin classIIIFResource- Throws:
Exception- upon any error. This may be aResourceExceptionto enable a custom status.
-