I've done exactly this in Seedling (a HiveMind-ish application platform).

My first attemp using java.io was exceptionally painful.  It's currently
implemented in  via an abstraction layer called ConfigTree, from which
you can get URLs, from which you can open a stream.  Implementations of
the ConfigTree hide the storage format, so there's FileConfigTree to read
from a directory, and ZipFileConfigTree to read from a ZIP archive.  Of
course theres a ConfigTreeFactory that takes a path (to, eg, a directory
of a ZIP file) and returns the appropriate ConfigTree.

The implementation of this design is generaly simple though there's a few
subtleties.  For hints you might want to check the current CVS sources,
starting with:

http://cvs.sourceforge.net/viewcvs.py/seedling/seedling/src/runtime/main/toddstuff/seedling/ZipFileConfigTree.java?view=markup

[One cool byproduct of this architecture is the ability to access config
trees on a remote server via HTTP or DAV or FTP or whatever.  This is
particularly useful for desktop deployments, as you might imagine.]

Good luck,
.T.


On Fri, 14 Nov 2003 11:28:21 -0500, "Gary Gregory"
<[EMAIL PROTECTED]> said:
> You're probably right, I was thinking in a would-it-not-be-nice mode. 
> 
> To be more realistic, I should mention the usage scenario I have in mind:
> Our server is configured with a "config" directory which contain a bunch
> of
> files and sub-directories. It would be nice if I could read our server's
> config from a config.zip/tar file instead of a dir. This makes it easier
> to
> email configs around. If I can pass a VSF File subclass into our config
> code, I should not need to fiddle our code, especially since our config
> is
> read-only.
> 
> Gary

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to