public class DefaultDocumentRequestHandler extends Object implements AsyncDocumentRequestHandler
Constructor and Description |
---|
DefaultDocumentRequestHandler() |
Modifier and Type | Method and Description |
---|---|
static Resources |
getResFile()
Allows URL's referring to a res:// local resource to default to this file
|
boolean |
isTrackVisitedURLs()
Allows tracking whether a URL was visited or not
|
InputStream |
resourceRequested(DocumentInfo docInfo)
Implementations should return the document in the requested url as an InputStream
This is triggered only for the main document requested and not for its resources.
|
void |
resourceRequestedAsync(DocumentInfo docInfo,
IOCallback callback)
This method is called by HTMLComponent when a resource is requested asynchronously.
|
static void |
setResFile(Resources res)
Allows URL's referring to a local:// local resource to default to this file
|
void |
setTrackVisitedURLs(boolean trackVisitedURLs)
Allows tracking whether a URL was visited or not
|
protected void |
visitingURL(String url)
This method can be invoked to indicate a URL was visited fro tracking
|
boolean |
wasURLVisited(String url)
Returns true if the URL was visited, requires trackVisitedURLs to be true
|
public void resourceRequestedAsync(DocumentInfo docInfo, IOCallback callback)
resourceRequestedAsync
in interface AsyncDocumentRequestHandler
docInfo
- A DocumentInfo object representing the requested URL and its attributescallback
- The HTMLComponent that should be called back when the stream was fetched.public InputStream resourceRequested(DocumentInfo docInfo)
resourceRequested
in interface DocumentRequestHandler
docInfo
- A DocumentInfo object representing the requested URL and its attributesprotected void visitingURL(String url)
url
- the urlpublic boolean wasURLVisited(String url)
url
- the urlpublic static Resources getResFile()
public static void setResFile(Resources res)
res
- the resourcepublic boolean isTrackVisitedURLs()
public void setTrackVisitedURLs(boolean trackVisitedURLs)
trackVisitedURLs
- the trackVisitedURLs to set