FUSE-J

General Information

FUSE-J Java bindings for FUSE (Filesystem in USErspace) is a Java API that uses JNI bindings to FUSE library and enables writing Linux filesystems in Java language.

FUSE (Filesystem in USErspace) is a simple interface for userspace programs to export a virtual filesystem to the linux kernel.

FUSE is writen by Miklos Szeredi (mszeredi@inf.bme.hu) and can be downloaded from

http://fuse.sourceforge.net/

News

2005-05-18: new relase: FUSE-J 2.2.3

JNI part of FUSE-J (libjavafs.so) now compiles on amd64 Linux machines (if it runs remains to be seen). The changes that were done are:

http://www.select-tech.si/fuse/fuse-j-2.2.3.tar.gz

2005-04-20: new relase: FUSE-J 2.2.2

Changes:

http://www.select-tech.si/fuse/fuse-j-2.2.2.tar.gz

2005-04-18 afternoon: new release: FUSE-J 2.2.1

Changes:

http://www.select-tech.si/fuse/fuse-j-2.2.1.tar.gz

Plans for future include:

2005-04-18: After a year and a half of silence and a few Emails I got from various people asking about the FUSE-J binding I decided to update the software to current FUSE version (2.2.1).

I used the patch from Tim Moreton <tim.moreton@cl.cam.ac.uk> (thanks) and made some other minor modifications to compile and work with Java 5. You can download this version from:

http://www.select-tech.si/fuse/fuse-j-2.2.tar.gz

Installation

First you must get and install the FUSE kernel module and library (se above). By default FUSE library is installed into /usr/local/lib and header files in /usr/local/include directories. If you install FUSE to some other directory, you should edit build.conf and set FUSE_HOME variable to the base directory of your FUSE library/headers instalation.

You will need JDK 1.4 or above (I'm using JDK 1.5.0_02 from http://java.sun.com). FUSE-J will not work or compile with JDK 1.3 or earlier since it uses JNI_VERSION_1_4 features (such as direct java.nio.ByteBuffer). Edit build.conf and set JDK_HOME variable to point to the JDK installation.

run 'make'

This will first compile Java sources from src directory into class files in build directory. It will then run the JNI bindings generation process which will produce two files: jni/javafs_bindings.h & jni/javafs_bindings.c. After that the jni/libjavafs.so shared library for inclusion in the JVM will be built.

How To Use

FUSE-J is made up of two main parts:

You can try and test the example ZIP filesystem with the following command:

cd fuse-j-build-dir

./zipfs_mount.sh some.zip /mnt/point

And then use fusermount to unmount it:

fusremount -u /mnt/point

Here's how to create your very own virtual filesystem in three easy steps:

  1. Implement the fuse.Filesystem interface (see example fuse.zipfs.ZipFilesystem)

  2. call fuse.FuseMount.mount(String[] args, fuse.Filesystem filesystem)

...where args is an array of arguments passed to FUSE library's fuse_main function and must contain:

mountpoint as 1st argument

optional options as 2nd and subsequent arguments (see FUSE docs for more info)

...and filesystem is an instance of a class implementing fuse.Filesystem interface

  1. ls -al /mount/point

Author

FUSE-J is writen by Peter Levart (peter@select-tech.si)

FUSE is writen by Miklos Szeredi (mszeredi@inf.bme.hu)