Class InformationResource
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Path that will be used if not overridden byKey.IIIF_1_ENDPOINT_PATH
in the application configuration.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.void
doInit()
Initialization method, called after all necessary setters have been called but before any request handler method (likeAbstractResource.doGET()
etc.)protected org.slf4j.Logger
Part of theResource
contract.static String
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
-
Field Details
-
DEFAULT_URI_PATH
Path that will be used if not overridden byKey.IIIF_1_ENDPOINT_PATH
in the application configuration.- See Also:
-
-
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.
-
getURIPath
- Returns:
- URI path prefix without trailing slash.
-
doInit
Description copied from class:AbstractResource
Initialization 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:
doInit
in classIIIFResource
- Throws:
Exception
- upon any error. This may be aResourceException
to enable a custom status.
-