|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.viewerproxy.ARCArchiveAccess
public class ARCArchiveAccess
The ARCArchiveAccess class implements reading of ARC indexes and files. It builds on the Java ARC utils and Lucene indexes, and handles using these in an HTTP context.
Field Summary |
---|
Fields inherited from interface dk.netarkivet.viewerproxy.URIResolver |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
ARCArchiveAccess(ViewerArcRepositoryClient arcRepositoryClient)
Initialise new ARCArchiveAccess with no index file. |
Method Summary | |
---|---|
protected void |
createNotFoundResponse(java.net.URI uri,
Response response)
Generate an appropriate response when a URI is not found. |
protected java.lang.String |
filterHeader(java.lang.String headername,
java.lang.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(java.io.File index)
This method resets the Lucene index this object works on, and replaces it with the given index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ARCArchiveAccess(ViewerArcRepositoryClient arcRepositoryClient)
arcRepositoryClient
- The arcRepositoryClient to use when retrieving
ArgumentNotValid
- if arcRepositoryClient is null.Method Detail |
---|
public void setIndex(java.io.File index)
index
- The new index file, a directory containing Lucene files.
ArgumentNotValid
- If argument is null
IOFailure
- 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 optionally update.
IOFailure
- on trouble looking up the request (timeout, i/o, etc.)URIResolver.lookup(Request, Response)
protected void createNotFoundResponse(java.net.URI uri, Response response)
uri
- The URI attempted read that could not be foundresponse
- The Response object to write the error response into.protected java.lang.String filterHeader(java.lang.String headername, java.lang.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/html
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |