Loading src/com/owncloud/android/lib/common/network/WebdavEntry.java +23 −0 Original line number Diff line number Diff line Loading @@ -25,7 +25,9 @@ package com.owncloud.android.lib.common.network; import android.net.Uri; import com.owncloud.android.lib.common.utils.Log_OC; import org.apache.jackrabbit.webdav.MultiStatusResponse; import org.apache.jackrabbit.webdav.property.DavProperty; import org.apache.jackrabbit.webdav.property.DavPropertyName; Loading @@ -46,6 +48,7 @@ public class WebdavEntry { public static final String EXTENDED_PROPERTY_NAME_SIZE = "size"; public static final String EXTENDED_PROPERTY_FAVORITE = "favorite"; public static final String EXTENDED_PROPERTY_IS_ENCRYPTED = "is-encrypted"; public static final String EXTENDED_PROPERTY_MOUNT_TYPE = "mount-type"; public static final String PROPERTY_QUOTA_USED_BYTES = "quota-used-bytes"; public static final String PROPERTY_QUOTA_AVAILABLE_BYTES = "quota-available-bytes"; Loading @@ -63,9 +66,12 @@ public class WebdavEntry { private String mRemoteId; private boolean mIsFavorite; private boolean mIsEncrypted; private MountType mMountType; private long mContentLength, mCreateTimestamp, mModifiedTimestamp, mSize; private BigDecimal mQuotaUsedBytes, mQuotaAvailableBytes; public enum MountType {INTERNAL, EXTERNAL} public WebdavEntry(MultiStatusResponse ms, String splitElement) { resetData(); if (ms.getStatus().length != 0) { Loading Loading @@ -218,6 +224,19 @@ public class WebdavEntry { mIsEncrypted = false; } // NC mount-type property <nc:mount-type> prop = propSet.get(EXTENDED_PROPERTY_MOUNT_TYPE, Namespace.getNamespace(NAMESPACE_NC)); if (prop != null) { String mountTypeValue = (String) prop.getValue(); if ("external".equals(mountTypeValue)) { mMountType = MountType.EXTERNAL; } else { mMountType = MountType.INTERNAL; } } else { mMountType = MountType.INTERNAL; } } else { Log_OC.e("WebdavEntry", "General fuckup, no status for webdav response"); } Loading Loading @@ -295,6 +314,10 @@ public class WebdavEntry { return mQuotaAvailableBytes; } public MountType getMountType() { return mMountType; } private void resetData() { mName = mUri = mContentType = mPermissions = null; mRemoteId = null; mContentLength = mCreateTimestamp = mModifiedTimestamp = 0; Loading src/com/owncloud/android/lib/common/network/WebdavUtils.java +1 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ public class WebdavUtils { propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_SIZE, Namespace.getNamespace(WebdavEntry.NAMESPACE_OC)); propSet.add(WebdavEntry.EXTENDED_PROPERTY_FAVORITE, Namespace.getNamespace(WebdavEntry.NAMESPACE_OC)); propSet.add(WebdavEntry.EXTENDED_PROPERTY_IS_ENCRYPTED, Namespace.getNamespace(WebdavEntry.NAMESPACE_NC)); propSet.add(WebdavEntry.EXTENDED_PROPERTY_MOUNT_TYPE, Namespace.getNamespace(WebdavEntry.NAMESPACE_NC)); return propSet; } Loading src/com/owncloud/android/lib/resources/files/ReadRemoteFolderOperation.java +3 −4 Original line number Diff line number Diff line Loading @@ -79,10 +79,8 @@ public class ReadRemoteFolderOperation extends RemoteOperation { int status = client.executeMethod(query); // check and process response boolean isSuccess = ( status == HttpStatus.SC_MULTI_STATUS || status == HttpStatus.SC_OK ); boolean isSuccess = (status == HttpStatus.SC_MULTI_STATUS || status == HttpStatus.SC_OK); if (isSuccess) { // get data from remote folder MultiStatus dataInServer = query.getResponseBodyAsMultiStatus(); Loading Loading @@ -172,6 +170,7 @@ public class ReadRemoteFolderOperation extends RemoteOperation { file.setSize(we.size()); file.setFavorite(we.isFavorite()); file.setIsEncrypted(we.isEncrypted()); file.setMountType(we.getMountType()); return file; } } src/com/owncloud/android/lib/resources/files/RemoteFile.java +12 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ public class RemoteFile implements Parcelable, Serializable { private long mSize; private boolean mIsFavorite; private boolean mIsEncrypted; WebdavEntry.MountType mMountType; /** * Getters and Setters. Loading Loading @@ -147,6 +148,14 @@ public class RemoteFile implements Parcelable, Serializable { mSize = size; } public WebdavEntry.MountType getMountType() { return mMountType; } public void setMountType(WebdavEntry.MountType mountType) { this.mMountType = mountType; } public RemoteFile() { resetData(); } Loading Loading @@ -177,6 +186,7 @@ public class RemoteFile implements Parcelable, Serializable { this.setRemoteId(we.remoteId()); this.setSize(we.size()); this.setFavorite(we.isFavorite()); this.setMountType(we.getMountType()); } /** Loading Loading @@ -234,6 +244,7 @@ public class RemoteFile implements Parcelable, Serializable { mSize = source.readLong(); mIsFavorite = Boolean.parseBoolean(source.readString()); mIsEncrypted = Boolean.parseBoolean(source.readString()); mMountType = (WebdavEntry.MountType) source.readSerializable(); } @Override Loading @@ -254,5 +265,6 @@ public class RemoteFile implements Parcelable, Serializable { dest.writeLong(mSize); dest.writeString(Boolean.toString(mIsFavorite)); dest.writeString(Boolean.toString(mIsEncrypted)); dest.writeSerializable(mMountType); } } Loading
src/com/owncloud/android/lib/common/network/WebdavEntry.java +23 −0 Original line number Diff line number Diff line Loading @@ -25,7 +25,9 @@ package com.owncloud.android.lib.common.network; import android.net.Uri; import com.owncloud.android.lib.common.utils.Log_OC; import org.apache.jackrabbit.webdav.MultiStatusResponse; import org.apache.jackrabbit.webdav.property.DavProperty; import org.apache.jackrabbit.webdav.property.DavPropertyName; Loading @@ -46,6 +48,7 @@ public class WebdavEntry { public static final String EXTENDED_PROPERTY_NAME_SIZE = "size"; public static final String EXTENDED_PROPERTY_FAVORITE = "favorite"; public static final String EXTENDED_PROPERTY_IS_ENCRYPTED = "is-encrypted"; public static final String EXTENDED_PROPERTY_MOUNT_TYPE = "mount-type"; public static final String PROPERTY_QUOTA_USED_BYTES = "quota-used-bytes"; public static final String PROPERTY_QUOTA_AVAILABLE_BYTES = "quota-available-bytes"; Loading @@ -63,9 +66,12 @@ public class WebdavEntry { private String mRemoteId; private boolean mIsFavorite; private boolean mIsEncrypted; private MountType mMountType; private long mContentLength, mCreateTimestamp, mModifiedTimestamp, mSize; private BigDecimal mQuotaUsedBytes, mQuotaAvailableBytes; public enum MountType {INTERNAL, EXTERNAL} public WebdavEntry(MultiStatusResponse ms, String splitElement) { resetData(); if (ms.getStatus().length != 0) { Loading Loading @@ -218,6 +224,19 @@ public class WebdavEntry { mIsEncrypted = false; } // NC mount-type property <nc:mount-type> prop = propSet.get(EXTENDED_PROPERTY_MOUNT_TYPE, Namespace.getNamespace(NAMESPACE_NC)); if (prop != null) { String mountTypeValue = (String) prop.getValue(); if ("external".equals(mountTypeValue)) { mMountType = MountType.EXTERNAL; } else { mMountType = MountType.INTERNAL; } } else { mMountType = MountType.INTERNAL; } } else { Log_OC.e("WebdavEntry", "General fuckup, no status for webdav response"); } Loading Loading @@ -295,6 +314,10 @@ public class WebdavEntry { return mQuotaAvailableBytes; } public MountType getMountType() { return mMountType; } private void resetData() { mName = mUri = mContentType = mPermissions = null; mRemoteId = null; mContentLength = mCreateTimestamp = mModifiedTimestamp = 0; Loading
src/com/owncloud/android/lib/common/network/WebdavUtils.java +1 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ public class WebdavUtils { propSet.add(WebdavEntry.EXTENDED_PROPERTY_NAME_SIZE, Namespace.getNamespace(WebdavEntry.NAMESPACE_OC)); propSet.add(WebdavEntry.EXTENDED_PROPERTY_FAVORITE, Namespace.getNamespace(WebdavEntry.NAMESPACE_OC)); propSet.add(WebdavEntry.EXTENDED_PROPERTY_IS_ENCRYPTED, Namespace.getNamespace(WebdavEntry.NAMESPACE_NC)); propSet.add(WebdavEntry.EXTENDED_PROPERTY_MOUNT_TYPE, Namespace.getNamespace(WebdavEntry.NAMESPACE_NC)); return propSet; } Loading
src/com/owncloud/android/lib/resources/files/ReadRemoteFolderOperation.java +3 −4 Original line number Diff line number Diff line Loading @@ -79,10 +79,8 @@ public class ReadRemoteFolderOperation extends RemoteOperation { int status = client.executeMethod(query); // check and process response boolean isSuccess = ( status == HttpStatus.SC_MULTI_STATUS || status == HttpStatus.SC_OK ); boolean isSuccess = (status == HttpStatus.SC_MULTI_STATUS || status == HttpStatus.SC_OK); if (isSuccess) { // get data from remote folder MultiStatus dataInServer = query.getResponseBodyAsMultiStatus(); Loading Loading @@ -172,6 +170,7 @@ public class ReadRemoteFolderOperation extends RemoteOperation { file.setSize(we.size()); file.setFavorite(we.isFavorite()); file.setIsEncrypted(we.isEncrypted()); file.setMountType(we.getMountType()); return file; } }
src/com/owncloud/android/lib/resources/files/RemoteFile.java +12 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ public class RemoteFile implements Parcelable, Serializable { private long mSize; private boolean mIsFavorite; private boolean mIsEncrypted; WebdavEntry.MountType mMountType; /** * Getters and Setters. Loading Loading @@ -147,6 +148,14 @@ public class RemoteFile implements Parcelable, Serializable { mSize = size; } public WebdavEntry.MountType getMountType() { return mMountType; } public void setMountType(WebdavEntry.MountType mountType) { this.mMountType = mountType; } public RemoteFile() { resetData(); } Loading Loading @@ -177,6 +186,7 @@ public class RemoteFile implements Parcelable, Serializable { this.setRemoteId(we.remoteId()); this.setSize(we.size()); this.setFavorite(we.isFavorite()); this.setMountType(we.getMountType()); } /** Loading Loading @@ -234,6 +244,7 @@ public class RemoteFile implements Parcelable, Serializable { mSize = source.readLong(); mIsFavorite = Boolean.parseBoolean(source.readString()); mIsEncrypted = Boolean.parseBoolean(source.readString()); mMountType = (WebdavEntry.MountType) source.readSerializable(); } @Override Loading @@ -254,5 +265,6 @@ public class RemoteFile implements Parcelable, Serializable { dest.writeLong(mSize); dest.writeString(Boolean.toString(mIsFavorite)); dest.writeString(Boolean.toString(mIsEncrypted)); dest.writeSerializable(mMountType); } }