From: Steve L. <ste...@hp...> - 2005-03-31 15:53:43
|
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 |