Kalpana Kalpana (Editor)

FSPath

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Developer(s)
  
Keith Bishop

License
  
GPL

Type
  
API

Stable release
  
1.0-alpha / April 29, 2008 (2008-04-29)

Written in
  
Java (programming language)

FSPath is a lightweight API written in Java. The goal of FSPath is to make interacting with the file system simpler. It was first released in April 2008 by Keith Bishop.

Contents

FSPath is licensed under the GNU General Public License and is free and open source software.

Features

The notable features of the FSPath API are

  1. A query language for defining file system queries (Based on XPath).
  2. A fluent interface to enable the chaining of different file system operations such as copying, renaming and deleting.
  3. A plug-in mechanism for developers to implement custom file system operations by use of callbacks.

Usage

When used in conjunction, these two features provide the software developer with a great deal of power and flexibility in return for very few keystrokes.

The example below shows a typical recursive search algorithm implemented in Java, for searching for a file by name.

The code above can be substituted with the following FSPath API calls...

FSPath's fluent interface enables simple manipulation of files by 'chaining' the desired file system operation onto the search query...

To perform custom behaviour on a file or set of files, the developer can implement the net.sf.sugar.fspath.Callback interface. The example below shows an anonymous inner class being used as a callback.

References

FSPath Wikipedia


Similar Topics