projects
/
lgpl
/
argeo-commons.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix issues with security dependencies
[lgpl/argeo-commons.git]
/
sandbox
/
runtime
/
org.argeo.sandbox.jackrabbit
/
src
/
main
/
java
/
webdav
/
WebDavTest.java
diff --git
a/sandbox/runtime/org.argeo.sandbox.jackrabbit/src/main/java/webdav/WebDavTest.java
b/sandbox/runtime/org.argeo.sandbox.jackrabbit/src/main/java/webdav/WebDavTest.java
index cb8a97ad2456b0dfac1d29903b689648153f042a..5b938be0d4a1d772a538d59d956fe96a47e5217d 100644
(file)
--- a/
sandbox/runtime/org.argeo.sandbox.jackrabbit/src/main/java/webdav/WebDavTest.java
+++ b/
sandbox/runtime/org.argeo.sandbox.jackrabbit/src/main/java/webdav/WebDavTest.java
@@
-12,9
+12,13
@@
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.webdav.client.methods.CheckoutMethod;
import org.apache.jackrabbit.webdav.client.methods.PutMethod;
public class WebDavTest {
import org.apache.jackrabbit.webdav.client.methods.PutMethod;
public class WebDavTest {
+ private final static Log log = LogFactory.getLog(WebDavTest.class);
/**
* @param args
/**
* @param args
@@
-35,18
+39,22
@@
public class WebDavTest {
client.setHostConfiguration(hostConfig);
// return client;
client.setHostConfiguration(hostConfig);
// return client;
+ String baseUrl = "http://localhost:7070/org.argeo.server.jackrabbit.webapp/default/";
+
String fileName = "test.xml";
String fileName = "test.xml";
- PutMethod pm = new PutMethod(
- "http://localhost:7070/org.argeo.server.jackrabbit.webapp/default/"
- + fileName);
- // String text = "this is the document content";
+
+ // PUT
+ PutMethod pm = new PutMethod(baseUrl + fileName);
RequestEntity requestEntity = new InputStreamRequestEntity(
new FileInputStream(fileName));
RequestEntity requestEntity = new InputStreamRequestEntity(
new FileInputStream(fileName));
- // pm.setRequestEntity(new StringRequestEntity(text, "text/plain",
- // null));
- // pm.setRequestBody(text);
pm.setRequestEntity(requestEntity);
client.executeMethod(pm);
pm.setRequestEntity(requestEntity);
client.executeMethod(pm);
+
+ // GET
+ CheckoutMethod gm = new CheckoutMethod(baseUrl + fileName);
+ client.executeMethod(gm);
+ String responseGet = gm.getResponseBodyAsString();
+ log.debug("CHECKOUT: " + responseGet);
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}