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);
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";
/*
public String path() {
return mPath;
}
+
+ public String decodedPath() {
+ return Uri.decode(mPath);
+ }
public String name() {
return mName;