ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Murdoch" <>
Subject Ant2 VFS Proposal
Date Thu, 17 Jan 2002 11:07:28 GMT


I've done up a proposal for an Ant 2 VFS layer.  It's a first cut, so
there's plenty of stuff missing from the API, and the implementation is,
well, "experimental" at best.

The API currently allows the following:

* Locating a file by absolute URI, a local file name, or relative to another

* Traversing the structure of a file system.  For example, listing the
children of a file.

* Creation and deletion of files.  Includes recursive deletion, and implicit
creation of parent.

* Reading and writing the content of files.

* Some name parsing.

* Getting and setting of some file attributes, such as last-modified time.

In short, everything that gives you (along with FileReader,
FileInputStream, etc).

The implementation currently supports:

* Local file systems.

* Zip/Jar file systems.  Read-only, and only for local files.

* FTP file systems.  Uses NetComponents.

* CIFS (Samba, Windows shares, etc).  Uses jCFIS (from Samba).

* Caching of structural info.  No caching of content or content meta-info.

* Plenty of validation.  For example, you can't create file if its parent
aleady exists and is not a directory, you can't list the children of a
regular file, etc.

* Some concurrency detection.  Can't read and write a file at the same time,
for example.

The goal for this first cut was to do up a proof-of-concept.  I'd love to
get some feedback from ant-dev.  The javadoc for the API interfaces is
attached (I've left out the provider API, cause it's just noise at this
stage).  Please have a read - comments most welcome.  Just keep in mind it
ain't finished yet.  If it looks ok, I'll tidy-up the code (license, package
names, etc) and send it in.

The next step would be to try it out.  I'd like to do this in Myrmidon, if
possible.  The plan would be something like:

* Do up a FileSystemManager impl that wires into myrmidon.

* Expose the FileSystemManager to the tasks via TaskContext as (ultimately)
a replacement for getBaseDirectory() and resolveFile().  Could be done via
ComponentManager + AbstractTask too, I suppose.

* Add a String -> FileObject converter.

* Port FileSet and Path to use FileObject and friends, rather than  Would involve pushing some of this stuff behind the API.

* Port <move>, <copy>, <mkdir>, <touch> and <delete>.  Again,
some of this
stuff would end up behind the API.

* Look at getting rid of <ftp>, <unzip>, <unjar>, <unwar>.  Longer
maybe things like <zip>, <get>, <tar>, etc.

* Port some of the tasks that need local files, such as <javac>, <java>,
<exec>, etc.

* Look at things like configuring file systems in the build file, getting
user name and password from the user, etc.

As far as the VFS layer itself goes, there's a few things that would be good
to do soon-ish:

* Implement a bunch of new providers: HTTP, WebDAV, CVS, writable
Zip/Jar/Tar, etc.

* Get the FS providers involved in searching, deleting, moving, and copying.
Do as much as possible of this remotely.

* Convertion to/from local files, and

* More naming stuff, dealing with things like case sensitivity, and (maybe)
canonical names, and links/aliases.

* Layered FS, compound FS, filtering, a concurrency model, etc.


View raw message