cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <kpiroum...@apache.org>
Subject Re: How do I read files inside an Action?
Date Thu, 19 Dec 2002 10:27:56 GMT
You can do it like this:

Source source = null;
        SourceResolver resolver = null;
        try {
            resolver = (SourceResolver) manager.lookup(
SourceResolver.ROLE );
            source = resolver.resolveURI( fileName );
            return builder.parse( new InputSource(
source.getInputStream() ));
        }
        catch (Exception x) {
            logger.warn("XMLREsourceBundle: No excalibur-source " +
fileName,
x);
        }
        finally {
            resolver.release( source );
            manager.release( resolver );
        }

Take a look at the ResourceExistsAction or latest (from CVS)
XMLResourceBundle for details.

Konstantin


From: "Chintalapaty, Sreedhar " <schintalapaty@ptc.com>


Hi,

Can some one point me to an example of how we can access an xml file on the
file system from a custom Action?

TIA,

Sreedhar

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message