1

I'm using JackRabbit Webdav Client for Android.I'm unable to get the size of the specific folder.Is there any way to find this?For a file getContentLength property is returning length.This property is not available for folder.

Thanks in Advance, Sha

sha
  • 1,410
  • 2
  • 18
  • 37
  • Possible duplicate : http://stackoverflow.com/questions/4040912/how-can-i-get-the-size-of-a-folder-on-sd-card-in-android – Dalmas Nov 18 '11 at 15:52

1 Answers1

0

You should be able to collect this information with a PROPFIND request for the D:contentlength property. Depending on the WebDAV server you're accessing, that should return the sizes of all the files within that folder (with Depth: 1) or the entire subtree (with Depth: infinity).

You'd still have to iterate through the returned values to calculate the sum of all individual file sizes, but at least you'll only need a single HTTP request for this.

Jukka Zitting
  • 1,092
  • 6
  • 13
  • Thank you.I'll check and let you know – sha Nov 19 '11 at 20:13
  • **Depth:inifinity** is returning a forbidden exception.What does that mean. **Depth:1** and **Depth:0** are working fone. – sha Nov 24 '11 at 05:23
  • 1
    Sounds like the WebDAV server you're accessing doesn't allow Depth: infinity requests. Without that feature your client will need to recurse the subtree, calling PROPFIND with Depth: 1 on all subdirectories to collect the sizes of all the files included in the subtree. – Jukka Zitting Nov 24 '11 at 10:24
  • Thanks.I'll iterate the subfolders with depth :1. – sha Nov 24 '11 at 13:08