Class InformationResource
-
Field Summary
Fields inherited from class is.galia.resource.iiif.v2.IIIF2Resource
DEFAULT_URI_PATHFields 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.protected org.slf4j.LoggerPart of theResourcecontract.Methods inherited from class is.galia.resource.iiif.v2.IIIF2Resource
doInit, getURIPathMethods 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
-
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.
-