webdav sardine jar with JavaEE web application

309 Views Asked by At

We have an existing JavaEE web application. We need to connect to a document repository via webdav. I am trying to use sardine but the couldn't find clear setup instructions. Is the Maven build mandatory? Or, is it possible to simply include sardine.jar in our application and use the below code?

Sardine sardine = SardineFactory.begin("username", "password");
List<DavResource> resources = sardine.list("http://myhost.com/modeshape-webdav/sample/default");
for (DavResource res : resources)
{
  System.out.println(res);
}
1

There are 1 best solutions below

0
Pinpin On

If you use Maven, you can add this dependency in your pom.xml to use Sardine :

<dependency>
  <groupId>com.github.lookfirst</groupId>
  <artifactId>sardine</artifactId>
  <version>5.5</version>
</dependency>