X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/f72289f7bfb2aef41f575cbfe225c94e4d5fabe2..080a8ab7af2bc48e3c5fa1334ae91d21073e26c2:/src/com/owncloud/android/datamodel/OCFile.java?ds=sidebyside diff --git a/src/com/owncloud/android/datamodel/OCFile.java b/src/com/owncloud/android/datamodel/OCFile.java index fcde054a..a6da654d 100644 --- a/src/com/owncloud/android/datamodel/OCFile.java +++ b/src/com/owncloud/android/datamodel/OCFile.java @@ -43,6 +43,8 @@ public class OCFile implements Parcelable, Comparable { } }; + private final static String PERMISSION_SHARED_WITH_ME = "S"; // TODO move to better location + public static final String PATH_SEPARATOR = "/"; public static final String ROOT_PATH = PATH_SEPARATOR; @@ -76,6 +78,8 @@ public class OCFile implements Parcelable, Comparable { private String mEtagInConflict; // Save file etag in the server, when there is a conflict. No conflict = null + private boolean mShareWithSharee; + /** * Create new {@link OCFile} with given path. @@ -120,6 +124,7 @@ public class OCFile implements Parcelable, Comparable { mNeedsUpdateThumbnail = source.readInt() == 1; mIsDownloading = source.readInt() == 1; mEtagInConflict = source.readString(); + mShareWithSharee = source.readInt() == 1; } @@ -146,6 +151,7 @@ public class OCFile implements Parcelable, Comparable { dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0); dest.writeInt(mIsDownloading ? 1 : 0); dest.writeString(mEtagInConflict); + dest.writeInt(mShareWithSharee ? 1 : 0); } /** @@ -344,6 +350,7 @@ public class OCFile implements Parcelable, Comparable { mNeedsUpdateThumbnail = false; mIsDownloading = false; mEtagInConflict = null; + mShareWithSharee = false; } /** @@ -488,11 +495,12 @@ public class OCFile implements Parcelable, Comparable { this.mEtag = (etag != null ? etag : ""); } - public boolean isShareByLink() { + + public boolean isSharedViaLink() { return mShareByLink; } - public void setShareByLink(boolean shareByLink) { + public void setShareViaLink(boolean shareByLink) { this.mShareByLink = shareByLink; } @@ -591,4 +599,17 @@ public class OCFile implements Parcelable, Comparable { public void setEtagInConflict(String etagInConflict) { mEtagInConflict = etagInConflict; } + + public boolean isSharedWithSharee() { + return mShareWithSharee; + } + + public void setShareWithSharee(boolean shareWithSharee) { + this.mShareWithSharee = shareWithSharee; + } + + public boolean isSharedWithMe() { + String permissions = getPermissions(); + return (permissions != null && permissions.contains(PERMISSION_SHARED_WITH_ME)); + } }