jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1214273 - in /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk: MicroKernelImpl.java json/JsopTokenizer.java
Date Wed, 14 Dec 2011 14:52:29 GMT
Author: stefan
Date: Wed Dec 14 14:52:29 2011
New Revision: 1214273

URL: http://svn.apache.org/viewvc?rev=1214273&view=rev
Log:
support copy (MicroKernel.commit)

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopTokenizer.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java?rev=1214273&r1=1214272&r2=1214273&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
Wed Dec 14 14:52:29 2011
@@ -443,7 +443,7 @@ public class MicroKernelImpl implements 
                         break;
                     }
                     case '>': {
-                        // TODO: support reorder syntax
+                        // TODO: support target position notation
                         pos = t.getLastPos();
                         String subPath = t.readString();
                         String srcPath = PathUtils.concat(path, subPath);
@@ -462,6 +462,26 @@ public class MicroKernelImpl implements 
                         cb.moveNode(srcPath, targetPath);
                         break;
                     }
+                    case '*': {
+                        // TODO: support target position notation
+                        pos = t.getLastPos();
+                        String subPath = t.readString();
+                        String srcPath = PathUtils.concat(path, subPath);
+                        if (!PathUtils.isAbsolute(srcPath)) {
+                            throw new Exception("absolute path expected: " + srcPath + ",
pos: " + pos);
+                        }
+                        t.read(':');
+                        pos = t.getLastPos();
+                        String targetPath = t.readString();
+                        if (!PathUtils.isAbsolute(targetPath)) {
+                            targetPath = PathUtils.concat(path, targetPath);
+                            if (!PathUtils.isAbsolute(targetPath)) {
+                                throw new Exception("absolute path expected: " + targetPath
+ ", pos: " + pos);
+                            }
+                        }
+                        cb.copyNode(srcPath, targetPath);
+                        break;
+                    }
                     default:
                         throw new AssertionError("token type: " + t.getTokenType());
                 }

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopTokenizer.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopTokenizer.java?rev=1214273&r1=1214272&r2=1214273&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopTokenizer.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopTokenizer.java
Wed Dec 14 14:52:29 2011
@@ -186,6 +186,7 @@ public class JsopTokenizer implements Js
             case ',':
             case '>':
             case '^':
+            case '*':
             case '=':
             case ';':
                 return ch;



Mime
View raw message