You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by al...@apache.org on 2007/06/15 03:17:19 UTC
svn commit: r547475 -
/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java
Author: almaw
Date: Thu Jun 14 18:17:18 2007
New Revision: 547475
URL: http://svn.apache.org/viewvc?view=rev&rev=547475
Log:
Fold checkMount() function into constructor - it doesn't do anything else, after all.
Modified:
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java
Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java?view=diff&rev=547475&r1=547474&r2=547475
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java Thu Jun 14 18:17:18 2007
@@ -58,8 +58,15 @@
*/
public AbstractRequestTargetUrlCodingStrategy(final String mountPath)
{
- checkMountPath(mountPath);
- this.mountPath = (mountPath.startsWith("/")) ? mountPath.substring(1) : mountPath;
+ if (mountPath == null)
+ {
+ throw new IllegalArgumentException("Mount path cannot be null or empty");
+ }
+ this.mountPath = mountPath.startsWith("/") ? mountPath.substring(1) : mountPath;
+ if (this.mountPath.startsWith("resources/") || this.mountPath.equals("resources"))
+ {
+ throw new IllegalArgumentException("Mount path cannot be under '/resources'");
+ }
}
/**
@@ -68,24 +75,6 @@
public final String getMountPath()
{
return mountPath;
- }
-
- /**
- * Checks mount path is valid.
- *
- * @param path
- * mount path
- */
- private void checkMountPath(String path)
- {
- if (path == null)
- {
- throw new IllegalArgumentException("Mount path cannot be null");
- }
- if (path.startsWith("/resources/") || path.equals("/resources"))
- {
- throw new IllegalArgumentException("Mount path cannot start with '/resources'");
- }
}
/**