checked in: filesystem docs

Steve Loughran <[email protected]>
Newsgroups gmane.comp.java.smartfrog.devel
Message-ID <[email protected]>
I have just documented the filesystem components in 
services.os.filesystem; look in 
core/smartfrog/docs/components/filesystem.sxw

There are things to create temp files, get info about files into 
component attributes, delete files on termination, make directories and 
save text to files:

#include "/org/smartfrog/services/filesystem/components.sf"

sfConfig extends Compound {

     sfSyncTerminate true;

     temp1 extends TempFile {
         prefix "encoded";
         suffix ".txt";
     }

     cleanup extends SelfDeletingFile {
         file LAZY temp1;
     }

     textFile extends TextFile {
         file LAZY temp1;
         text "UTF16";
         encoding "utf16";
     }

     //the filename
     absolutePath LAZY textFile:absolutePath;
     //the uri
     uri LAZY textFile:uri;
}

most importantly, all this stuff is platform-independent. You can put a 
string with forward or backslashes into the file attributes and they get 
converted at deployment to the right thing. We even set absolutePath and 
uri attributes afterwards -one for other components, one for setting up 
classpaths.  I've documented how to use the functionality in your own 
tasks, incidentally.

There is a bit more work on these things before they are final, but that 
will be on-demand, as they say. Whoever wants it gets to write the code, 
the tests, the docs.

Back to the XML component...

-steve


-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.