cziegeler 02/02/19 06:28:50
Modified: src/scratchpad/org/apache/avalon/excalibur/source
SourceResolverImpl.java
Log:
This should be now the correct file URI handling...
Revision Changes Path
1.19 +11 -4
jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/source/SourceResolverImpl.java
Index: SourceResolverImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/source/SourceResolverImpl.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- SourceResolverImpl.java 19 Feb 2002 12:05:05 -0000 1.18
+++ SourceResolverImpl.java 19 Feb 2002 14:28:50 -0000 1.19
@@ -53,7 +53,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version $Id: SourceResolverImpl.java,v 1.18 2002/02/19 12:05:05
cziegeler Exp $
+ * @version $Id: SourceResolverImpl.java,v 1.19 2002/02/19 14:28:50
cziegeler Exp $
*/
public class SourceResolverImpl
extends AbstractLogEnabled
@@ -171,9 +171,16 @@
}
else if (location.charAt(0) == '/')
{
- final int protocolEnd = baseURI.indexOf(':');
- systemID = new StringBuffer(baseURI.substring( protocolEnd + 1))
- .append(location).toString();
+ // windows: absolute paths can start with drive letter
+ if (location.length() > 2 && location.charAt(2) == ':')
+ {
+ systemID = new
StringBuffer("file:").append(location).toString();
+ }
+ else {
+ final int protocolEnd = baseURI.indexOf(':');
+ systemID = new StringBuffer(baseURI.substring( protocolEnd +
1))
+ .append(location).toString();
+ }
}
else if (location.indexOf(":") > 1)
{
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>