Skip to content

DavResource returned by Sardine.list() does not contain full URI #155

@binwiederhier

Description

@binwiederhier

Hi there,

Thanks for the great library!

Issue: To the best of my knowledge, there is currently no way to retrieve the full URI (including http://...) of the returned resources by Sardine.list() without fiddling with strings.

Example:

for (DavResource res : sardine.list("http://dav/subfolder1")) {
  System.out.println(res.getHref()); // /subfolder1/somefile.jpg
  System.out.println(res.getPath()); // /subfolder1/somefile.jpg
  System.out.println(res.getName()); // somefile.jpg
  System.out.println(res.getHref().getHost()); // null

  // Desired, but non-existant
  System.out.println(res.getFullPath()); // http://dav/subfolder1/somefile.jpg
}

Workaround:
https://github.com/binwiederhier/syncany/blob/f25e7444064337134f04a23db2dc109dd1c6b6df/syncany-plugins/syncany-plugin-webdav/src/main/java/org/syncany/connection/plugins/webdav/WebdavTransferManager.java#L158

Best
Philipp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions