cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/webapps/session/connector Resource.java
Date Tue, 21 May 2002 13:19:20 GMT
cziegeler    02/05/21 06:19:20

  Modified:    src/java/org/apache/cocoon/webapps/session/connector
                        Resource.java
  Log:
  Fixing resource detection
  
  Revision  Changes    Path
  1.4       +10 -4     xml-cocoon2/src/java/org/apache/cocoon/webapps/session/connector/Resource.java
  
  Index: Resource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/webapps/session/connector/Resource.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Resource.java	10 May 2002 14:12:04 -0000	1.3
  +++ Resource.java	21 May 2002 13:19:20 -0000	1.4
  @@ -52,9 +52,10 @@
   
   import java.io.IOException;
   import java.io.Serializable;
  +import org.apache.excalibur.source.Source;
  +import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceParameters;
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.environment.SourceResolver;
   import org.xml.sax.SAXException;
   
  @@ -63,7 +64,7 @@
    * parameters.
    *
    * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  - * @version CVS $Id: Resource.java,v 1.3 2002/05/10 14:12:04 cziegeler Exp $
  + * @version CVS $Id: Resource.java,v 1.4 2002/05/21 13:19:20 cziegeler Exp $
   */
   public final class Resource
   implements Serializable {
  @@ -92,11 +93,14 @@
           } else if ( identifier.startsWith("class://") ) {
               this.resourceType = ResourceConnector.RESOURCE_TYPE_CLASS;
               this.resourceIdentifier = identifier.substring("class://".length());
  +        } else if ( identifier.startsWith("cocoon:") ) {
  +            this.resourceType = ResourceConnector.RESOURCE_TYPE_URI;
  +            this.resourceIdentifier = identifier;
           } else {
               // resolve it first
               Source source = null;
               try {
  -                source = resolver.resolve(identifier);
  +                source = resolver.resolveURI(identifier);
                   identifier = source.getSystemId();
                   if ( identifier.startsWith("file:") ) {
                       this.resourceType = ResourceConnector.RESOURCE_TYPE_FILE;
  @@ -105,8 +109,10 @@
                       this.resourceType = ResourceConnector.RESOURCE_TYPE_URI;
                       this.resourceIdentifier = identifier;
                   }
  +            } catch (SourceException se) {
  +                throw new ProcessingException("Unable to resolve " + identifier, se);
               } finally {
  -                source.recycle();
  +                resolver.release( source );
               }
           }
       }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message