Downloading a File
Note: The download method can download only files that are not encrypted. The method cannot download directories.
Internal WebDAV
Download a file from the portal.
Object URI
{INT_WEBDAV_URL}/File_path
HTTP Method
GET
Request Header
Empty
Request Body
Empty
Expected Response status
200 OK
If a response such as 404 Not Found is returned, check the spelling of the file in the URL.
If a response such as 403 Not Allowed is returned, the file is passphrase protected.
External WebDAV
Java Example
To download a file to a local path, use:
public void download(String path, String localPath) throws IOException {
  InputStream is = sardine.get(EXT_WEBDAV_URL + "/" + path);
  File targetFile = new File(localPath);
  OutputStream outStream = new FileOutputStream(targetFile);
  byte[] buffer = new byte[8 * 1024];
  int bytesRead;
  while ((bytesRead = is.read(buffer)) != -1) {
    outStream.write(buffer, 0, bytesRead);
  }
  is.close();
  outStream.close();
}