You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by tr...@apache.org on 2013/08/10 07:53:54 UTC

svn commit: r1512568 [31/39] - in /jackrabbit/commons/filevault/trunk: ./ parent/ vault-cli/ vault-cli/src/ vault-cli/src/main/ vault-cli/src/main/appassembler/ vault-cli/src/main/assembly/ vault-cli/src/main/java/ vault-cli/src/main/java/org/ vault-cl...

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/MD5Test.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/MD5Test.java?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/MD5Test.java (added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/MD5Test.java Sat Aug 10 05:53:42 2013
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jackrabbit.vault.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+/**
+ * <code>MD5Test</code>...
+ */
+public class MD5Test extends TestCase {
+
+    private static String testData = "Hello, World";
+    private static String testString = "82bb413746aee42f89dea2b59614f9ef";
+    private static long testMSB = 0x82bb413746aee42fL;
+    private static long testLSB = 0x89dea2b59614f9efL;
+    private static byte[] testBytes = new byte[]{
+            (byte) 0x82, (byte) 0xbb, (byte) 0x41, (byte) 0x37,
+            (byte) 0x46, (byte) 0xae, (byte) 0xe4, (byte) 0x2f,
+            (byte) 0x89, (byte) 0xde, (byte) 0xa2, (byte) 0xb5,
+            (byte) 0x96, (byte) 0x14, (byte) 0xf9, (byte) 0xef
+    };
+
+    public void testCreateLong() {
+        MD5 md5 = new MD5(testMSB, testLSB);
+        assertEquals(testString, md5.toString());
+        assertEquals(testBytes, md5.getBytes());
+    }
+
+    public void testCreateBytes() {
+        MD5 md5 = new MD5(testBytes);
+        assertEquals(testString, md5.toString());
+        assertEquals(testMSB, md5.getMsb());
+        assertEquals(testLSB, md5.getLsb());
+    }
+
+    public void testCreateString() {
+        MD5 md5 = new MD5(testString);
+        assertEquals(testMSB, md5.getMsb());
+        assertEquals(testLSB, md5.getLsb());
+    }
+
+    public void testSmall() {
+        MD5 md5 = new MD5(0, 0);
+        assertEquals("00000000000000000000000000000000", md5.toString());
+    }
+
+
+    public void testDigest() throws IOException {
+        InputStream in = new ByteArrayInputStream(testData.getBytes());
+        MD5 md5 = MD5.digest(in);
+        assertEquals(testString, md5.toString());
+    }
+
+    private void assertEquals(byte[] expected, byte[] result) {
+        for (int i=0; i< expected.length; i++) {
+            if (expected[i] != result[i]) {
+                fail("expected: " + expected[i] + " but was:" + result[i]);
+            }
+        }
+    }
+}
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PathComparatorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PathComparatorTest.java?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PathComparatorTest.java (added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PathComparatorTest.java Sat Aug 10 05:53:42 2013
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jackrabbit.vault.util;
+
+import junit.framework.TestCase;
+
+/**
+ * <code>PathComparatorTest</code>...
+ *
+ */
+public class PathComparatorTest extends TestCase {
+
+    public void test() {
+        doTest("/a", "/a", 0);
+        doTest("/a", "/b", -1);
+        doTest("/a1foo", "/a/foo", -1);
+        doTest("/a/b/c1foo", "/a/b/c/foo", -1);
+    }
+    
+    private void doTest(String left, String right, int result) {
+        PathComparator c = new PathComparator();
+        int test = c.compare(left, right);
+        assertEquals(left + " <> " + right, result, test);
+    }
+}
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PathUtilTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PathUtilTest.java?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PathUtilTest.java (added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PathUtilTest.java Sat Aug 10 05:53:42 2013
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jackrabbit.vault.util;
+
+import junit.framework.TestCase;
+
+/**
+ * <code>PathUtilTest</code>...
+ */
+public class PathUtilTest extends TestCase {
+
+    public void testRelPathEquals() {
+        assertEquals(".", PathUtil.getRelativeFilePath(
+                "/libs/components",
+                "/libs/components", "/")); }
+
+    public void testRelPathSub() {
+        assertEquals("text", PathUtil.getRelativeFilePath(
+                "/libs/components",
+                "/libs/components/text", "/")); }
+
+    public void testRelPathParent() {
+        assertEquals("../..", PathUtil.getRelativeFilePath(
+                "/libs/components/text",
+                "/libs", "/")); }
+
+    public void testRelPathSibling() {
+        assertEquals("../image", PathUtil.getRelativeFilePath(
+                "/libs/components/text",
+                "/libs/components/image", "/")); }
+
+    public void testWindowRelPath() {
+        assertEquals("foo\\bar", PathUtil.getRelativeFilePath(
+                "c:\\test\\root",
+                "c:\\test\\root\\foo\\bar", "\\")); }
+}
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java (added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java Sat Aug 10 05:53:42 2013
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jackrabbit.vault.util;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+/**
+ * <code>PlatformNameTest</code>...
+ *
+ */
+public class PlatformNameTest extends TestCase {
+
+    private Map<String, String> names = new HashMap<String, String>();
+
+
+    protected void setUp() throws Exception {
+        names.put("test.jpg", "test.jpg");
+        names.put("cq:content", "_cq_content");
+        names.put("cq:test_image.jpg", "_cq_test_image.jpg");
+        names.put("test_image.jpg", "test_image.jpg");
+        names.put("_testimage.jpg", "_testimage.jpg");
+        names.put("_test_image.jpg", "__test_image.jpg");
+        names.put("cq:test:image.jpg", "_cq_test%3aimage.jpg");
+        names.put("_cq_:test.jpg", "__cq_%3atest.jpg");
+        names.put("_cq:test.jpg", "_cq%3atest.jpg");
+        names.put("cq_:test.jpg", "cq_%3atest.jpg");
+        names.put("_", "_");
+        names.put(":", "%3a");
+        names.put(":test", "%3atest");
+    }
+
+    public void testToPlatform() {
+        for (String repName: names.keySet()) {
+            String pfName = names.get(repName);
+            assertEquals("Repo("+repName+")->Platform", pfName, PlatformNameFormat.getPlatformName(repName));
+        }
+    }
+
+    public void testToRepo() {
+        for (String repName: names.keySet()) {
+            String pfName = names.get(repName);
+            assertEquals("Platform("+pfName+")->Repo", repName, PlatformNameFormat.getRepositoryName(pfName));
+        }
+    }
+
+}
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/SHA1Test.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/SHA1Test.java?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/SHA1Test.java (added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/SHA1Test.java Sat Aug 10 05:53:42 2013
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jackrabbit.vault.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+/**
+ * <code>MD5Test</code>...
+ */
+public class SHA1Test extends TestCase {
+
+    private static String testData = "Hello, World\n";
+    private static String testString = "4ab299c8ad6ed14f31923dd94f8b5f5cb89dfb54";
+    private static int[] testInts = new int[]{0x4ab299c8, 0xad6ed14f, 0x31923dd9, 0x4f8b5f5c, 0xb89dfb54};
+    private static byte[] testBytes = new byte[]{
+            (byte) 0x4a, (byte) 0xb2, (byte) 0x99, (byte) 0xc8,
+            (byte) 0xad, (byte) 0x6e, (byte) 0xd1, (byte) 0x4f,
+            (byte) 0x31, (byte) 0x92, (byte) 0x3d, (byte) 0xd9,
+            (byte) 0x4f, (byte) 0x8b, (byte) 0x5f, (byte) 0x5c,
+            (byte) 0xb8, (byte) 0x9d, (byte) 0xfb, (byte) 0x54
+    };
+
+    public void testCreateInt() {
+        SHA1 sha = new SHA1(testInts[0], testInts[1], testInts[2], testInts[3], testInts[4]);
+        assertEquals(testString, sha.toString());
+        assertEquals(testBytes, sha.getBytes());
+    }
+
+    public void testCreateBytes() {
+        SHA1 sha = new SHA1(testBytes);
+        for (int i=0; i<testInts.length; i++) {
+            assertEquals("w" + i, testInts[i], sha.getInts()[i]);
+        }
+        assertEquals(testString, sha.toString());
+    }
+
+    public void testCreateString() {
+        SHA1 sha = new SHA1(testString);
+        for (int i=0; i<testInts.length; i++) {
+            assertEquals("w" + i, testInts[i], sha.getInts()[i]);
+        }
+    }
+
+    public void testSmall() {
+        SHA1 sha = new SHA1(0, 0, 0, 0, 0);
+        assertEquals("0000000000000000000000000000000000000000", sha.toString());
+    }
+
+
+    public void testDigest() throws IOException {
+        InputStream in = new ByteArrayInputStream(testData.getBytes());
+        SHA1 sha1 = SHA1.digest(in);
+        assertEquals(testString, sha1.toString());
+    }
+
+    private void assertEquals(byte[] expected, byte[] result) {
+        for (int i=0; i< expected.length; i++) {
+            if (expected[i] != result[i]) {
+                fail("expected: " + expected[i] + " but was:" + result[i]);
+            }
+        }
+    }
+}
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/TreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/TreeTest.java?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/TreeTest.java (added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/util/TreeTest.java Sat Aug 10 05:53:42 2013
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jackrabbit.vault.util;
+
+import junit.framework.TestCase;
+
+/**
+ * <code>PathUtilTest</code>...
+ */
+public class TreeTest extends TestCase {
+
+    private Tree<String> tree;
+
+    private String[] paths = {
+            "/test/a",
+            "/test/b",
+            "/test/c",
+            "/test/d/dd",
+    };
+    @Override
+    protected void setUp() throws Exception {
+        tree = new Tree<String>();
+        for (String path: paths) {
+            tree.put(path, path);
+        }
+    }
+
+    public void testCommonRootPath() {
+        assertEquals("Root Path", "/test", tree.getRootPath());
+    }
+
+    public void testIteration() {
+        int i = 0;
+        for (String path: tree.map().keySet()) {
+            assertEquals("Entry", paths[i++], path);    
+        }
+        assertEquals("Too many entries", paths.length, i);
+    }
+
+    public void testGetNop() {
+        assertNull("/test/e should not exist", tree.getNode("/test/e"));
+        testTreeOk();
+    }
+
+    public void testTreeOk() {
+        assertEquals("Tree Size", paths.length, tree.map().keySet().size());
+        int i=0;
+        for (String path: tree.map().keySet()) {
+            assertEquals("Entry", paths[i++], path);
+        }
+    }
+
+    public void testSimple() {
+        Tree<String> t = new Tree<String>();
+        t.put("/content/en/foo", "foo");
+        assertEquals("/content/en/foo", t.getRootPath());
+    }
+
+}
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/auth.xml
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/auth.xml?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/auth.xml (added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/auth.xml Sat Aug 10 05:53:42 2013
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+
+<!--
+  the auth.xml holds credential information
+  @attr version the version number of structure of this file
+-->
+<auth version="1.0">
+  <!--
+    for each repository you connect to, the initial credentials are stored
+    in a 'repository' element.
+
+    @attr uri the connect uri to the repository
+  -->
+  <repository uri="rmi://localhost:5000/crx/crx.default">
+    <!--
+      the credentials element holds the actual credentials
+      @attr type the type of the credentials. currently only 'simple' is
+                 supported (which is the default)
+    -->
+    <credentials type="simple">
+      <!--
+        defines the user for this credentials.
+        @attr name the user name
+        @attr password the password (will by encrypted)
+      -->
+      <user name="admin" password="admin" />
+    </credentials>
+    
+  </repository>
+</auth>
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/entries.xml
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/entries.xml?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/entries.xml (added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/entries.xml Sat Aug 10 05:53:42 2013
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+
+<!--
+  the entries element holds information about the mountpoint and the relative
+  path of this vault controlled directory.
+
+  @attr uri  the mountpoint of the jcrfs
+  @attr path the path within the jcrfs
+-->
+<entries uri="rmi://127.0.0.1:1234/crx/crx.default" path="/apps/test">
+  <!--
+    An entry element represents a vault controlled file (or directory) which
+    normally is also present as working copy.
+
+    @attr name  the name of the entry
+  -->
+  <entry name="myfile.txt">
+    <!--
+      The base element contains information about the original file retrieved
+      from the server. the base file.
+
+      @attr md5  the md5 checksum. the checksum is calculated when the file is
+                 retrieved from the server and always corresponds to the
+                 checksum of the physical file.
+      @attr size the file size. this size always corresponds to the one of the
+                 physical file.
+      @attr date the last modification date of the file. if the remote file did
+                 not provide a last modification date, it's initialized to the
+                 current time. please note that the last modification time of
+                 the physical base file is set to this value as well.
+      @attr contentType
+                 the content type of the file.
+    -->
+    <base md5="1234.." size="443" date="0" contentType="text/plain" />
+    <!--
+      The work element contains information about the working file.
+      The md5,size and date attributes are calculated whenever a status update
+      is performed. it may be that they can differ from the values of the
+      physical file.
+
+      @attr md5  the md5 checksum. may not correspond to the checksum of the
+                 physical file.
+      @attr size the file size. may not correspond to the size of the physical
+                 file.
+      @attr date the last modification date of the file. may not correspond to
+                 the last modification date of the physical file.
+      @attr contentType
+                 the content type of the file.
+    -->
+    <work md5="1234.." size="443" date="0" contentType="text/plain" />
+  </entry>
+
+  <!--
+    If the entry represents a directory which has just empty base and work
+    elements.
+  -->
+  <entry name="subdir">
+    <base/>
+    <work/>
+  </entry>
+  
+  <!--
+    Modifed file example.
+    After a status update the values of the work element are recalculated.
+    note that the actual status (like modified, missing, etc.) is not included
+    in the entries file.
+  -->
+  <entry name="myfile.txt">
+    <base md5="1234..0" size="443" date="0" />
+    <work md5="1234..1" size="543" date="1" />
+  </entry>
+
+  <!--
+    Added file example.
+    It only contains the information about the working file.
+  -->
+  <entry name="myfile.txt">
+    <work md5="1234..1" size="543" date="1" />
+  </entry>
+
+  <!--
+    Deleted file example.
+    It only contains the information about the base file
+  -->
+  <entry name="myfile.txt" state="deleted">
+    <base md5="1234..0" size="443" date="0" />
+  </entry>
+
+  <!--
+    Conflicted file example.
+    In case of a conflict (your modifications are not mergeable with the updated
+    file from the server) there are 3 additional files put to the working
+    directory: a copy of the base file (.base), a copy of your working file
+    (.mine) and a copy of the new remote file (.theirs). The working file then
+    contains then blocks of conflicting regions.
+  -->
+  <entry name="myfile.txt">
+    <!--
+      this represents still the original base file as present before the
+      conflicting update.
+
+      @attr name the file name of the copy in the working directory
+    -->
+    <base name="myfile.txt.base" md5="1234..0" size="443" date="0" />
+
+    <!--
+      this represents the working file but with conflict blocks.
+    -->
+    <work md5="44333" size="843" date="3" />
+
+    <!--
+      this represents the original working file as present before the
+      update.
+    -->
+    <mine name="myfile.txt.mine" md5="1234..1" size="543" date="1" />
+
+    <!--
+      this represents the updated file from the server
+    -->
+    <theirs name="myfile.txt.theirs" md5="1234..2" size="554" date="2" />
+  </entry>
+
+</entries>
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/repository.xml
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/repository.xml?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/repository.xml (added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/repository.xml Sat Aug 10 05:53:42 2013
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<!DOCTYPE Repository
+          PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
+          "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
+
+<!-- Example Repository Configuration File
+     Used by
+     - org.apache.jackrabbit.core.config.RepositoryConfigTest.java
+     -
+-->
+<Repository>
+    <!--
+        virtual file system where the repository stores global state
+        (e.g. registered namespaces, custom node types, etc.)
+    -->
+    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+        <param name="path" value="${rep.home}/repository"/>
+    </FileSystem>
+
+    <!--
+        data store configuration
+    -->
+    <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>
+
+    <!--
+        security configuration
+    -->
+    <Security appName="Jackrabbit">
+
+        <SecurityManager class="org.apache.jackrabbit.core.UserPerWorkspaceSecurityManager">
+            <!--
+            optional user manager configuration
+            -->
+            <UserManager class="org.apache.jackrabbit.core.security.user.UserPerWorkspaceUserManager">
+                <param name="usersPath" value="/home/users"/>
+                <param name="groupsPath" value="/home/groups"/>
+            </UserManager>
+
+            <!--
+            optional workspace access manager configuration
+           -->
+        </SecurityManager>
+
+        <!--
+            access manager:
+            class: FQN of class implementing the AccessManager interface
+        -->
+        <AccessManager class="org.apache.jackrabbit.core.security.DefaultAccessManager">
+            <!-- <param name="config" value="${rep.home}/access.xml"/> -->
+        </AccessManager>
+
+        <LoginModule class="org.apache.jackrabbit.core.security.authentication.DefaultLoginModule">
+           <!-- 
+              anonymous user name ('anonymous' is the default value)
+            -->
+           <param name="anonymousId" value="anonymous"/>
+           <!--
+              administrator user id (default value if param is missing is 'admin')
+            -->
+           <param name="adminId" value="admin"/>
+        </LoginModule>
+    </Security>
+
+    <!--
+        location of workspaces root directory and name of default workspace
+    -->
+    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
+    <!--
+        workspace configuration template:
+        used to create the initial workspace if there's no workspace yet
+    -->
+    <Workspace name="${wsp.name}">
+        <!--
+            virtual file system of the workspace:
+            class: FQN of class implementing the FileSystem interface
+        -->
+        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+            <param name="path" value="${wsp.home}"/>
+        </FileSystem>
+        <!--
+            persistence manager of the workspace:
+            class: FQN of class implementing the PersistenceManager interface
+        -->
+        <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
+          <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
+          <param name="schemaObjectPrefix" value="${wsp.name}_"/>
+        </PersistenceManager>
+        <!--
+            Search index and the file system it uses.
+            class: FQN of class implementing the QueryHandler interface
+        -->
+        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+            <param name="path" value="${wsp.home}/index"/>
+            <param name="supportHighlighting" value="true"/>
+        </SearchIndex>
+
+        <!--
+            Workspace security configuration
+        -->
+        <WorkspaceSecurity>
+            <AccessControlProvider class="org.apache.jackrabbit.core.security.authorization.acl.ACLProvider">
+                <!-- param name="omit-default-permission" value="true"/-->
+            </AccessControlProvider>
+        </WorkspaceSecurity>
+
+        <!--
+            XML Import configuration of the workspace
+        -->
+        <Import>
+            <ProtectedItemImporter class="org.apache.jackrabbit.core.xml.AccessControlImporter"/>
+            <ProtectedItemImporter class="org.apache.jackrabbit.core.security.user.UserImporter">
+                <param name="importBehavior" value="besteffort"/>
+            </ProtectedItemImporter>
+        </Import>
+    </Workspace>
+
+    <!--
+        Configures the versioning
+    -->
+    <Versioning rootPath="${rep.home}/version">
+        <!--
+            Configures the filesystem to use for versioning for the respective
+            persistence manager
+        -->
+        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+            <param name="path" value="${rep.home}/version" />
+        </FileSystem>
+
+        <!--
+            Configures the persistence manager to be used for persisting version state.
+            Please note that the current versioning implementation is based on
+            a 'normal' persistence manager, but this could change in future
+            implementations.
+        -->
+        <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
+          <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
+          <param name="schemaObjectPrefix" value="version_"/>
+        </PersistenceManager>
+    </Versioning>
+
+    <!--
+        Search index for content that is shared repository wide
+        (/jcr:system tree, contains mainly versions)
+    -->
+    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+        <param name="path" value="${rep.home}/repository/index"/>
+        <param name="supportHighlighting" value="true"/>
+    </SearchIndex>
+
+    <!--
+        Run with a cluster journal
+    -->
+    <Cluster id="node1">
+        <Journal class="org.apache.jackrabbit.core.journal.MemoryJournal"/>
+    </Cluster>
+</Repository>

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/deepmixintest.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/deepmixintest.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/deepmixintest.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/double_properties.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/double_properties.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/double_properties.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_testnode.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_testnode.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_testnode.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_tmp.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_tmp.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_tmp.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_tmp_foo.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_tmp_foo.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_tmp_foo.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_tmp_foo_bar.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_tmp_foo_bar.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/empty_tmp_foo_bar.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/external_hook.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/external_hook.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/external_hook.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/filtered_package.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/filtered_package.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/filtered_package.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/fullcoverage.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/fullcoverage.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/fullcoverage.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/group_with_a.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/group_with_a.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/group_with_a.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/group_with_bc.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/group_with_bc.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/group_with_bc.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/invalid_hook.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/invalid_hook.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/invalid_hook.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_a.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_a.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_a.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_b.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_b.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_b.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_b_merge.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_b_merge.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_b_merge.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_b_preserve.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_b_preserve.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/mode_ac_test_b_preserve.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/package_1.0.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/package_1.0.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/package_1.0.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/package_2.0.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/package_2.0.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/package_2.0.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/privileges.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/privileges.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/privileges.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/subtest.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/subtest.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/subtest.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tags.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tags.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tags.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/test_hook.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/test_hook.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/test_hook.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/testrootimport.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/testrootimport.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/testrootimport.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar_test.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar_test.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar_test.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar_test_minimal.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar_test_minimal.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar_test_minimal.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar_test_nofilter.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar_test_nofilter.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_foo_bar_test_nofilter.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_no_properties.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_no_properties.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_no_properties.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_test_deep.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_test_deep.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_test_deep.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_test_folders.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_test_folders.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_test_folders.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_testpage_jcr_content.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_testpage_jcr_content.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/tmp_testpage_jcr_content.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/unfiltered_package.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/unfiltered_package.zip?rev=1512568&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/unfiltered_package.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/settings.xml
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/settings.xml?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/settings.xml (added)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/settings.xml Sat Aug 10 05:53:42 2013
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+
+<!--
+  the settings.xml hold user defined configuration
+  @attr version the version number of structure of this file
+-->
+<vault version="1.0">
+  <!--
+    defines globally ignored files or directories that are never put under
+    vault control. the ".vlt" directory is such a ignored resource but this
+    is hardcoded. the an excluded resource is a directory it's entire subtree
+    is excluded as well.
+
+    @attr name the name of the file or directory to exclude. 
+  -->
+  <ignore name=".svn"/>
+</vault>
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-davex/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-davex/pom.xml?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-davex/pom.xml (added)
+++ jackrabbit/commons/filevault/trunk/vault-davex/pom.xml Sat Aug 10 05:53:42 2013
@@ -0,0 +1,114 @@
+<?xml version="1.0"?><!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
+    <modelVersion>4.0.0</modelVersion>
+    <!-- ====================================================================== -->
+    <!-- P A R E N T  P R O J E C T  D E S C R I P T I O N                      -->
+    <!-- ====================================================================== -->
+    <parent>
+        <groupId>org.apache.jackrabbit.vault</groupId>
+        <artifactId>parent</artifactId>
+        <relativePath>../parent/pom.xml</relativePath>
+        <version>3.0.0-SNAPSHOT</version>
+    </parent>
+
+    <!-- ====================================================================== -->
+    <!-- P R O J E C T  D E S C R I P T I O N                                   -->
+    <!-- ====================================================================== -->
+    <artifactId>vault-davex</artifactId>
+    <version>3.0.0-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>Apache Jackrabbit FileVault JCR Remoting Service</name>
+
+    <!-- ====================================================================== -->
+    <!-- S C M  D E F I N I T I O N                                             -->
+    <!-- ====================================================================== -->
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/jackrabbit/commons/filevault/trunk/vault-davex</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/jackrabbit/commons/filevault/trunk/vault-davex</developerConnection>
+        <url>http://svn.apache.org/viewvc/asf/jackrabbit/commons/filevault/trunk/vault-davex</url>
+    </scm>
+
+    <!-- ====================================================================== -->
+    <!-- D E P E N D E N C I E S                                                -->
+    <!-- ====================================================================== -->
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.jackrabbit.vault</groupId>
+            <artifactId>org.apache.jackrabbit.vault</artifactId>
+            <version>3.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-jcr-commons</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-jcr-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-spi-commons</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-jcr2spi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-spi2dav</artifactId>
+        </dependency>
+        
+        <!-- add some dependencies of spi2davex -->
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-webdav</artifactId>
+            <exclusions>
+                <exclusion>
+                    <!-- jackrabbit webdav has slf4j 1.6.1 which we don't want -->
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>jcl-over-slf4j</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <version>1.5.8</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <!-- JCR Stuff -->
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+        </dependency>
+
+        <!-- SLF4j / Log4j -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

Added: jackrabbit/commons/filevault/trunk/vault-davex/src/main/java/org/apache/jackrabbit/vault/davex/DAVExRepositoryFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-davex/src/main/java/org/apache/jackrabbit/vault/davex/DAVExRepositoryFactory.java?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-davex/src/main/java/org/apache/jackrabbit/vault/davex/DAVExRepositoryFactory.java (added)
+++ jackrabbit/commons/filevault/trunk/vault-davex/src/main/java/org/apache/jackrabbit/vault/davex/DAVExRepositoryFactory.java Sat Aug 10 05:53:42 2013
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.vault.davex;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.jcr.NamespaceException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.params.DefaultHttpParams;
+import org.apache.commons.httpclient.params.DefaultHttpParamsFactory;
+import org.apache.commons.httpclient.params.HostParams;
+import org.apache.commons.httpclient.params.HttpParams;
+import org.apache.commons.httpclient.params.HttpParamsFactory;
+import org.apache.commons.io.FileUtils;
+import org.apache.jackrabbit.client.RepositoryFactoryImpl;
+import org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.commons.conversion.PathResolver;
+import org.apache.jackrabbit.spi.commons.logging.WriterLogWriterProvider;
+import org.apache.jackrabbit.spi2davex.BatchReadConfig;
+import org.apache.jackrabbit.spi2davex.Spi2davexRepositoryServiceFactory;
+import org.apache.jackrabbit.vault.fs.api.RepositoryAddress;
+import org.apache.jackrabbit.vault.fs.api.RepositoryFactory;
+
+/**
+ * <code>DAVExRepositoryFactory</code>...
+ */
+public class DAVExRepositoryFactory implements RepositoryFactory {
+
+    /**
+     * Name of the system property that controls the default depth for retrieving
+     * nodes via spi2davex
+     */
+    public static final String PARAM_JCR_REMOTING_DEPTH = "jcr.remoting.depth";
+
+    /**
+     * Name of the system property that controls the spi log.
+     */
+    public static final String PARAM_JCR_REMOTING_SPILOG = "jcr.remoting.spilog";
+
+    private static final Set<String> SCHEMES = new HashSet<String>();
+    static {
+        SCHEMES.add("http");
+    }
+
+    public Set<String> getSupportedSchemes() {
+        return SCHEMES;
+    }
+
+    public Repository createRepository(RepositoryAddress address)
+            throws RepositoryException {
+        if (!SCHEMES.contains(address.getSpecificURI().getScheme())) {
+            return null;
+        }
+        try {
+            // get uri without credentials
+            URI uri = address.getSpecificURI();
+            if (uri.getUserInfo() != null) {
+                try {
+                    uri = new URI(uri.getScheme(), null, uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment());
+                } catch (URISyntaxException e) {
+                    // ignore
+                }
+            }
+            Map<String, Object> parameters = new HashMap<String, Object>();
+            parameters.put(Jcr2spiRepositoryFactory.PARAM_REPOSITORY_SERVICE_FACTORY, Spi2davexRepositoryServiceFactory.class.getName());
+            parameters.put(Jcr2spiRepositoryFactory.PARAM_ITEM_CACHE_SIZE, Integer.getInteger(PARAM_JCR_REMOTING_DEPTH, 128));
+            parameters.put(Spi2davexRepositoryServiceFactory.PARAM_REPOSITORY_URI, uri.toString());
+            DefaultBatchReadConfig br = new DefaultBatchReadConfig();
+            br.setDefaultDepth(Integer.getInteger(PARAM_JCR_REMOTING_DEPTH, 4));
+            br.setDepth("/", 2);
+            br.setDepth("/jcr:system", 1);
+            parameters.put(Spi2davexRepositoryServiceFactory.PARAM_BATCHREAD_CONFIG, br);
+            String file = System.getProperty(PARAM_JCR_REMOTING_SPILOG);
+            if (file != null) {
+                WriterLogWriterProvider provider = new WriterLogWriterProvider(
+                        new OutputStreamWriter(FileUtils.openOutputStream(new File(file)))
+                );
+                parameters.put(
+                        Jcr2spiRepositoryFactory.PARAM_LOG_WRITER_PROVIDER,
+                        provider
+                );
+            }
+
+            // set default params for httpclient that will be used in jackrabbit's webdav client
+            // this is to provide a referer header for all POST and PUT requests.
+            DefaultHttpParams.setHttpParamsFactory(new MyHttpParamsFactory());
+
+            System.out.printf("Connecting via JCR remoting to %s%n", address.getSpecificURI().toString());
+            return new RepositoryFactoryImpl().getRepository(parameters);
+        } catch (IOException e) {
+            throw new RepositoryException(e);
+        }
+    }
+}
+
+class DefaultBatchReadConfig implements BatchReadConfig {
+
+    public static final int DEPTH_INFINITE = -1;
+
+    private final Map<String, Integer> depthMap = new HashMap<String, Integer>();
+
+    private int defaultDepth = 0;
+
+    public int getDepth(Path path, PathResolver resolver) throws NamespaceException {
+        String jcrPath = resolver.getJCRPath(path);
+        Integer depth = depthMap.get(jcrPath);
+        return depth == null ? defaultDepth : depth;
+    }
+
+    public void setDepth(String path, int depth) {
+        depthMap.put(path, depth);
+    }
+
+    public void setDefaultDepth(int defaultDepth) {
+        this.defaultDepth = defaultDepth;
+    }
+}
+
+class MyHttpParamsFactory implements HttpParamsFactory {
+
+    private final HttpParams params;
+
+    MyHttpParamsFactory() {
+        params = new DefaultHttpParamsFactory().getDefaultParams();
+        List<Header> headers = new ArrayList<Header>();
+        headers.add(new Header("Referer", "about:blank"));
+        params.setParameter(HostParams.DEFAULT_HEADERS, headers);
+    }
+
+    public HttpParams getDefaultParams() {
+        return params;
+    }
+}
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-davex/src/main/resources/META-INF/services/com.day.jcr.vault.fs.api.RepositoryFactory
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-davex/src/main/resources/META-INF/services/com.day.jcr.vault.fs.api.RepositoryFactory?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-davex/src/main/resources/META-INF/services/com.day.jcr.vault.fs.api.RepositoryFactory (added)
+++ jackrabbit/commons/filevault/trunk/vault-davex/src/main/resources/META-INF/services/com.day.jcr.vault.fs.api.RepositoryFactory Sat Aug 10 05:53:42 2013
@@ -0,0 +1,4 @@
+#
+# registers the DAV Ex Repository Factory
+#
+org.apache.jackrabbit.vault.davex.DAVExRepositoryFactory
\ No newline at end of file

Added: jackrabbit/commons/filevault/trunk/vault-diff/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-diff/pom.xml?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-diff/pom.xml (added)
+++ jackrabbit/commons/filevault/trunk/vault-diff/pom.xml Sat Aug 10 05:53:42 2013
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <!-- ====================================================================== -->
+    <!-- P A R E N T  P R O J E C T  D E S C R I P T I O N                      -->
+    <!-- ====================================================================== -->
+    <parent>
+        <groupId>org.apache.jackrabbit.vault</groupId>
+        <artifactId>parent</artifactId>
+        <relativePath>../parent/pom.xml</relativePath>
+        <version>3.0.0-SNAPSHOT</version>
+    </parent>
+
+    <!-- ====================================================================== -->
+    <!-- P R O J E C T  D E S C R I P T I O N                                   -->
+    <!-- ====================================================================== -->
+    <artifactId>vault-diff</artifactId>
+    <name>Apache Jackrabbit FileVault Diff (Diff utilities)</name>
+    <description>Provides Classes for diff and diff3.
+    </description>
+    <version>3.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <!-- ====================================================================== -->
+    <!-- D E P E N D E N C I E S                                                -->
+    <!-- ====================================================================== -->
+    <dependencies>
+        <dependency>
+            <groupId>commons-io</groupId>
+              <artifactId>commons-io</artifactId>
+              <version>1.3.1</version>
+              <scope>test</scope>
+        </dependency>
+        <dependency>
+              <groupId>junit</groupId>
+              <artifactId>junit</artifactId>
+              <version>3.8.1</version>
+              <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <!-- ====================================================================== -->
+    <!-- S C M  D E F I N I T I O N                                             -->
+    <!-- ====================================================================== -->
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/jackrabbit/commons/filevault/trunk/vault-diff</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/jackrabbit/commons/filevault/trunk/vault-diff</developerConnection>
+        <url>http://svn.apache.org/viewvc/asf/jackrabbit/commons/filevault/trunk/vault-diff</url>
+    </scm>
+
+    <!-- ====================================================================== -->
+    <!-- B U I L D   D E F I N I T I O N                                        -->
+    <!-- ====================================================================== -->
+    <build>
+        <plugins>
+            <!-- bundle stuff -->
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-Category>jackrabbit-commons</Bundle-Category>
+                        <Export-Package>
+                            org.apache.jackrabbit.vault.util.diff.*;version=1.0.1
+                        </Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <!-- compiler stuff -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerVersion>1.4</compilerVersion>
+                    <source>1.4</source>
+                    <target>1.4</target>
+                    <debug>true</debug>
+                    <showDeprecation>false</showDeprecation>
+                    <showWarnings>true</showWarnings>
+                    <optimize>false</optimize>
+                </configuration>
+            </plugin>
+            <!-- tests -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <skip>false</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-release-plugin</artifactId>
+                <version>2.0-beta-5</version>
+                <configuration>
+                    <scmCommentPrefix>#4208 - [maven-release] (RTC ok) :</scmCommentPrefix>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <configuration>
+                    <source>1.4</source>
+                </configuration>
+            </plugin>
+        </plugins>
+    </reporting>
+</project>

Added: jackrabbit/commons/filevault/trunk/vault-diff/src/main/java/org/apache/jackrabbit/vault/util/diff/ChangeListener.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-diff/src/main/java/org/apache/jackrabbit/vault/util/diff/ChangeListener.java?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-diff/src/main/java/org/apache/jackrabbit/vault/util/diff/ChangeListener.java (added)
+++ jackrabbit/commons/filevault/trunk/vault-diff/src/main/java/org/apache/jackrabbit/vault/util/diff/ChangeListener.java Sat Aug 10 05:53:42 2013
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.vault.util.diff;
+
+/**
+ * Listener that is called for each line in a document.
+ * See {@link DocumentDiff#showChanges(ChangeListener, int)} for details.
+ */
+public interface ChangeListener {
+
+    /**
+     * Invoked before the iteration over the changes start.
+     * @param left the left document
+     * @param right the right document
+     */
+    void onDocumentsStart(Document left, Document right);
+
+    /**
+     * Invoked after the iteration over the changes finished.
+     * @param left the left document
+     * @param right the right document
+     */
+    void onDocumentsEnd(Document left, Document right);
+
+    /**
+     * Invoked before a change starts.
+     * @param leftElem the index of the left element of this change.
+     * @param leftLen the number of changed left elements.
+     * @param rightElem the index of the right element of this change.
+     * @param rightLen the number of changed right elements.
+     */
+    void onChangeStart(int leftElem, int leftLen, int rightElem, int rightLen);
+
+    /**
+     * Invoked after a change finished.
+     */
+    void onChangeEnd();
+
+    /**
+     * Invoked for an unmodified element
+     * @param leftIdx the index of the left element
+     * @param rightIdx the index of the right element
+     * @param elem the element
+     */
+    void onUnmodified(int leftIdx, int rightIdx, Document.Element elem);
+
+    /**
+     * Invoked for a deleted element
+     * @param leftIdx the index of the left element
+     * @param rightIdx the index of the right element
+     * @param elem the element
+     */
+    void onDeleted(int leftIdx, int rightIdx, Document.Element elem);
+
+    /**
+     * Invoked for an inserted element
+     * @param leftIdx the index of the left element
+     * @param rightIdx the index of the right element
+     * @param elem the element
+     */
+    void onInserted(int leftIdx, int rightIdx, Document.Element elem);
+
+}

Added: jackrabbit/commons/filevault/trunk/vault-diff/src/main/java/org/apache/jackrabbit/vault/util/diff/DefaultChangeListener.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-diff/src/main/java/org/apache/jackrabbit/vault/util/diff/DefaultChangeListener.java?rev=1512568&view=auto
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-diff/src/main/java/org/apache/jackrabbit/vault/util/diff/DefaultChangeListener.java (added)
+++ jackrabbit/commons/filevault/trunk/vault-diff/src/main/java/org/apache/jackrabbit/vault/util/diff/DefaultChangeListener.java Sat Aug 10 05:53:42 2013
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.vault.util.diff;
+
+import java.io.PrintWriter;
+
+/**
+ * Provides a default output for a diff.
+ */
+public class DefaultChangeListener implements ChangeListener {
+
+    /**
+     * the output writer
+     */
+    private final PrintWriter out;
+
+    /**
+     * debug flag
+     */
+    private boolean debug;
+
+    /**
+     * Creates a new default change listener that will write to the given
+     * writer.
+     * @param out the writer
+     */
+    public DefaultChangeListener(PrintWriter out) {
+        this.out = out;
+    }
+
+    /**
+     * Creates a new default change listener that will write to the given
+     * writer. if debug is <code>true</code> the line numbers are also included
+     * in the output.
+     *
+     * @param out the writer
+     * @param debug flag
+     */
+    public DefaultChangeListener(PrintWriter out, boolean debug) {
+        this.out = out;
+        this.debug = debug;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void onDocumentsStart(Document left, Document right) {
+        out.println("Start Diff");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void onDocumentsEnd(Document left, Document right) {
+        out.println("End Diff");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void onChangeStart(int leftLine, int leftLen, int rightLine, int rightLen) {
+        out.println("@@ -" + (leftLine+1) + "," + leftLen + " +" + (rightLine+1) + "," + rightLen + " @@");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void onChangeEnd() {
+        out.flush();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void onUnmodified(int leftLine, int rightLine, Document.Element text) {
+        if (debug) {
+            out.print("(" + (leftLine+1) + "," + (rightLine+1) + ") ");
+        }
+        out.println(text);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void onDeleted(int leftLine, int rightLine, Document.Element text) {
+        if (debug) {
+            out.print("(" + (leftLine+1) + "," + (rightLine+1) + ") ");
+        }
+        out.print("-");
+        out.println(text);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void onInserted(int leftLine, int rightLine, Document.Element text) {
+        if (debug) {
+            out.print("(" + (leftLine+1) + "," + (rightLine+1) + ") ");
+        }
+        out.print("+");
+        out.println(text);
+    }
+
+}