[Yanel-commits] rev 36973 -
public/yanel/trunk/src/core/java/org/wyona/yanel/core/source
michi at wyona.com
michi at wyona.com
Wed Jun 4 14:51:14 CEST 2008
Author: michi
Date: 2008-06-04 14:51:13 +0200 (Wed, 04 Jun 2008)
New Revision: 36973
Modified:
public/yanel/trunk/src/core/java/org/wyona/yanel/core/source/SourceResolver.java
Log:
pattern in order to find scheme/protocol fixed
Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/source/SourceResolver.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/source/SourceResolver.java 2008-06-04 11:42:53 UTC (rev 36972)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/source/SourceResolver.java 2008-06-04 12:51:13 UTC (rev 36973)
@@ -37,12 +37,15 @@
log.debug("Base: "+ base);
}
- int colonIndex = uri.indexOf(":/");
+ // NOTE: One cannot use ":/" in order to find the protocol/scheme, because one can also specifiy the realm id and repository id, for example: yanelrepo:REALM_ID:REPO_ID:/foo/bar.gif
+ int colonIndex = uri.indexOf(":");
+ //int colonIndex = uri.indexOf(":/");
String uriScheme = "";
if (colonIndex <= 0) {//Check for scheme in URI, if true, then URI has no scheme
//log.error("DEBUG: URI has no scheme: " + uri);
if (base != null) {
- int colBaseIndex = base.indexOf(":/");
+ int colBaseIndex = base.indexOf(":");
+ //int colBaseIndex = base.indexOf(":/");
if(colBaseIndex <=0 ){//Check for scheme in Base
throw new SourceException("invalid url syntax (missing scheme): " + uri);//no scheme found in uri and base
}else{//base contains scheme. Use base scheme for uri scheme
More information about the Yanel-commits
mailing list