The FileBrowser service is a backend service for webAppOS FileBrowser app.
FileBrowser is a modified version of remoteFileExplorer (available at https://github.com/speich/remoteFileExplorer) tailored for webAppOS API. The FileBrowser app uses Java servlet (instead of original PHP code) to implement RESTful service for accessing the file system. The Java servlet implements the same HTTP API as used by remoteFileExplorer.
[Browser-side JavaScript code of remoteFileExplorer was written using DoJo Toolkit, thus, it utilizes modules 'dojo/store/Memory', 'dojo/store/JsonRest', 'dojo/store/Observable', and 'dojo/store/Cache' to access remote file system. In particular, the JsonRest module is responsible for sending underlying HTTP requests.]
The FileBrowser service is accessible via the following URL:
http[s]://[domain_or_ip]/services/filebrowser/
!! The trailing slash is essential because of Jetty configuration used by webAppOS. (See https://bugs.eclipse.org/bugs/show_bug.cgi?id=331194#c1 for more info.)
All requests except /browse require webAppOS authentication. The auth info must be sent in the "Authorization" HTTP header followed by "webAppOS_token", followed by the string "login:ws_token".
Authorization webAppOS_token user1:123456
A JSON contating information about the requested file or folder.
{
"id": "/home/{path-to-file-or-folder-relative-to-user's-home}",
"dir": true|false,
"parId": "{parent-folder}",
"name": "{name}",
"size": 0|12345,
"cre": {created-timestamp},
"mod": {modified-timestamp},
"mime": "directory/desktop"|some other mime (optional)
}
On error, returns an empty response.
!! The trailing slash is essential.
[masks] | is an optional query contatining comma-separated file masks. If the query is specified, the FileBrowser service will return only files matching the given masks. |
GET http[s]://example.org/services/filebrowser/home/ontologies/?*.owl,*.xml
a JSON array of elements in the same format as in Get info on the given file or folder. On error, returns an empty response.
Request body is a JSON in the form:
{
"dir":true|false,
"parId":"/home/[path-to-parent-folder]",
"size":0,
"name":"new directory"|"new file.txt"
}
A similar JSON with added attributes:
id equal to the path of the newly created file starting from "/home",
cre creation timestamp,
mod the same as cre.
On error, the string "false" is returned.
{
"msg": "item deleted"
}
On error, the string "false" is returned.
Request body is a JSON in the form:
{
"id":"/home/[path-to-file-or-folder-relative-to-user's-home]",
"dir":true|false,
"parId":"/home/[path-to-new-parent-folder]",
"name":"[new-name]",
"size":0|13752,
"cre":1542189355769,
"mod":1542189355769
}
A similar JSON with updated "mod" (modified time) value, or the string "false" on error.
When the URL contains a path that starts with "/browse" instead of "/home", FileBrowser service will return a redirect response with the URL pointing to the FileBrowser app to serve the path that follows the "/browse" prefix.
Redirects to
http{s}://{domain_or_ip}/apps/filebrowser/path=/home/{path-to-file-or-folder-relative-to-user's-home}