You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by th...@apache.org on 2011/07/12 17:03:29 UTC

svn commit: r1145618 - /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/PathUtils.java

Author: thomasm
Date: Tue Jul 12 15:03:29 2011
New Revision: 1145618

URL: http://svn.apache.org/viewvc?rev=1145618&view=rev
Log:
System property to skip validation.

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/PathUtils.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/PathUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/PathUtils.java?rev=1145618&r1=1145617&r2=1145618&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/PathUtils.java (original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/PathUtils.java Tue Jul 12 15:03:29 2011
@@ -22,11 +22,14 @@ import java.util.ArrayList;
  * Utility methods to parse a JCR path.
  */
 public class PathUtils {
+
     /**
-     * Controls whether paths passed into methods of this class are validated or not.
-     * todo: decide whether and how to make this available through configuration 
+     * Controls whether paths passed into methods of this class are validated or
+     * not. By default, paths are validated for each method call, which
+     * potentially slows down processing. To disable validation, set the system
+     * property org.apache.jackrabbit.mk.util.PathUtils.SKIP_VALIDATION.
      */
-    private static final boolean VALIDATE_PATHS = true;
+    private static final boolean SKIP_VALIDATION = Boolean.getBoolean(PathUtils.class.getName() + ".SKIP_VALIDATION");
 
     private PathUtils() {
         // utility class
@@ -198,7 +201,7 @@ public class PathUtils {
         if (parentPath.equals(path)) {
             return "";
         }
-        
+
         String prefix = denotesRoot(parentPath)
             ? parentPath
             : parentPath + '/';
@@ -315,7 +318,7 @@ public class PathUtils {
     //------------------------------------------< private >---
 
     public static void assertValid(String path) {
-        if (VALIDATE_PATHS) {
+        if (!SKIP_VALIDATION) {
             validate(path);
         }
     }