X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/435b31ba4f3597cc7a43270cd4a54fb0180956c1..76ba00b2b23f5c2079a6635dc5e661850c3c5dfb:/src/eu/alefzero/webdav/WebdavEntry.java diff --git a/src/eu/alefzero/webdav/WebdavEntry.java b/src/eu/alefzero/webdav/WebdavEntry.java index e7222772..84c96fbd 100644 --- a/src/eu/alefzero/webdav/WebdavEntry.java +++ b/src/eu/alefzero/webdav/WebdavEntry.java @@ -24,18 +24,19 @@ import org.apache.jackrabbit.webdav.property.DavProperty; import org.apache.jackrabbit.webdav.property.DavPropertyName; import org.apache.jackrabbit.webdav.property.DavPropertySet; +import android.net.Uri; import android.util.Log; public class WebdavEntry { private String mName, mPath, mUri, mContentType; private long mContentLength, mCreateTimestamp, mModifiedTimestamp; - public WebdavEntry(MultiStatusResponse ms) { + public WebdavEntry(MultiStatusResponse ms, String splitElement) { resetData(); if (ms.getStatus().length != 0) { mUri = ms.getHref(); - mPath = mUri.split("webdav.php", 2)[1]; + mPath = mUri.split(splitElement, 2)[1]; int status = ms.getStatus()[0].getStatusCode(); DavPropertySet propSet = ms.getProperties(status); @@ -52,6 +53,10 @@ public class WebdavEntry { prop = propSet.get(DavPropertyName.GETCONTENTTYPE); if (prop != null) { mContentType = (String) prop.getValue(); + // dvelasco: some builds of ownCloud server 4.0.x added a trailing ';' to the MIME type ; if looks fixed, but let's be cautious + if (mContentType.indexOf(";") >= 0) { + mContentType = mContentType.substring(0, mContentType.indexOf(";")); + } } else { mContentType = "DIR"; /* @@ -88,6 +93,10 @@ public class WebdavEntry { public String path() { return mPath; } + + public String decodedPath() { + return Uri.decode(mPath); + } public String name() { return mName;