You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by David Crossley <cr...@indexgeo.com.au> on 2001/08/17 06:48:49 UTC

how to determine runtime location of resources directory

I have one coding issue that is holding up our
Cocoon development work. Help please.

What is the Java code to determine the full pathname
to the runtime location of the resources directory:
 webapps/cocoon/resources/

Surely there would be an easy way to do this, but
even after tearing out my remaining hair, i cannot
figure it out. Please provide a snippet or point to
a code example.

thanks, David

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


AW: how to determine runtime location of resources directory

Posted by Carsten Ziegeler <cz...@sundn.de>.
Each sitemap component (generator, transformer etc) gets within
the setup() method the SourceResolver. This object is used
for resolving resources. One task if the SourceResolver is to
map relative definitions to absolute ones.
So if you call resolve("resources") on the SourceResolver
you get a Source object which points to the resources
directory within your cocoon webapp directory.

You can now either choose the getFile() method of the Source
object to get a File object or the getSystemId() to get
a URL string ("file:/..../cocoon/resources")

Carsten

> -----Ursprüngliche Nachricht-----
> Von: David Crossley [mailto:crossley@indexgeo.com.au]
> Gesendet: Freitag, 17. August 2001 06:49
> An: cocoon-dev@xml.apache.org
> Betreff: how to determine runtime location of resources directory
>
>
> I have one coding issue that is holding up our
> Cocoon development work. Help please.
>
> What is the Java code to determine the full pathname
> to the runtime location of the resources directory:
>  webapps/cocoon/resources/
>
> Surely there would be an easy way to do this, but
> even after tearing out my remaining hair, i cannot
> figure it out. Please provide a snippet or point to
> a code example.
>
> thanks, David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org