WebDAV Java Examples
The code samples shown in the sections below were produced using Sardine, an external Java library that has basic WebDAV functionalities configured. You can download it from
https://github.com/lookfirst/sardine.
In the Java examples, we assume the existence of a private instance of Sardine. For example, to instantiate an instance of Sardine, use:
Sardine sardine = new SardineImpl(username, password);
in which username and password are the user name and password of the account which you wish to access using the WebDAV protocol.
WebDAV Access URLs
There are two WebDAV access URLs:
Internal – Uses the CTERA proprietary authentication API for login, which is based on the session cookies. Use the internal WebDAV URL if you want to develop your own integration package that also accesses CTERA Portal’s other REST APIs.
External – Uses standards-compliant Basic Authentication. Use the external WebDAV URL if you want to connect an existing standards-compliant WebDAV client with minimum effort.
In each section below, both REST client parameters for the Internal WebDAV URL and Java code examples for the external WebDAV URL are provided.