Tutorial
First, the filesystem is created by specifying an
archive directory containing archives
(zip files, directories, etc):
Then, individual archives can be mounted into the filesystem
in much the same way as disks are mounted in the UNIX filesystem.
All archives are treated in a read-only manner. The
jvvfs package never writes to the
filesystem or any archives.
Values of type PathReal denote
platform-specific paths (and should therefore be given in
platform-specific notation). Use of
File.separatorChar in the Java
standard library is recommended.
Assuming archive.zip exists in the
specified archive directory, the archive can be mounted in the
root directory of the virtual filesystem:
Values of type PathVirtual denote
paths in the virtual filesystem and are given in platform-independent
notation. Virtual path components are separated by
/ and must always begin with
a leading / (the paths must always
be absolute). The filesystem currently has no concept of a "current
working directory", so relative paths have no meaning.
Assuming archive.zip contains the
file /a/b/c/file.txt, the file can
be opened, unsurprisingly, by the path
/a/b/c/file.txt:
It is possible to mount archives at directories other than the
root. It is possible to create directories in the virtual filesystem
with the
createDirectory
function, if no currently mounted archive provides the desired
mount point. Manually created directories are purely virtual constructs;
creating a directory via the
jvvfs
API does not modify the real OS filesystem or any archives.