-
Notifications
You must be signed in to change notification settings - Fork 14
CommandLine
v7files is a runnable jar file that you execute from the command line (the name of the jar file may be different):
java -jar v7files.jar serve
The most important command is serve
to start the HTTP and WebDAV server, but there are a few more tools to manage files, all listed below.
While technically optional, you will most likely need to create a configuration file and point v7files at it:
java -jar v7files.jar serve -f config.properties
All configuration options can also be set (or overridden) by system properties
java -jar v7files.jar serve -f config.properties -Dhttp.port=5555
When you specify paths into the virtual file system, the commands take two parameters, the name of the file system "root" (because there can be many), and the path within that tree.
Some commands take SHA digests to identify contents directly (instead of a file name). These are given as hex-encoded strings, and they can be shortened to any prefix, as long as it is unique.
-
serve
start the HTTP server -
ls
list files -
cat
output file contents -
mkdir
create a folder -
copy
copy files and folders within the database -
upload
upload local files into the database
This will start a WebDAV server on (by default) port 8080.
There are no further parameters (everything is configured by the properties file).
Keeps running until you press enter.
ls <root> <path>
Lists the contents of the specified folder.
Output the contents of a file, by file name
cat <root> <path>
or by SHA digest
cat -sha <shaHex>
mkdir <root> <path>
Create a folder (directory). The parent directory must already exist.
copy <sourceRoot> <sourcePath> <targetRoot> <targetPath>
Copy a file or folder. The target parent directory must already exist.
copy -sha <shaHex> <targetRoot> <targetPath>
Set the contents of the target file to the data specified by the given SHA digest.
upload <file> [file] [file] [...]
Upload the contents of one or more local files and print their SHA digests.
Only the contents will be uploaded, no files are created in the
virtual file system. You can use the copy
command in combination
with the SHA digests to do that.