This is a web interface to the user's files. Implementation is in Java classes uw.unix.FileBrowser*
. The main class is FileBrowserIndexHandler
.
This application is installed at a specific base URL, which we will call BASE
. A base path in the file system of the webserver is supplied via a Java File
object FILE
. Then the URL BASE/PATH/
will provide access to the file path FILE/PATH
.
If the associated path does not exist, requesting this URL will report this fact and provide a button offering to create it as a directory.
If the associated path exists but is not a file or directory, a message to this effect will be displayed. This should not normally occur in our users' experience, but is possible with FIFOs and other special files.
If the associated path is a file, requesting this URL will present a link allowing the user to download the file contents.
If the associated path is a directory, requesting this URL will present a directory listing. The information in the listing is obtained by invoking GNU ls
and parsing the results.
Whether or not dot files are included, and whether or not certain of the columns are included, is controlled by a configuration parameter supplied in the query parameter "F". For example, specifying "?F=P" at the end of the URL will cause permissions to be displayed.
The parameters are mostly handled by the FileBrowserConfig
class. The available parameters are:
The directory listing has a "Select" column containing checkboxes, and an action selection menu at the bottom. Ticking some of the boxes and selecting an action, such as "Delete", will give a page allowing options to be selected and offering to complete the action.
For the most part these actions are implemented by invoking the appropriate Gnu utility.
In addition to the per-file actions, there is an "Upload File" form and a "Create Directory" form.
The file upload form allows the user to select a file from the machine running their browser and upload it into the directory they are looking at in the file browser. The filename used is the one supplied by the user's browser, which is typically its filename on the user's machine.
The create directory form takes a name and creates a subdirectory by that name.
-- IsaacMorland - 09 Feb 2007