public abstract class LocalFileBrowserToadlet extends Toadlet
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
changeDir
Part set when a directory is changed.
|
protected NodeClientCore |
core |
static java.lang.String |
selectDir
Part set when a directory is selected.
|
static java.lang.String |
selectFile
Part set when a file is selected.
|
HANDLE_METHOD_PREFIX
Constructor and Description |
---|
LocalFileBrowserToadlet(NodeClientCore core,
HighLevelSimpleClient highLevelSimpleClient) |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
allowedDir(java.io.File path)
Whether the directory is allowed for the purposes of the specific browser.
|
protected void |
createSelectDirectoryButton(HTMLNode node,
java.lang.String absolutePath,
HTMLNode persistence)
Renders directory selection button with selectDir and filenameField() set.
|
protected void |
createSelectFileButton(HTMLNode node,
java.lang.String absolutePath,
HTMLNode persistence)
Renders file selection button with selectFile and filenameField() set.
|
protected java.lang.String |
defaultDownloadDir()
Determines the appropriate directory to start out in if browsing for something to download.
|
protected java.lang.String |
defaultUploadDir()
Determines the appropriate directory to start out in if browsing for something to upload.
|
protected java.lang.String |
filenameField() |
void |
handleMethodGET(java.net.URI uri,
HTTPRequest request,
ToadletContext ctx)
Handle a GET request.
|
void |
handleMethodPOST(java.net.URI uri,
HTTPRequest request,
ToadletContext ctx) |
abstract java.lang.String |
path() |
protected abstract java.util.Hashtable<java.lang.String,java.lang.String> |
persistenceFields(java.util.Hashtable<java.lang.String,java.lang.String> set)
Performs sanity checks and generates parameter persistence fields.
|
protected abstract java.lang.String |
postTo() |
protected abstract java.lang.String |
startingDir()
Determines the appropriate directory to start out in for the given browser.
|
addHomepageLink, allowPOSTWithoutPassword, findSupportedMethods, getClientImpl, sendErrorPage, sendErrorPage, sendErrorPage, showAsToadlet, showAsToadlet, writeHTMLReply, writeHTMLReply, writeHTMLReply, writeInternalError, writeReply, writeReply, writeReply, writeReply, writeReply, writeReply, writeTemporaryRedirect, writeTextReply, writeTextReply
protected final NodeClientCore core
public static final java.lang.String selectDir
public static final java.lang.String selectFile
public static final java.lang.String changeDir
public LocalFileBrowserToadlet(NodeClientCore core, HighLevelSimpleClient highLevelSimpleClient)
protected abstract java.lang.String postTo()
protected java.lang.String filenameField()
protected abstract boolean allowedDir(java.io.File path)
path
- The path to check permissions for.protected abstract java.util.Hashtable<java.lang.String,java.lang.String> persistenceFields(java.util.Hashtable<java.lang.String,java.lang.String> set)
set
- page parts/parametersprotected abstract java.lang.String startingDir()
protected java.lang.String defaultUploadDir()
protected java.lang.String defaultDownloadDir()
protected void createSelectDirectoryButton(HTMLNode node, java.lang.String absolutePath, HTMLNode persistence)
node
- Node to add the button to.absolutePath
- Path to set the filenameField() field to.persistence
- Additional persistence fields to include.protected void createSelectFileButton(HTMLNode node, java.lang.String absolutePath, HTMLNode persistence)
node
- Node to add the button to.absolutePath
- Path to set the filenameField() field to.persistence
- Additional persistence fields to include.public void handleMethodGET(java.net.URI uri, HTTPRequest request, ToadletContext ctx) throws ToadletContextClosedException, java.io.IOException, RedirectException
Toadlet
handleMethodGET
in class Toadlet
uri
- is unused,request
- contains parameters.ctx
- allows page rendering and permissions checks.ToadletContextClosedException
- Access is denied: uploading might be disabled overall.
The user might be denied access to this directory,
which could be their home directory.java.io.IOException
- Something file-related went wrong.RedirectException
public void handleMethodPOST(java.net.URI uri, HTTPRequest request, ToadletContext ctx) throws ToadletContextClosedException, java.io.IOException, RedirectException
ToadletContextClosedException
java.io.IOException
RedirectException