Author: dkuleshov
Date: 2010-10-22 10:48:36 -0400 (Fri, 22 Oct 2010)
New Revision: 3339
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java
Log:
EXOJCR-1012: fixed PROPFIND method with 'allprop', now wrong data output avoided
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java 2010-10-22
14:47:57 UTC (rev 3338)
+++
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java 2010-10-22
14:48:36 UTC (rev 3339)
@@ -64,6 +64,8 @@
// FILE_SKIP.add("jcr:primaryType");
FILE_SKIP.add("jcr:mixinTypes");
FILE_SKIP.add("jcr:created");
+ FILE_SKIP.add("jcr:lockOwner");
+ FILE_SKIP.add("jcr:lockIsDeep");
};
/**
@@ -76,6 +78,8 @@
CONTENT_SKIP.add("jcr:lastModified");
CONTENT_SKIP.add("jcr:mimeType");
CONTENT_SKIP.add("jcr:uuid");
+ CONTENT_SKIP.add("jcr:lockOwner");
+ CONTENT_SKIP.add("jcr:lockIsDeep");
CONTENT_SKIP.add("dc:date");
CONTENT_SKIP.add("exo:internalUse");
Modified:
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java 2010-10-22
14:47:57 UTC (rev 3338)
+++
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java 2010-10-22
14:48:36 UTC (rev 3339)
@@ -30,8 +30,6 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
import javax.jcr.Node;
import javax.ws.rs.core.HttpHeaders;
@@ -158,7 +156,36 @@
}
+ public void testPropfindWrongDataFormat() throws Exception
+ {
+
+ String path = testPropFind.getPath() + "/testPropfindComplexContent";
+ // prepare data
+ Node node =
+ TestUtils.addContent(session, path, new ByteArrayInputStream("file
content".getBytes()), "nt:file",
+ "exo:testResource", "text/plain");
+
+ node.addMixin("mix:lockable");
+ node.save();
+ node.lock(false, false);
+ node.getNode("jcr:content").addMixin("mix:lockable");
+ node.save();
+ node.getNode("jcr:content").lock(true, false);
+ node.getNode("jcr:content").addNode("node",
"nt:unstructured").setProperty("node-prop", "prop");
+ node.getNode("jcr:content").setProperty("exo:prop",
"prop");
+ node.save();
+
+ // test
+ HierarchicalProperty body = new HierarchicalProperty("D:propfind", null,
"DAV:");
+ body.addChild(new HierarchicalProperty("D:allprop", null,
"DAV:"));
+ Response resp = new PropFindCommand().propfind(session, path, body,
Depth.INFINITY_VALUE, "http://localhost");
+ ByteArrayOutputStream bas = new ByteArrayOutputStream();
+ ((PropFindResponseEntity)resp.getEntity()).write(bas);
+ String find = new String(bas.toByteArray());
+ assertTrue(!find.contains("jcr:lockOnwer"));
+ assertTrue(!find.contains("D:lockdiscovery"));
+ }
public void testPropWithPercent() throws Exception
Show replies by date