Database Reference
In-Depth Information
sudo mount -t davfs -ousername = admin
http://localhost:8080/exist/webdav/db/ /mnt/eXist
Figure 13-14. Linux davfs2 FUSE mount to eXist WebDAV
If the folder /mnt/eXist does not exist on your system, you need to
either create it or choose another empty folder to which you have
access to act as the mount point.
You can now access the eXist database from any Linux application just as if it were a
networked filesystem. You can use any Linux application to read and write docu‐
ments in eXist. You can also create/move/delete collections in the same way as you
would any other folder, as they appear to Linux as regular folders on a filesystem.
This is a very simple example, and you should be aware that davfs2
maintains a cache of file changes that is periodically flushed. In
particular, the cache is flushed when the filesystem is unmounted,
so you should aim to unmount the filesystem before shutting down
the eXist server. davfs2 has many configuration options, so it's a
good idea to consult the manpage ( man davfs2.conf ) if you plan
on making serious use of this tool.
Using WebDAV from Java
There are many ways in which you could connect to eXist using WebDAV from Java,
but unless you really want to spend all your time building a WebDAV client it is per‐
haps more pragmatic to use an existing library to assist you. There are several avail‐
able libraries for Java that offer WebDAV client features, but here we'll look briefly at
using the Milton client library to talk to eXist from Java. At the time of writing the
latest version of Milton was version 2.4.2.5, and the version of Java used was 1.6.
There are just three main objects that you need to understand in the Milton client
library to make WebDAV requests to eXist: Host s, Resource s, and Path s.
 
Search WWH ::




Custom Search