Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

CommandLine

Thilo Planz edited this page May 28, 2012 · 1 revision

Running v7files

Command line

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.

Configuration file

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

File system roots and file system paths

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.

SHA prefixes

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.

List of commands

  • 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

serve

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

ls <root> <path>

Lists the contents of the specified folder.

cat

Output the contents of a file, by file name

cat <root> <path>

or by SHA digest

cat -sha <shaHex>

mkdir

mkdir <root> <path>

Create a folder (directory). The parent directory must already exist.

copy

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

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.

Clone this wiki locally