public interface ToadletContext
Modifier and Type | Method and Description |
---|---|
Toadlet |
activeToadlet() |
HTMLNode |
addFormChild(HTMLNode parentNode,
java.lang.String target,
java.lang.String id)
Add a form node to an HTMLNode under construction.
|
boolean |
checkFormPassword(HTTPRequest request)
Check a request for the form password, and send an error to the client if the password is
not valid.
|
boolean |
checkFormPassword(HTTPRequest request,
java.lang.String redirectTo)
Check a request for the form password, and send an error to the client if the password is
not valid.
|
boolean |
checkFullAccess(Toadlet toadlet)
Check a context for whether
isAllowedFullAccess() is true. |
boolean |
disableProgressPage() |
boolean |
doRobots()
Return a robots.txt excluding all spiders and other non-browser HTTP clients?
|
void |
forceDisconnect()
Force a disconnection after handling this request.
|
UserAlertManager |
getAlertManager()
Get the user alert manager.
|
BookmarkManager |
getBookmarkManager()
Get the bookmark manager.
|
BucketFactory |
getBucketFactory() |
ToadletContainer |
getContainer() |
ReceivedCookie |
getCookie(java.net.URI domain,
java.net.URI path,
java.lang.String name)
Get an existing
Cookie (sent by the client) from the headers. |
java.lang.String |
getFormPassword()
Get the form password required for "dangerous" operations.
|
MultiValueTable<java.lang.String,java.lang.String> |
getHeaders() |
PageMaker |
getPageMaker()
Get the page maker object.
|
FProxyFetchInProgress.REFILTER_POLICY |
getReFilterPolicy()
What to do when we find cached data on the global queue but it's already been
filtered, and we want a filtered copy.
|
java.lang.String |
getUniqueId()
Returns the unique id of this request
|
java.net.URI |
getUri() |
boolean |
hasFormPassword(HTTPRequest request)
Check a request for the form password.
|
boolean |
isAdvancedModeEnabled()
Is the web interface in advanced mode?
|
boolean |
isAllowedFullAccess()
Is this Toadlet allowed full access to the node, including the ability to reconfigure it,
restart it etc?
|
void |
sendReplyHeaders(int code,
java.lang.String desc,
MultiValueTable<java.lang.String,java.lang.String> mvt,
java.lang.String mimeType,
long length)
Write reply headers for generated content (web interface pages) and redirects etc.
|
void |
sendReplyHeaders(int code,
java.lang.String desc,
MultiValueTable<java.lang.String,java.lang.String> mvt,
java.lang.String mimeType,
long length,
boolean forceDisableJavascript)
Write reply headers for generated content (web interface pages) and redirects etc.
|
void |
sendReplyHeaders(int code,
java.lang.String desc,
MultiValueTable<java.lang.String,java.lang.String> mvt,
java.lang.String mimeType,
long length,
java.util.Date mTime)
Deprecated.
Write reply headers for either generated content (web interface pages) or static content.
Callers should use either sendReplyHeaders() or sendReplyHeadersStatic()!
|
void |
sendReplyHeadersFProxy(int code,
java.lang.String desc,
MultiValueTable<java.lang.String,java.lang.String> mvt,
java.lang.String mimeType,
long length)
Write reply headers for content downloaded from Freenet.
|
void |
sendReplyHeadersStatic(int code,
java.lang.String desc,
MultiValueTable<java.lang.String,java.lang.String> mvt,
java.lang.String mimeType,
long length,
java.util.Date mTime)
Write reply headers with a customised modification time for static content.
|
void |
setCookie(Cookie newCookie)
Set a
Cookie , it will be sent with the reply headers to the client. |
void |
writeData(Bucket data)
Write data from a bucket.
|
void |
writeData(byte[] data)
Convenience method that simply calls
writeData(byte[], int, int) . |
void |
writeData(byte[] data,
int offset,
int length)
Write data.
|
void sendReplyHeaders(int code, java.lang.String desc, MultiValueTable<java.lang.String,java.lang.String> mvt, java.lang.String mimeType, long length) throws ToadletContextClosedException, java.io.IOException
code
- HTTP code.desc
- HTTP code description.mvt
- Any extra headers. Can be null.mimeType
- The MIME type of the reply.length
- The length of the reply.forceDisableJavascript
- Disable javascript even if it is enabled for the web interface
as a whole.ToadletContextClosedException
java.io.IOException
void sendReplyHeaders(int code, java.lang.String desc, MultiValueTable<java.lang.String,java.lang.String> mvt, java.lang.String mimeType, long length, boolean forceDisableJavascript) throws ToadletContextClosedException, java.io.IOException
code
- HTTP code.desc
- HTTP code description.mvt
- Any extra headers. Can be null.mimeType
- The MIME type of the reply.length
- The length of the reply.forceDisableJavascript
- Disable javascript even if it is enabled for the web interface
as a whole.ToadletContextClosedException
java.io.IOException
@Deprecated void sendReplyHeaders(int code, java.lang.String desc, MultiValueTable<java.lang.String,java.lang.String> mvt, java.lang.String mimeType, long length, java.util.Date mTime) throws ToadletContextClosedException, java.io.IOException
ToadletContextClosedException
java.io.IOException
void sendReplyHeadersStatic(int code, java.lang.String desc, MultiValueTable<java.lang.String,java.lang.String> mvt, java.lang.String mimeType, long length, java.util.Date mTime) throws ToadletContextClosedException, java.io.IOException
code
- HTTP code.desc
- HTTP code description.mvt
- Any extra headers. Can be null.mimeType
- The MIME type of the reply.length
- The length of the reply.mTime
- The modification time of the data being sent.ToadletContextClosedException
java.io.IOException
void sendReplyHeadersFProxy(int code, java.lang.String desc, MultiValueTable<java.lang.String,java.lang.String> mvt, java.lang.String mimeType, long length) throws ToadletContextClosedException, java.io.IOException
code
- HTTP code.desc
- HTTP code description.mvt
- Any extra headers. Can be null.mimeType
- The MIME type of the reply.length
- The length of the reply.ToadletContextClosedException
java.io.IOException
void writeData(byte[] data, int offset, int length) throws ToadletContextClosedException, java.io.IOException
ToadletContextClosedException
java.io.IOException
void forceDisconnect()
void writeData(byte[] data) throws ToadletContextClosedException, java.io.IOException
writeData(byte[], int, int)
.data
- The data to writeToadletContextClosedException
- if the context has already been closedjava.io.IOException
- if an I/O error occursvoid writeData(Bucket data) throws ToadletContextClosedException, java.io.IOException
data
- The Bucket which contains the data. This function
assumes ownership of the Bucket, calling free() on it
when done. If this behavior is undesired, callers can
wrap their Bucket in a NoFreeBucket.ToadletContextClosedException
java.io.IOException
NoFreeBucket
PageMaker getPageMaker()
java.lang.String getFormPassword()
boolean checkFormPassword(HTTPRequest request, java.lang.String redirectTo) throws ToadletContextClosedException, java.io.IOException
request
- The request to check.redirectTo
- The location to redirect to if the password is not set.ToadletContextClosedException
java.io.IOException
boolean checkFormPassword(HTTPRequest request) throws ToadletContextClosedException, java.io.IOException
request
- The request to check.ToadletContextClosedException
java.io.IOException
boolean hasFormPassword(HTTPRequest request) throws java.io.IOException
java.io.IOException
boolean checkFullAccess(Toadlet toadlet) throws ToadletContextClosedException, java.io.IOException
isAllowedFullAccess()
is true.
If it is false, an error page is sent to the client, and false is returned.
You can then abort processing of the request.isAllowedFullAccess()
.java.io.IOException
- See Toadlet.sendUnauthorizedPage(ToadletContext)
ToadletContextClosedException
- See Toadlet.sendUnauthorizedPage(ToadletContext)
UserAlertManager getAlertManager()
BookmarkManager getBookmarkManager()
BucketFactory getBucketFactory()
MultiValueTable<java.lang.String,java.lang.String> getHeaders()
ReceivedCookie getCookie(java.net.URI domain, java.net.URI path, java.lang.String name) throws java.text.ParseException
Cookie
(sent by the client) from the headers.java.text.ParseException
void setCookie(Cookie newCookie)
Cookie
, it will be sent with the reply headers to the client.HTMLNode addFormChild(HTMLNode parentNode, java.lang.String target, java.lang.String id)
parentNode
- The parent HTMLNode.target
- Where the form should be POSTed to.id
- HTML name for the form for stylesheet/script access. Will be added as both id and name.boolean isAllowedFullAccess()
boolean isAdvancedModeEnabled()
boolean doRobots()
ToadletContainer getContainer()
boolean disableProgressPage()
Toadlet activeToadlet()
java.lang.String getUniqueId()
java.net.URI getUri()
FProxyFetchInProgress.REFILTER_POLICY getReFilterPolicy()