cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Howard" <coc...@leverageweb.com>
Subject source resolving help
Date Sun, 18 May 2003 20:52:09 GMT
Source resolving in cocoon is pretty opaque to me - complicated 
by the fact that the API docs aren't included at excalibur's site.  
I've tried tracking this down through the source, but I'm never 
confident that I've found the current best practice and not a 
deprecated area.  If there's a great example of how to do this, 
or message from the archives feel free to point me there instead 
but I haven't found anything clear for a source meant to be a 
_destination_ as outlined below.

Here's my situation: in a sitemap component (a file upload handler  
which will move a PartOnDisk, or write out the stream of a 
FileInMemory), I want to: 
1) resolve a directory path relative to the current sitemap, 
2) create a file in that directory, 
3) write to the file one time, and close/release it as necessary.

so, I could do (?) 
FileSource fs = (FileSource)resolver.resolveURI("directory/filename.ext");

Then I guess I could do 
orignalFile.renameTo(fs.getSystemId()) or
fs.getOutputStream() ??

- Have I understood all this correctly?  
- What are the hidden gotchas?  
- Do I need file:/directory/filename.ext ??
- Can I use relative or absolute paths? (eg ../../directory or /var ) with 
this scheme?

TIA,
Geoff

Mime
View raw message