forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r487737 - /forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/locationMap/LocationMap.java
Date Sat, 16 Dec 2006 00:39:12 GMT
Author: rgardler
Date: Fri Dec 15 16:39:12 2006
New Revision: 487737

URL: http://svn.apache.org/viewvc?view=rev&rev=487737
Log:
Match against path only i.e. don't include a protocol

Modified:
    forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/locationMap/LocationMap.java

Modified: forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/locationMap/LocationMap.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/locationMap/LocationMap.java?view=diff&rev=487737&r1=487736&r2=487737
==============================================================================
--- forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/locationMap/LocationMap.java
(original)
+++ forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/locationMap/LocationMap.java
Fri Dec 15 16:39:12 2006
@@ -120,7 +120,7 @@
 				if (this.isMatch(pattern, requestURI)) {
 					List<LocationNode> locs = this.locations.get(pattern);
 					results.add(locs);
-					log.info(locs.size() + " potenatial location from pattern "
+					log.info(locs.size() + " potential location from pattern "
 							+ pattern);
 				}
 			} catch (final RESyntaxException e) {
@@ -146,17 +146,8 @@
 	 */
 	public boolean isMatch(final String pattern, final URI requestURI)
 			throws MalformedURLException, RESyntaxException {
-		URL url;
-		try {
-			url = requestURI.toURL();
-		} catch (final IllegalArgumentException e) {
-			// we'll assume that this is not an absolute URL and therefore
-			// refers to a file
-			url = new URL("file://" + requestURI);
-		}
-		final String urlString = url.toExternalForm();
-
+		log.debug("Testing for a match against location pattern " + pattern);
 		final RE r = new RE(pattern);
-		return r.match(urlString);
+		return r.match(requestURI.getPath());
 	}
 }



Mime
View raw message