X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/8e36e7cc3e6218ccb80ee2af3eb0a19df24e339f..c75e5aa71cf93e677e5abb95cb3d9c1f45a64ea7:/src/eu/alefzero/webdav/WebdavEntry.java diff --git a/src/eu/alefzero/webdav/WebdavEntry.java b/src/eu/alefzero/webdav/WebdavEntry.java index b474e207..665a850c 100644 --- a/src/eu/alefzero/webdav/WebdavEntry.java +++ b/src/eu/alefzero/webdav/WebdavEntry.java @@ -2,9 +2,8 @@ * Copyright (C) 2012 ownCloud * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -27,10 +26,9 @@ import org.apache.jackrabbit.webdav.property.DavPropertySet; import com.owncloud.android.Log_OC; import android.net.Uri; -import android.util.Log; public class WebdavEntry { - private String mName, mPath, mUri, mContentType; + private String mName, mPath, mUri, mContentType, mEtag; private long mContentLength, mCreateTimestamp, mModifiedTimestamp; public WebdavEntry(MultiStatusResponse ms, String splitElement) { @@ -44,8 +42,10 @@ public class WebdavEntry { DavPropertySet propSet = ms.getProperties(status); @SuppressWarnings("rawtypes") DavProperty prop = propSet.get(DavPropertyName.DISPLAYNAME); - if (prop != null) + if (prop != null) { mName = (String) prop.getName().toString(); + mName = mName.substring(1, mName.length()-1); + } else { String[] tmp = mPath.split("/"); if (tmp.length > 0) @@ -63,7 +63,7 @@ public class WebdavEntry { } } - // check if it's a folder in the standard way: see RFC2518 12.2 , or RFC4918 14.3 + // check if it's a folder in the standard way: see RFC2518 12.2 . RFC4918 14.3 prop = propSet.get(DavPropertyName.RESOURCETYPE); if (prop!= null) { Object value = prop.getValue(); @@ -89,6 +89,12 @@ public class WebdavEntry { .parseResponseDate((String) prop.getValue()); mCreateTimestamp = (d != null) ? d.getTime() : 0; } + + prop = propSet.get(DavPropertyName.GETETAG); + if (prop != null) { + mEtag = (String) prop.getValue(); + mEtag = mEtag.substring(1, mEtag.length()-1); + } } else { Log_OC.e("WebdavEntry", @@ -131,6 +137,10 @@ public class WebdavEntry { public long modifiedTimestamp() { return mModifiedTimestamp; } + + public String etag() { + return mEtag; + } private void resetData() { mName = mUri = mContentType = null;