X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/49ad249816495a1c20254ac8d91abb581d86114a..a06e99c5064bd2807ffebda8f453375f0f79fb82:/src/eu/alefzero/owncloud/datamodel/OCFile.java diff --git a/src/eu/alefzero/owncloud/datamodel/OCFile.java b/src/eu/alefzero/owncloud/datamodel/OCFile.java index b087a9df..68619337 100644 --- a/src/eu/alefzero/owncloud/datamodel/OCFile.java +++ b/src/eu/alefzero/owncloud/datamodel/OCFile.java @@ -86,11 +86,11 @@ public class OCFile implements Parcelable, Comparable { } /** - * Returns the path of the file + * Returns the remote path of the file on ownCloud * - * @return The path + * @return The remote path to the file */ - public String getPath() { + public String getRemotePath() { return mRemotePath; } @@ -119,7 +119,7 @@ public class OCFile implements Parcelable, Comparable { * @return true if it is */ public boolean isDownloaded() { - return mLocalPath != null || mLocalPath.equals(""); + return mLocalPath != null && !mLocalPath.equals(""); } /** @@ -333,4 +333,22 @@ public class OCFile implements Parcelable, Comparable { return getFileName().toLowerCase().compareTo(another.getFileName().toLowerCase()); } + public boolean equals(Object o) { + if(o instanceof OCFile){ + OCFile that = (OCFile) o; + if(that != null){ + return this.mId == that.mId; + } + } + + return false; + } + + @Override + public String toString() { + String asString = "[id=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s]"; + asString = String.format(asString, new Long(mId), getFileName(), mMimeType, isDownloaded(), mLocalPath, mRemotePath); + return asString; + } + }