public class ARCArchiveAccess extends Object implements URIResolver
NOT_FOUND
Constructor and Description |
---|
ARCArchiveAccess(ViewerArcRepositoryClient arcRepositoryClient)
Initialise new ARCArchiveAccess with no index file.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createNotFoundResponse(URI uri,
Response response)
Generate an appropriate response when a URI is not found.
|
protected String |
filterHeader(String headername,
String headercontents)
Apply filters to HTTP headers.
|
int |
lookup(Request request,
Response response)
Look up a given URI and add its contents to the Response given.
|
void |
setIndex(File index)
This method resets the Lucene index this object works on, and replaces it with the given index.
|
public ARCArchiveAccess(ViewerArcRepositoryClient arcRepositoryClient)
arcRepositoryClient
- The arcRepositoryClient to use when retrievingArgumentNotValid
- if arcRepositoryClient is null.public void setIndex(File index)
index
- The new index file, a directory containing Lucene files.ArgumentNotValid
- If argument is nullIOFailure
- if the file cannot be readpublic int lookup(Request request, Response response)
lookup
in interface URIResolver
request
- The request to look up record forresponse
- The response to return to the browserIOFailure
- on trouble looking up the request (timeout, i/o, etc.)URIResolver.lookup(Request, Response)
protected void createNotFoundResponse(URI uri, Response response)
uri
- The URI attempted read that could not be foundresponse
- The Response object to write the error response into.protected String filterHeader(String headername, String headercontents)
headername
- The name of the header field, e.g. Content-Type Remember that this is not case sensitiveheadercontents
- The contents of the header field, e.g. text/htmlCopyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.