cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Ratcliffe" <>
Subject RE: Source Resolving Problem
Date Sun, 27 Feb 2005 21:48:59 GMT
Hi Claus

Here's an example of what you would like to do in flowscript:

 * Returns a file representation of the resource identified by the
 * parameter, or <code>null</code> if <code>uri</code> can not be
to a
 * file resource.
 * @param uri the <code>uri</code> of the resource to be returned as a file
function resolveToFile(uri)
    var resolver = null;
    var filesource = null;
    try {
       resolver =
       filesource = resolver.resolveURI(uri);
       var file = new;
       return file;
    } finally {
       if(filesource != null) resolver.release(filesource);

  -----Original Message-----
  From: Claus Straube []
  Sent: Sunday, 27 February 2005 11:05 p.m.
  Subject: Source Resolving Problem


  I try to get a file that I’ve uploaded before (I’ve copied the stream, so
it’s definitely in my upload folder). How can I reach the source now via a
java class? I wanted to get the correct path with that code:

       public String resolvePath(String path) {

          try {

              Source src = this.resolver.resolveURI(path);

              path = SourceUtil.getPath(src.getURI());

          } catch (Exception ex) {



          return path;


  but it doesn’t work. What I would expect is, that this method will return
a path relative to my sitemap if I would give something like “context://” to
it. But it’ll return the same string, that I gave to it.

  Are there API Docs for the package “org.apache.excalibur.source”? I can’t
find anything… Is there a description how to resolve sources on the net? I
found the one in the dev guide, but that is not enough for me to understand.

  Best regards - Claus


  Claus Straube

  Francéstrasse 31

  80997 München

  +49 (089) 14 16 682

View raw message