Class InformationResource
-
Field Summary
Fields inherited from class is.galia.resource.iiif.v2.IIIF2Resource
DEFAULT_URI_PATH
Fields inherited from class is.galia.resource.AbstractResource
PUBLIC_IDENTIFIER_HEADER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Uses anAuthorizer
to determine how to respond to the request.protected boolean
Uses anAuthorizer
to determine how to respond to the request.void
doGET()
Writes a JSON-serialized information instance to the response.protected org.slf4j.Logger
Part of theResource
contract.Methods inherited from class is.galia.resource.iiif.v2.IIIF2Resource
doInit, getURIPath
Methods inherited from class is.galia.resource.iiif.IIIFResource
constrainSizeToMaxPixels, getIdentifier, getIdentifierPathComponent, getMetaIdentifier, getPublicIdentifier, getPublicReference, handleAuthInfoForInfoRequest, setLastModifiedHeader, validateScale
Methods inherited from class is.galia.resource.AbstractImageResource
getPageIndex, handleAuthInfo, isBypassingCache, isBypassingCacheRead, redirectToNormalizedScaleConstraint
Methods 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, setResponse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getLogger
in classAbstractResource
-
getRoutes
Description copied from class:AbstractResource
Part of theResource
contract.- Specified by:
getRoutes
in interfaceResource
- Specified by:
getRoutes
in classAbstractResource
- Returns:
- All routes to which the instance responds.
-
doGET
Writes a JSON-serialized information instance to the response.- Specified by:
doGET
in interfaceResource
- Overrides:
doGET
in classAbstractResource
- Throws:
Exception
- upon any error. This may be aResourceException
to enable a custom status.- See Also:
-
authorize
Description copied from class:AbstractImageResource
Uses an
Authorizer
to 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
ResourceException
s with HTTP 401 status.- Overrides:
authorize
in classAbstractImageResource
- Returns:
- Whether authorization was successful.
false
indicates 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:AbstractImageResource
Uses an
Authorizer
to 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
ResourceException
s with HTTP 401 status.- Overrides:
authorizeBeforeAccess
in classAbstractImageResource
- Returns:
- Whether authorization was successful.
false
indicates 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.
-