Archive for the ‘Projects’ Category

Post Icon

JRemoteFS

By joost on August 20th, 2005

Intro

JRemoteFS is a generic framework to connect to remote filesystems. It was created for SFTP integration into JAlbum. It supports both FTP and SFTP access. JRemoteFS is only the framework. It uses FtpBean for FTP implementation and JSCH for SFTP implementation. The framework contains adapters to convert these components to the framework’s RemoteFS interface. See the design.

Design

Class diagram JRemoteFS

(Click image to enlarge)

The design is fairly simple. The framework defines a interface; RemoteFS. The adapters adapt the FtpBean and JSCH implementations to match this interface. The framework also defines a RemoteFile. This is an abstract object which defines some methods to get information about the file on the remote filesystem. Each adapter will return instances of this RemoteFile. The abstract object contains some methods which might be usefull for other implementations.

The framework also provides a bean; RemoteFSBean. This bean also implements the RemoteFS interface and works as a proxy, hiding which implementation will be used. The bean uses the RemoteFSFactory to get an implementation of RemoteFS. The bean will than use this implementation to forward all requests to. Applications can use this bean to easily integrate JRemoteFS into their application.

If you have any remarks or suggentions for JRemoteFS, please let me an email

RemoteFS defines methods for:

* Set\Get the port on which to connect to remote server
* Set\Get force UTF-8 characterset
* Set\Get passive mode (used for ftp support)
* Set\Get the remote directory
* Change to parent directory

* Create a new directory
* Remove a directory
* Connect to remote server
* Disconnect from remote server
* Check for connection to server
* Get files
* Upload a file
* Remote a file

Via RemoteFile the following info about the remote file can be obtained:

* If the file is a file
* If the file is a directory
* Name
* Creation date
* Modify date
* Size

Current version: 1.0

TODO LIST:
I plan the following improvements to the current version:

* Use a filesystem-type to determine what kind of implementation to use. This makes it possible to add other implementations than FTP to be added. For example SCP , NFS or …?.
* Have the factory use a properties file to determine which class to use for which remote filesystem type

Downloads:

Both binary and source downloads contain JSCH and an adapted version of FtpBean and include the Javadoc.
JRemoteFS is released under LGPL license.

Get binary or sources from sourceforge.

Links

JAlbum - http://www.jalbum.net
JSch – Java Secure Channel - http://www.jcraft.com/jsch/index.html
FtpBean - http://www.geocities.com/SiliconValley/Code/9129/javabean/ftpbean/