cziegeler 02/05/10 07:12:04 Modified: src/java/org/apache/cocoon/webapps/session/connector Resource.java Log: Small fix to Resource resolving Revision Changes Path 1.3 +10 -19 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Resource.java 19 Apr 2002 11:02:58 -0000 1.2 +++ Resource.java 10 May 2002 14:12:04 -0000 1.3 @@ -63,7 +63,7 @@ * parameters. * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Id: Resource.java,v 1.2 2002/04/19 11:02:58 cziegeler Exp $ + * @version CVS $Id: Resource.java,v 1.3 2002/05/10 14:12:04 cziegeler Exp $ */ public final class Resource implements Serializable { @@ -83,11 +83,17 @@ public Resource(SourceResolver resolver, String identifier) throws ProcessingException, SAXException, IOException { - if ( identifier.startsWith("class://") ) { + // check for relative cocoon:/ protocol + if (identifier.startsWith("cocoon:/") + && identifier.charAt("cocoon:/".length()) != '/') { + + // FIXME (CZ) + throw new ProcessingException("Relative cocoon: URIs currently not supported."); + } else if ( identifier.startsWith("class://") ) { this.resourceType = ResourceConnector.RESOURCE_TYPE_CLASS; this.resourceIdentifier = identifier.substring("class://".length()); - } else if ( identifier.indexOf(":/") == -1) { - // relative, resolve it first + } else { + // resolve it first Source source = null; try { source = resolver.resolve(identifier); @@ -101,21 +107,6 @@ } } finally { source.recycle(); - } - } else { - // check for relative cocoon:/ protocol - if (identifier.startsWith("cocoon:/") - && identifier.charAt("cocoon:/".length()) != '/') { - - // FIXME (CZ) - throw new ProcessingException("Relative cocoon: URIs currently not supported."); - } - if ( identifier.startsWith("file:") ) { - this.resourceType = ResourceConnector.RESOURCE_TYPE_FILE; - this.resourceIdentifier = identifier.substring("file:".length()); - } else { - this.resourceType = ResourceConnector.RESOURCE_TYPE_URI; - this.resourceIdentifier = identifier; } } }
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]