From: David A. Velasco Date: Tue, 30 Oct 2012 10:25:29 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/master' X-Git-Tag: oc-android-1.4.3~118 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/f52780defde1d44c5ce222153134c04fd339a2c8?hp=3469c3fa9c9dee1a09862dc3a1d6bdc22ee07f11 Merge remote-tracking branch 'origin/master' --- diff --git a/src/eu/alefzero/webdav/WebdavEntry.java b/src/eu/alefzero/webdav/WebdavEntry.java index 84c96fbd..773276d8 100644 --- a/src/eu/alefzero/webdav/WebdavEntry.java +++ b/src/eu/alefzero/webdav/WebdavEntry.java @@ -57,13 +57,15 @@ public class WebdavEntry { if (mContentType.indexOf(";") >= 0) { mContentType = mContentType.substring(0, mContentType.indexOf(";")); } - } else { - mContentType = "DIR"; - /* - * prop = propSet.get(DavPropertyName.ISCOLLECTION); if (prop != - * null && Boolean.parseBoolean((String) prop.getValue())) - * mContentType = "DIR"; - */ + } + + // check if it's a folder in the standard way: see RFC2518 12.2 , or RFC4918 14.3 + prop = propSet.get(DavPropertyName.RESOURCETYPE); + if (prop!= null) { + Object value = prop.getValue(); + if (value != null) { + mContentType = "DIR"; // a specific attribute would be better, but this is enough; unless while we have no reason to distinguish MIME types for folders + } } prop = propSet.get(DavPropertyName.GETCONTENTLENGTH);