Browse Source

Resolve #3148 adding lombok to some larger data classes

Andy Scherzinger 6 years ago
parent
commit
162ccfc15c
24 changed files with 341 additions and 841 deletions
  1. 5 6
      src/androidTest/java/com/owncloud/android/datamodel/OCFileUnitTest.java
  2. 7 7
      src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java
  3. 3 5
      src/main/java/com/owncloud/android/datamodel/MediaFolderType.java
  4. 10 28
      src/main/java/com/owncloud/android/datamodel/MediaFoldersModel.java
  5. 164 434
      src/main/java/com/owncloud/android/datamodel/OCFile.java
  6. 9 9
      src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java
  7. 14 44
      src/main/java/com/owncloud/android/datastorage/StoragePoint.java
  8. 31 199
      src/main/java/com/owncloud/android/db/OCUpload.java
  9. 5 15
      src/main/java/com/owncloud/android/features/FeatureItem.java
  10. 3 3
      src/main/java/com/owncloud/android/files/services/FileDownloader.java
  11. 8 8
      src/main/java/com/owncloud/android/operations/CreateFolderOperation.java
  12. 5 5
      src/main/java/com/owncloud/android/operations/CreateShareViaLinkOperation.java
  13. 5 6
      src/main/java/com/owncloud/android/operations/CreateShareWithShareeOperation.java
  14. 20 20
      src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java
  15. 25 25
      src/main/java/com/owncloud/android/operations/SynchronizeFolderOperation.java
  16. 6 6
      src/main/java/com/owncloud/android/operations/UnshareOperation.java
  17. 1 1
      src/main/java/com/owncloud/android/operations/UpdateShareViaLinkOperation.java
  18. 7 7
      src/main/java/com/owncloud/android/operations/UploadFileOperation.java
  19. 3 3
      src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java
  20. 4 4
      src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java
  21. 2 2
      src/main/java/com/owncloud/android/ui/adapter/UploaderAdapter.java
  22. 1 1
      src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java
  23. 2 2
      src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java
  24. 1 1
      src/main/java/com/owncloud/android/utils/FileStorageUtils.java

+ 5 - 6
src/androidTest/java/com/owncloud/android/datamodel/OCFileUnitTest.java

@@ -1,4 +1,4 @@
-/**
+/*
  * ownCloud Android client application
  *
  * @author David A. Velasco
@@ -77,7 +77,7 @@ public class OCFileUnitTest {
         mFile.setFileId(ID);
         mFile.setParentId(PARENT_ID);
         mFile.setStoragePath(STORAGE_PATH);
-        mFile.setMimetype(MIME_TYPE);
+        mFile.setMimeType(MIME_TYPE);
         mFile.setFileLength(FILE_LENGTH);
         mFile.setCreationTimestamp(CREATION_TIMESTAMP);
         mFile.setModificationTimestamp(MODIFICATION_TIMESTAMP);
@@ -86,8 +86,8 @@ public class OCFileUnitTest {
         mFile.setLastSyncDateForData(LAST_SYNC_DATE_FOR_DATA);
         mFile.setAvailableOffline(true);
         mFile.setEtag(ETAG);
-        mFile.setShareViaLink(true);
-        mFile.setShareWithSharee(true);
+        mFile.setSharedViaLink(true);
+        mFile.setSharedWithSharee(true);
         mFile.setPublicLink(PUBLIC_LINK);
         mFile.setPermissions(PERMISSIONS);
         mFile.setRemoteId(REMOTE_ID);
@@ -126,9 +126,8 @@ public class OCFileUnitTest {
         assertThat(fileReadFromParcel.getPublicLink(), is(PUBLIC_LINK));
         assertThat(fileReadFromParcel.getPermissions(), is(PERMISSIONS));
         assertThat(fileReadFromParcel.getRemoteId(), is(REMOTE_ID));
-        assertThat(fileReadFromParcel.needsUpdateThumbnail(), is(true));
+        assertThat(fileReadFromParcel.isNeedsUpdateThumbnail(), is(true));
         assertThat(fileReadFromParcel.isDownloading(), is(true));
         assertThat(fileReadFromParcel.getEtagInConflict(), is(ETAG_IN_CONFLICT));
-
     }
 }

+ 7 - 7
src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java

@@ -215,7 +215,7 @@ public class FileDataStorageManager {
         cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
         cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
         cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
-        cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
+        cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.isNeedsUpdateThumbnail());
         cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading());
         cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict());
 
@@ -484,7 +484,7 @@ public class FileDataStorageManager {
         cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
         cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
         cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
-        cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
+        cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.isNeedsUpdateThumbnail());
         cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading());
         cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict());
         cv.put(ProviderTableMeta.FILE_FAVORITE, file.isFavorite());
@@ -870,7 +870,7 @@ public class FileDataStorageManager {
 
     private OCFile createRootDir() {
         OCFile file = new OCFile(OCFile.ROOT_PATH);
-        file.setMimetype(MimeType.DIRECTORY);
+        file.setMimeType(MimeType.DIRECTORY);
         file.setParentId(FileDataStorageManager.ROOT_PARENT_ID);
         saveFile(file);
         return file;
@@ -948,7 +948,7 @@ public class FileDataStorageManager {
             file.setFileId(c.getLong(c.getColumnIndex(ProviderTableMeta._ID)));
             file.setParentId(c.getLong(c.getColumnIndex(ProviderTableMeta.FILE_PARENT)));
             file.setEncryptedFileName(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_ENCRYPTED_NAME)));
-            file.setMimetype(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_CONTENT_TYPE)));
+            file.setMimeType(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_CONTENT_TYPE)));
             file.setStoragePath(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_STORAGE_PATH)));
             if (file.getStoragePath() == null) {
                 // try to find existing file and bind it with current account;
@@ -969,8 +969,8 @@ public class FileDataStorageManager {
             file.setLastSyncDateForData(c.getLong(c.getColumnIndex(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA)));
             file.setAvailableOffline(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_KEEP_IN_SYNC)) == 1);
             file.setEtag(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_ETAG)));
-            file.setShareViaLink(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_SHARED_VIA_LINK)) == 1);
-            file.setShareWithSharee(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_SHARED_WITH_SHAREE)) == 1);
+            file.setSharedViaLink(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_SHARED_VIA_LINK)) == 1);
+            file.setSharedWithSharee(c.getInt(c.getColumnIndex(ProviderTableMeta.FILE_SHARED_WITH_SHAREE)) == 1);
             file.setPublicLink(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PUBLIC_LINK)));
             file.setPermissions(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PERMISSIONS)));
             file.setRemoteId(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID)));
@@ -1399,7 +1399,7 @@ public class FileDataStorageManager {
                 cv.put(ProviderTableMeta.FILE_FAVORITE, file.isFavorite());
                 cv.put(
                         ProviderTableMeta.FILE_UPDATE_THUMBNAIL,
-                        file.needsUpdateThumbnail() ? 1 : 0
+                        file.isNeedsUpdateThumbnail() ? 1 : 0
                 );
                 cv.put(
                         ProviderTableMeta.FILE_IS_DOWNLOADING,

+ 3 - 5
src/main/java/com/owncloud/android/datamodel/MediaFolderType.java

@@ -21,6 +21,8 @@ package com.owncloud.android.datamodel;
 
 import android.util.SparseArray;
 
+import lombok.Getter;
+
 /**
  * Types of media folder.
  */
@@ -29,7 +31,7 @@ public enum MediaFolderType {
     IMAGE(1),
     VIDEO(2);
 
-    private Integer id;
+    @Getter private Integer id;
 
     private static SparseArray<MediaFolderType> reverseMap = new SparseArray<>(3);
 
@@ -46,8 +48,4 @@ public enum MediaFolderType {
     public static MediaFolderType getById(Integer id) {
         return reverseMap.get(id);
     }
-
-    public Integer getId() {
-        return id;
-    }
 }

+ 10 - 28
src/main/java/com/owncloud/android/datamodel/MediaFoldersModel.java

@@ -2,7 +2,9 @@
  * Nextcloud Android client application
  *
  * @author Mario Danic
+ * @author Andy Scherzinger
  * Copyright (C) 2018 Mario Danic
+ * Copyright (C) 2018 Andy Scherzinger
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -22,35 +24,15 @@ package com.owncloud.android.datamodel;
 
 import java.util.List;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter @Setter
+@NoArgsConstructor
+@AllArgsConstructor
 public class MediaFoldersModel {
     private List<String> imageMediaFolders;
     private List<String> videoMediaFolders;
-
-    /**
-     * default constructor.
-     */
-    public MediaFoldersModel() {
-        // keep default constructor for GSON
-    }
-
-    public MediaFoldersModel(List<String> imageMediaFolders, List<String> videoMediaFolders) {
-        this.imageMediaFolders = imageMediaFolders;
-        this.videoMediaFolders = videoMediaFolders;
-    }
-
-    public List<String> getImageMediaFolders() {
-        return imageMediaFolders;
-    }
-
-    public void setImageMediaFolders(List<String> imageMediaFolders) {
-        this.imageMediaFolders = imageMediaFolders;
-    }
-
-    public List<String> getVideoMediaFolders() {
-        return videoMediaFolders;
-    }
-
-    public void setVideoMediaFolders(List<String> videoMediaFolders) {
-        this.videoMediaFolders = videoMediaFolders;
-    }
 }

+ 164 - 434
src/main/java/com/owncloud/android/datamodel/OCFile.java

@@ -40,6 +40,8 @@ import com.owncloud.android.utils.MimeType;
 
 import java.io.File;
 
+import lombok.Getter;
+import lombok.Setter;
 import third_parties.daveKoeller.AlphanumComparator;
 
 public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterface {
@@ -52,48 +54,55 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
 
     private static final String TAG = OCFile.class.getSimpleName();
 
-    private long mId;
-    private long mParentId;
-    private long mLength;
-    private long mCreationTimestamp;
-    private long mModifiedTimestamp;
-    private long mModifiedTimestampAtLastSyncForData;
-    private String mRemotePath;
-    private String mLocalPath;
-    private String mMimeType;
-    private boolean mNeedsUpdating;
-    private long mLastSyncDateForProperties;
-    private long mLastSyncDateForData;
-    private boolean mAvailableOffline;
+    /** android internal ID of the file */
+    @Getter @Setter private long fileId;
+    @Getter @Setter private long parentId;
+    @Getter @Setter private long fileLength;
+    /** UNIX timestamp of the time the file was created */
+    @Getter @Setter private long creationTimestamp;
+    /** UNIX timestamp of the file modification time */
+    @Getter @Setter private long modificationTimestamp;
+    /** UNIX timestamp of the modification time, corresponding to the value returned by the server
+     * in the last synchronization of THE CONTENTS of this file.
+     */
+    @Getter @Setter private long modificationTimestampAtLastSyncForData;
+    @Setter private String remotePath;
+    private String localPath;
+    @Getter @Setter private String mimeType;
+    @Getter private boolean needsUpdatingWhileSaving;
+    @Getter @Setter private long lastSyncDateForProperties;
+    @Getter @Setter private long lastSyncDateForData;
+    @Getter @Setter private boolean availableOffline;
     private boolean mHasPreview;
 
-    private String mEtag;
+    @Getter private String etag;
 
-    private boolean mShareByLink;
-    private String mPublicLink;
+    @Getter @Setter private boolean sharedViaLink;
+    @Getter @Setter private String publicLink;
 
-    private String mPermissions;
-    private String mRemoteId;
+    @Getter @Setter private String permissions;
+    /** The fileid namespaced by the instance fileId, globally unique */
+    @Getter @Setter private String remoteId;
 
-    private boolean mNeedsUpdateThumbnail;
+    @Getter @Setter private boolean needsUpdateThumbnail;
 
-    private boolean mIsDownloading;
+    @Getter @Setter private boolean downloading;
 
-    private String mEtagInConflict;    // Save file etag in the server, when there is a conflict. No conflict =  null
+    @Getter @Setter private String etagInConflict;    // Save file etag in the server, when there is a conflict. No conflict =  null
 
-    private boolean mShareWithSharee;
+    @Getter @Setter private boolean sharedWithSharee;
 
-    private boolean mIsFavorite;
+    @Getter @Setter private boolean favorite;
 
-    private boolean mIsEncrypted;
+    @Getter @Setter private boolean encrypted;
 
-    private WebdavEntry.MountType mMountType;
+    @Getter @Setter private WebdavEntry.MountType mountType;
 
     /**
      * URI to the local path of the file contents, if stored in the device; cached after first call
      * to {@link #getStorageUri()}
      */
-    private Uri mLocalUri;
+    private Uri localUri;
 
 
     /**
@@ -101,8 +110,8 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      * <p>
      * Cached after first call, until changed.
      */
-    private Uri mExposedFileUri;
-    private String mEncryptedFileName;
+    private Uri exposedFileUri;
+    @Getter @Setter private String encryptedFileName;
 
 
     /**
@@ -114,11 +123,11 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      */
     public OCFile(String path) {
         resetData();
-        mNeedsUpdating = false;
+        needsUpdatingWhileSaving = false;
         if (path == null || path.length() <= 0 || !path.startsWith(PATH_SEPARATOR)) {
             throw new IllegalArgumentException("Trying to create a OCFile with a non valid remote path: " + path);
         }
-        mRemotePath = path;
+        remotePath = path;
     }
 
     /**
@@ -127,90 +136,66 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      * @param source The source parcel
      */
     private OCFile(Parcel source) {
-        mId = source.readLong();
-        mParentId = source.readLong();
-        mLength = source.readLong();
-        mCreationTimestamp = source.readLong();
-        mModifiedTimestamp = source.readLong();
-        mModifiedTimestampAtLastSyncForData = source.readLong();
-        mRemotePath = source.readString();
-        mLocalPath = source.readString();
-        mMimeType = source.readString();
-        mNeedsUpdating = source.readInt() == 0;
-        mAvailableOffline = source.readInt() == 1;
-        mLastSyncDateForProperties = source.readLong();
-        mLastSyncDateForData = source.readLong();
-        mEtag = source.readString();
-        mShareByLink = source.readInt() == 1;
-        mPublicLink = source.readString();
-        mPermissions = source.readString();
-        mRemoteId = source.readString();
-        mNeedsUpdateThumbnail = source.readInt() == 1;
-        mIsDownloading = source.readInt() == 1;
-        mEtagInConflict = source.readString();
-        mShareWithSharee = source.readInt() == 1;
-        mIsFavorite = source.readInt() == 1;
-        mIsEncrypted = source.readInt() == 1;
-        mEncryptedFileName = source.readString();
-        mMountType = (WebdavEntry.MountType) source.readSerializable();
+        fileId = source.readLong();
+        parentId = source.readLong();
+        fileLength = source.readLong();
+        creationTimestamp = source.readLong();
+        modificationTimestamp = source.readLong();
+        modificationTimestampAtLastSyncForData = source.readLong();
+        remotePath = source.readString();
+        localPath = source.readString();
+        mimeType = source.readString();
+        needsUpdatingWhileSaving = source.readInt() == 0;
+        availableOffline = source.readInt() == 1;
+        lastSyncDateForProperties = source.readLong();
+        lastSyncDateForData = source.readLong();
+        etag = source.readString();
+        sharedViaLink = source.readInt() == 1;
+        publicLink = source.readString();
+        permissions = source.readString();
+        remoteId = source.readString();
+        needsUpdateThumbnail = source.readInt() == 1;
+        downloading = source.readInt() == 1;
+        etagInConflict = source.readString();
+        sharedWithSharee = source.readInt() == 1;
+        favorite = source.readInt() == 1;
+        encrypted = source.readInt() == 1;
+        encryptedFileName = source.readString();
+        mountType = (WebdavEntry.MountType) source.readSerializable();
     }
 
     @Override
     public void writeToParcel(Parcel dest, int flags) {
-        dest.writeLong(mId);
-        dest.writeLong(mParentId);
-        dest.writeLong(mLength);
-        dest.writeLong(mCreationTimestamp);
-        dest.writeLong(mModifiedTimestamp);
-        dest.writeLong(mModifiedTimestampAtLastSyncForData);
-        dest.writeString(mRemotePath);
-        dest.writeString(mLocalPath);
-        dest.writeString(mMimeType);
-        dest.writeInt(mNeedsUpdating ? 1 : 0);
-        dest.writeInt(mAvailableOffline ? 1 : 0);
-        dest.writeLong(mLastSyncDateForProperties);
-        dest.writeLong(mLastSyncDateForData);
-        dest.writeString(mEtag);
-        dest.writeInt(mShareByLink ? 1 : 0);
-        dest.writeString(mPublicLink);
-        dest.writeString(mPermissions);
-        dest.writeString(mRemoteId);
-        dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0);
-        dest.writeInt(mIsDownloading ? 1 : 0);
-        dest.writeString(mEtagInConflict);
-        dest.writeInt(mShareWithSharee ? 1 : 0);
-        dest.writeInt(mIsFavorite ? 1 : 0);
-        dest.writeInt(mIsEncrypted ? 1 : 0);
-        dest.writeString(mEncryptedFileName);
-        dest.writeSerializable(mMountType);
-    }
-
-    public boolean isFavorite() {
-        return mIsFavorite;
-    }
-
-    public void setFavorite(boolean mIsFavorite) {
-        this.mIsFavorite = mIsFavorite;
-    }
-
-    public boolean isEncrypted() {
-        return mIsEncrypted;
-    }
-
-    public void setEncrypted(boolean mIsEncrypted) {
-        this.mIsEncrypted = mIsEncrypted;
-    }
-    /**
-     * Gets the android internal ID of the file
-     *
-     * @return the android internal file ID
-     */
-    public long getFileId() {
-        return mId;
+        dest.writeLong(fileId);
+        dest.writeLong(parentId);
+        dest.writeLong(fileLength);
+        dest.writeLong(creationTimestamp);
+        dest.writeLong(modificationTimestamp);
+        dest.writeLong(modificationTimestampAtLastSyncForData);
+        dest.writeString(remotePath);
+        dest.writeString(localPath);
+        dest.writeString(mimeType);
+        dest.writeInt(needsUpdatingWhileSaving ? 1 : 0);
+        dest.writeInt(availableOffline ? 1 : 0);
+        dest.writeLong(lastSyncDateForProperties);
+        dest.writeLong(lastSyncDateForData);
+        dest.writeString(etag);
+        dest.writeInt(sharedViaLink ? 1 : 0);
+        dest.writeString(publicLink);
+        dest.writeString(permissions);
+        dest.writeString(remoteId);
+        dest.writeInt(needsUpdateThumbnail ? 1 : 0);
+        dest.writeInt(downloading ? 1 : 0);
+        dest.writeString(etagInConflict);
+        dest.writeInt(sharedWithSharee ? 1 : 0);
+        dest.writeInt(favorite ? 1 : 0);
+        dest.writeInt(encrypted ? 1 : 0);
+        dest.writeString(encryptedFileName);
+        dest.writeSerializable(mountType);
     }
 
     public String getDecryptedRemotePath() {
-        return mRemotePath;
+        return remotePath;
     }
 
     /**
@@ -220,7 +205,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      */
     public String getRemotePath() {
         if (isEncrypted() && !isFolder()) {
-            String parentPath = new File(mRemotePath).getParent();
+            String parentPath = new File(remotePath).getParent();
 
             if (parentPath.endsWith("/")) {
                 return parentPath + getEncryptedFileName();
@@ -229,21 +214,17 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
             }
         } else {
             if (isFolder()) {
-                if (mRemotePath.endsWith("/")) {
-                    return mRemotePath;
+                if (remotePath.endsWith("/")) {
+                    return remotePath;
                 } else {
-                    return mRemotePath + "/";
+                    return remotePath + "/";
                 }
             } else {
-                return mRemotePath;
+                return remotePath;
             }
         }
     }
 
-    public void setRemotePath(String path) {
-        mRemotePath = path;
-    }
-
     /**
      * Can be used to check, whether or not this file exists in the database
      * already
@@ -251,7 +232,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      * @return true, if the file exists in the database
      */
     public boolean fileExists() {
-        return mId != -1;
+        return fileId != -1;
     }
 
     /**
@@ -260,7 +241,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      * @return true if it is a folder
      */
     public boolean isFolder() {
-        return mMimeType != null && mMimeType.equals(MimeType.DIRECTORY);
+        return mimeType != null && mimeType.equals(MimeType.DIRECTORY);
     }
 
 
@@ -271,7 +252,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      * @return OCFile this file
      */
     public OCFile setFolder() {
-        setMimetype(MimeType.DIRECTORY);
+        setMimeType(MimeType.DIRECTORY);
         return this;
     }
 
@@ -290,8 +271,8 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      * @return true if it is
      */
     public boolean existsOnDevice() {
-        if (mLocalPath != null && mLocalPath.length() > 0) {
-            return new File(mLocalPath).exists();
+        if (localPath != null && localPath.length() > 0) {
+            return new File(localPath).exists();
         }
         return false;
     }
@@ -302,7 +283,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      * @return The local path to the file
      */
     public String getStoragePath() {
-        return mLocalPath;
+        return localPath;
     }
 
     /**
@@ -311,44 +292,44 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      * @return A URI to the local copy of the file, or NULL if not stored in the device
      */
     public Uri getStorageUri() {
-        if (mLocalPath == null || mLocalPath.length() == 0) {
+        if (localPath == null || localPath.length() == 0) {
             return null;
         }
-        if (mLocalUri == null) {
+        if (localUri == null) {
             Uri.Builder builder = new Uri.Builder();
             builder.scheme(ContentResolver.SCHEME_FILE);
-            builder.path(mLocalPath);
-            mLocalUri = builder.build();
+            builder.path(localPath);
+            localUri = builder.build();
         }
-        return mLocalUri;
+        return localUri;
     }
 
 
     public Uri getLegacyExposedFileUri(Context context) {
-        if (mLocalPath == null || mLocalPath.length() == 0) {
+        if (localPath == null || localPath.length() == 0) {
             return null;
         }
 
-        if (mExposedFileUri == null) {
-            return Uri.parse(ContentResolver.SCHEME_FILE + "://" + WebdavUtils.encodePath(mLocalPath));
+        if (exposedFileUri == null) {
+            return Uri.parse(ContentResolver.SCHEME_FILE + "://" + WebdavUtils.encodePath(localPath));
         }
 
-        return mExposedFileUri;
+        return exposedFileUri;
 
     }
     /*
         Partly disabled because not all apps understand paths that we get via this method for now
      */
     public Uri getExposedFileUri(Context context) {
-        if (mLocalPath == null || mLocalPath.length() == 0) {
+        if (localPath == null || localPath.length() == 0) {
             return null;
         }
-        if (mExposedFileUri == null) {
+        if (exposedFileUri == null) {
             try {
-                mExposedFileUri = FileProvider.getUriForFile(
+                exposedFileUri = FileProvider.getUriForFile(
                         context,
                         context.getString(R.string.file_provider_authority),
-                        new File(mLocalPath));
+                        new File(localPath));
             } catch (IllegalArgumentException ex) {
                 // Could not share file using FileProvider URI scheme.
                 // Fall back to legacy URI parsing.
@@ -356,7 +337,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
             }
         }
 
-        return mExposedFileUri;
+        return exposedFileUri;
     }
 
     /**
@@ -365,82 +346,18 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      * @param storage_path to set
      */
     public void setStoragePath(String storage_path) {
-        mLocalPath = storage_path;
-        mLocalUri = null;
-        mExposedFileUri = null;
-    }
-
-    /**
-     * Get a UNIX timestamp of the file creation time
-     *
-     * @return A UNIX timestamp of the time that file was created
-     */
-    public long getCreationTimestamp() {
-        return mCreationTimestamp;
-    }
-
-    /**
-     * Set a UNIX timestamp of the time the file was created
-     *
-     * @param creation_timestamp to set
-     */
-    public void setCreationTimestamp(long creation_timestamp) {
-        mCreationTimestamp = creation_timestamp;
-    }
-
-    /**
-     * Get a UNIX timestamp of the file modification time.
-     *
-     * @return A UNIX timestamp of the modification time, corresponding to the value returned by the server
-     * in the last synchronization of the properties of this file.
-     */
-    public long getModificationTimestamp() {
-        return mModifiedTimestamp;
-    }
-
-    /**
-     * Set a UNIX timestamp of the time the time the file was modified.
-     * <p/>
-     * To update with the value returned by the server in every synchronization of the properties
-     * of this file.
-     *
-     * @param modification_timestamp to set
-     */
-    public void setModificationTimestamp(long modification_timestamp) {
-        mModifiedTimestamp = modification_timestamp;
-    }
-
-
-    /**
-     * Get a UNIX timestamp of the file modification time.
-     *
-     * @return A UNIX timestamp of the modification time, corresponding to the value returned by the server
-     * in the last synchronization of THE CONTENTS of this file.
-     */
-    public long getModificationTimestampAtLastSyncForData() {
-        return mModifiedTimestampAtLastSyncForData;
+        localPath = storage_path;
+        localUri = null;
+        exposedFileUri = null;
     }
 
-    /**
-     * Set a UNIX timestamp of the time the time the file was modified.
-     * <p/>
-     * To update with the value returned by the server in every synchronization of THE CONTENTS
-     * of this file.
-     *
-     * @param modificationTimestamp to set
-     */
-    public void setModificationTimestampAtLastSyncForData(long modificationTimestamp) {
-        mModifiedTimestampAtLastSyncForData = modificationTimestamp;
-    }
-
-
     /**
      * Returns the filename and "/" for the root directory
      *
      * @return The name of the file
      */
     public String getFileName() {
-        File f = new File(mRemotePath);
+        File f = new File(remotePath);
         return f.getName().length() == 0 ? ROOT_PATH : f.getName();
     }
 
@@ -451,121 +368,49 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
      * directory
      */
     public void setFileName(String name) {
-        Log_OC.d(TAG, "OCFile name changing from " + mRemotePath);
+        Log_OC.d(TAG, "OCFile name changing from " + remotePath);
         if (name != null && name.length() > 0 && !name.contains(PATH_SEPARATOR) &&
-                !mRemotePath.equals(ROOT_PATH)) {
+                !remotePath.equals(ROOT_PATH)) {
             String parent = new File(this.getRemotePath()).getParent();
             parent = parent.endsWith(PATH_SEPARATOR) ? parent : parent + PATH_SEPARATOR;
-            mRemotePath = parent + name;
+            remotePath = parent + name;
             if (isFolder()) {
-                mRemotePath += PATH_SEPARATOR;
+                remotePath += PATH_SEPARATOR;
             }
-            Log_OC.d(TAG, "OCFile name changed to " + mRemotePath);
+            Log_OC.d(TAG, "OCFile name changed to " + remotePath);
         }
     }
 
-    public void setEncryptedFileName(String name) {
-        mEncryptedFileName = name;
-    }
-
-    public String getEncryptedFileName() {
-        return mEncryptedFileName;
-    }
-
-    /**
-     * Can be used to get the MimeType
-     *
-     * @return the MimeType as a String
-     */
-    @Override
-    public String getMimeType() {
-        return mMimeType;
-    }
-
     /**
      * Used internally. Reset all file properties
      */
     private void resetData() {
-        mId = -1;
-        mRemotePath = null;
-        mParentId = 0;
-        mLocalPath = null;
-        mMimeType = null;
-        mLength = 0;
-        mCreationTimestamp = 0;
-        mModifiedTimestamp = 0;
-        mModifiedTimestampAtLastSyncForData = 0;
-        mLastSyncDateForProperties = 0;
-        mLastSyncDateForData = 0;
-        mAvailableOffline = false;
-        mNeedsUpdating = false;
-        mEtag = null;
-        mShareByLink = false;
-        mPublicLink = null;
-        mPermissions = null;
-        mRemoteId = null;
-        mNeedsUpdateThumbnail = false;
-        mIsDownloading = false;
-        mEtagInConflict = null;
-        mShareWithSharee = false;
-        mIsFavorite = false;
-        mIsEncrypted = false;
-        mEncryptedFileName = null;
-        mMountType = WebdavEntry.MountType.INTERNAL;
-    }
-
-    /**
-     * Sets the ID of the file
-     *
-     * @param file_id to set
-     */
-    public void setFileId(long file_id) {
-        mId = file_id;
-    }
-
-    /**
-     * Sets the Mime-Type of the
-     *
-     * @param mimetype to set
-     */
-    public void setMimetype(String mimetype) {
-        mMimeType = mimetype;
-    }
-
-    /**
-     * Sets the ID of the parent folder
-     *
-     * @param parent_id to set
-     */
-    public void setParentId(long parent_id) {
-        mParentId = parent_id;
-    }
-
-    /**
-     * Sets the file size in bytes
-     *
-     * @param file_len to set
-     */
-    public void setFileLength(long file_len) {
-        mLength = file_len;
-    }
-
-    /**
-     * Returns the size of the file in bytes
-     *
-     * @return The filesize in bytes
-     */
-    public long getFileLength() {
-        return mLength;
-    }
-
-    /**
-     * Returns the ID of the parent Folder
-     *
-     * @return The ID
-     */
-    public long getParentId() {
-        return mParentId;
+        fileId = -1;
+        remotePath = null;
+        parentId = 0;
+        localPath = null;
+        mimeType = null;
+        fileLength = 0;
+        creationTimestamp = 0;
+        modificationTimestamp = 0;
+        modificationTimestampAtLastSyncForData = 0;
+        lastSyncDateForProperties = 0;
+        lastSyncDateForData = 0;
+        availableOffline = false;
+        needsUpdatingWhileSaving = false;
+        etag = null;
+        sharedViaLink = false;
+        publicLink = null;
+        permissions = null;
+        remoteId = null;
+        needsUpdateThumbnail = false;
+        downloading = false;
+        etagInConflict = null;
+        sharedWithSharee = false;
+        favorite = false;
+        encrypted = false;
+        encryptedFileName = null;
+        mountType = WebdavEntry.MountType.INTERNAL;
     }
 
     /**
@@ -578,47 +423,6 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
         return parentPath.endsWith("/") ? parentPath : parentPath + "/";
     }
 
-    /**
-     * Check, if this file needs updating
-     *
-     * @return
-     */
-    public boolean needsUpdatingWhileSaving() {
-        return mNeedsUpdating;
-    }
-
-    public boolean needsUpdateThumbnail() {
-        return mNeedsUpdateThumbnail;
-    }
-
-    public void setNeedsUpdateThumbnail(boolean needsUpdateThumbnail) {
-        this.mNeedsUpdateThumbnail = needsUpdateThumbnail;
-    }
-
-    public long getLastSyncDateForProperties() {
-        return mLastSyncDateForProperties;
-    }
-
-    public void setLastSyncDateForProperties(long lastSyncDate) {
-        mLastSyncDateForProperties = lastSyncDate;
-    }
-
-    public long getLastSyncDateForData() {
-        return mLastSyncDateForData;
-    }
-
-    public void setLastSyncDateForData(long lastSyncDate) {
-        mLastSyncDateForData = lastSyncDate;
-    }
-
-    public void setAvailableOffline(boolean availableOffline) {
-        mAvailableOffline = availableOffline;
-    }
-
-    public boolean isAvailableOffline() {
-        return mAvailableOffline;
-    }
-
     @Override
     public int describeContents() {
         return super.hashCode();
@@ -647,51 +451,30 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
 
         OCFile ocFile = (OCFile) o;
 
-        return mId == ocFile.mId && mParentId == ocFile.mParentId;
+        return fileId == ocFile.fileId && parentId == ocFile.parentId;
     }
 
     @Override
     public int hashCode() {
-        return 31 * (int) (mId ^ (mId >>> 32)) + (int) (mParentId ^ (mParentId >>> 32));
+        return 31 * (int) (fileId ^ (fileId >>> 32)) + (int) (parentId ^ (parentId >>> 32));
     }
 
     @Override
     public String toString() {
-        String asString = "[id=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s, " +
+        String asString = "[fileId=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s, " +
                 "parentId=%s, availableOffline=%s etag=%s favourite=%s]";
-        return String.format(asString, mId, getFileName(), mMimeType, isDown(),
-                mLocalPath, mRemotePath, mParentId, mAvailableOffline,
-                mEtag, mIsFavorite);
-    }
-
-    public String getEtag() {
-        return mEtag;
+        return String.format(asString, fileId, getFileName(), mimeType, isDown(),
+            localPath, remotePath, parentId, availableOffline,
+            etag, favorite);
     }
 
     public void setEtag(String etag) {
-        this.mEtag = (etag != null ? etag : "");
-    }
-
-
-    public boolean isSharedViaLink() {
-        return mShareByLink;
-    }
-
-    public void setShareViaLink(boolean shareByLink) {
-        this.mShareByLink = shareByLink;
-    }
-
-    public String getPublicLink() {
-        return mPublicLink;
-    }
-
-    public void setPublicLink(String publicLink) {
-        this.mPublicLink = publicLink;
+        this.etag = (etag != null ? etag : "");
     }
 
     public long getLocalModificationTimestamp() {
-        if (mLocalPath != null && mLocalPath.length() > 0) {
-            File f = new File(mLocalPath);
+        if (localPath != null && localPath.length() > 0) {
+            File f = new File(localPath);
             return f.lastModified();
         }
         return 0;
@@ -704,62 +487,17 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
         return getFileName().length() > 0 && getFileName().charAt(0) == '.';
     }
 
-    public String getPermissions() {
-        return mPermissions;
-    }
-
-    public void setPermissions(String permissions) {
-        this.mPermissions = permissions;
-    }
-
     /**
-     * The fileid namespaced by the instance id, globally unique
+     * The unique fileId for the file within the instance
      *
-     * @return globally unique file id: file id + instance id
-     */
-    public String getRemoteId() {
-        return mRemoteId;
-    }
-
-    /**
-     * The unique id for the file within the instance
-     *
-     * @return file id, unique within the instance
+     * @return file fileId, unique within the instance
      */
     public String getLocalId() {
         return getRemoteId().substring(0, 8).replaceAll("^0*", "");
     }
 
-    public void setRemoteId(String remoteId) {
-        this.mRemoteId = remoteId;
-    }
-
-    public boolean isDownloading() {
-        return mIsDownloading;
-    }
-
-    public void setDownloading(boolean isDownloading) {
-        this.mIsDownloading = isDownloading;
-    }
-
-    public String getEtagInConflict() {
-        return mEtagInConflict;
-    }
-
     public boolean isInConflict() {
-        return mEtagInConflict != null && !mEtagInConflict.equals("");
-    }
-
-    public void setEtagInConflict(String etagInConflict) {
-        mEtagInConflict = etagInConflict;
-    }
-
-    public boolean isSharedWithSharee() {
-        return mShareWithSharee;
-    }
-
-    public void setShareWithSharee(boolean shareWithSharee) {
-        this.mShareWithSharee = shareWithSharee;
+        return etagInConflict != null && !etagInConflict.equals("");
     }
 
     public boolean isSharedWithMe() {
@@ -777,14 +515,6 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
         return permissions != null && permissions.contains(PERMISSION_CAN_WRITE);
     }
 
-    public WebdavEntry.MountType getMountType() {
-        return mMountType;
-    }
-
-    public void setMountType(WebdavEntry.MountType mountType) {
-        mMountType = mountType;
-    }
-
     public boolean hasPreview() {
         return mHasPreview;
     }

+ 9 - 9
src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java

@@ -106,7 +106,7 @@ public final class ThumbnailsCacheManager {
 
     private ThumbnailsCacheManager() {
     }
-    
+
     public static class InitDiskCacheTask extends AsyncTask<File, Void, Void> {
         @Override
         protected Void doInBackground(File... params) {
@@ -115,7 +115,7 @@ public final class ThumbnailsCacheManager {
 
                 if (mThumbnailCache == null) {
                     try {
-                        // Check if media is mounted or storage is built-in, if so, 
+                        // Check if media is mounted or storage is built-in, if so,
                         // try and use external cache dir; otherwise use internal cache dir
                         File cacheDir = MainApp.getAppContext().getExternalCacheDir();
 
@@ -184,7 +184,7 @@ public final class ThumbnailsCacheManager {
 
         return thumbnail;
     }
-    
+
     public static void addBitmapToCache(String key, Bitmap bitmap) {
         synchronized (mThumbnailsDiskCacheLock) {
             if (mThumbnailCache != null) {
@@ -265,7 +265,7 @@ public final class ThumbnailsCacheManager {
             thumbnail = getBitmapFromDiskCache(imageKey);
 
             // Not found in disk cache
-            if (thumbnail == null || file.needsUpdateThumbnail()) {
+            if (thumbnail == null || file.isNeedsUpdateThumbnail()) {
                 Point p = getScreenDimension();
                 int pxW = p.x;
                 int pxH = p.y;
@@ -355,7 +355,7 @@ public final class ThumbnailsCacheManager {
                             }
                         }
                     }).start();
-                    
+
                 }
             }
         }
@@ -504,7 +504,7 @@ public final class ThumbnailsCacheManager {
             thumbnail = getBitmapFromDiskCache(imageKey);
 
             // Not found in disk cache
-            if (thumbnail == null || (file instanceof OCFile && ((OCFile) file).needsUpdateThumbnail())) {
+            if (thumbnail == null || (file instanceof OCFile && ((OCFile) file).isNeedsUpdateThumbnail())) {
                 int pxW;
                 int pxH;
                 pxW = pxH = getThumbnailDimension();
@@ -555,7 +555,7 @@ public final class ThumbnailsCacheManager {
                                     uri = mClient.getBaseUri() + "/index.php/apps/files_trashbin/preview?fileId=" +
                                             file.getLocalId() + "&x=" + pxW + "&y=" + pxH;
                                 }
-                                
+
                                 Log_OC.d(TAG, "generate thumbnail: " + file.getFileName() + " URI: " + uri);
                                 getMethod = new GetMethod(uri);
                                 getMethod.setRequestHeader("Cookie",
@@ -865,7 +865,7 @@ public final class ThumbnailsCacheManager {
                     Log_OC.d("Avatar", "URI: " + uri);
                     get = new GetMethod(uri);
 
-                    // only use eTag if available and corresponding avatar is still there 
+                    // only use eTag if available and corresponding avatar is still there
                     // (might be deleted from cache)
                     if (!eTag.isEmpty() && getBitmapFromDiskCache(avatarKey) != null) {
                         get.setRequestHeader("If-None-Match", eTag);
@@ -1166,4 +1166,4 @@ public final class ThumbnailsCacheManager {
             addThumbnailToCache(imageKey, bitmap, file.getStoragePath(), pxW, pxH);
         }
     }
-}
+}

+ 14 - 44
src/main/java/com/owncloud/android/datastorage/StoragePoint.java

@@ -1,4 +1,4 @@
-/**
+/*
  *   Nextcloud Android client application
  *
  *   @author Bartosz Przybylski
@@ -21,9 +21,17 @@
 
 package com.owncloud.android.datastorage;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
 /**
  * @author Bartosz Przybylski
  */
+@Getter @Setter
+@NoArgsConstructor
+@AllArgsConstructor
 public class StoragePoint implements Comparable<StoragePoint> {
     public enum StorageType {
         INTERNAL, EXTERNAL
@@ -33,51 +41,13 @@ public class StoragePoint implements Comparable<StoragePoint> {
         PRIVATE, PUBLIC
     }
 
-    private String mDescription;
-    private String mPath;
-    private StorageType mStorageType;
-    private PrivacyType mPrivacyType;
-
-    public StoragePoint() {
-    }
-
-    public StoragePoint(String mDescription, String mPath, StorageType mStorageType, PrivacyType privacyType) {
-        this.mDescription = mDescription;
-        this.mPath = mPath;
-        this.mStorageType = mStorageType;
-        this.mPrivacyType = privacyType;
-    }
-
-    public StorageType getStorageType() {
-        return mStorageType;
-    }
-
-    public PrivacyType getPrivacyType() {
-        return mPrivacyType;
-    }
-    public String getPath() { return mPath; }
-    public String getDescription() { return mDescription; }
-
-    public void setDescription(String description) {
-        this.mDescription = description;
-    }
-
-    public void setPath(String path) {
-        this.mPath = path;
-    }
-
-    public void setStorageType(StorageType storageType) {
-        this.mStorageType = storageType;
-    }
-
-    public void setPrivacyType(PrivacyType privacyType) {
-        this.mPrivacyType = privacyType;
-    }
+    private String description;
+    private String path;
+    private StorageType storageType;
+    private PrivacyType privacyType;
 
     @Override
     public int compareTo(StoragePoint another) {
-        return mPath.compareTo(another.getPath());
+        return path.compareTo(another.getPath());
     }
-
-
 }

+ 31 - 199
src/main/java/com/owncloud/android/db/OCUpload.java

@@ -39,6 +39,9 @@ import com.owncloud.android.utils.MimeTypeUtil;
 
 import java.io.File;
 
+import lombok.Getter;
+import lombok.Setter;
+
 /**
  * Stores all information in order to start upload operations. PersistentUploadObject can
  * be stored persistently by {@link UploadsStorageManager}.
@@ -47,85 +50,85 @@ public class OCUpload implements Parcelable {
 
     private static final String TAG = OCUpload.class.getSimpleName();
 
-    private long id;
+    @Getter @Setter private long uploadId;
 
     /**
      * Absolute path in the local file system to the file to be uploaded.
      */
-    private String localPath;
+    @Getter @Setter private String localPath;
 
     /**
      * Absolute path in the remote account to set to the uploaded file (not for its parent folder!)
      */
-    private String remotePath;
+    @Getter @Setter private String remotePath;
 
     /**
      * Name of Owncloud account to upload file to.
      */
-    private String accountName;
+    @Getter private String accountName;
 
     /**
      * File size.
      */
-    private long fileSize;
+    @Getter @Setter private long fileSize;
 
     /**
      * Local action for upload. (0 - COPY, 1 - MOVE, 2 - FORGET)
      */
-    private int localAction;
+    @Getter @Setter private int localAction;
 
     /**
      * Overwrite destination file?
      */
-    private boolean forceOverwrite;
+    @Getter @Setter private boolean forceOverwrite;
 
     /**
      * Create destination folder?
      */
-    private boolean createRemoteFolder;
+    @Getter @Setter private boolean createRemoteFolder;
 
     /**
      * Status of upload (later, in_progress, ...).
      */
-    private UploadStatus uploadStatus;
+    @Getter private UploadStatus uploadStatus;
 
     /**
      * Result from last upload operation. Can be null.
      */
-    private UploadResult lastResult;
+    @Getter private UploadResult lastResult;
 
     /**
      * Defines the origin of the upload; see constants CREATED_ in {@link UploadFileOperation}
      */
-    private int createdBy;
+    @Getter @Setter private int createdBy;
 
     /**
      * When the upload ended
      */
-    private long uploadEndTimeStamp;
+    @Getter @Setter private long uploadEndTimestamp;
 
     /**
      * Upload only via wifi?
      */
-    private boolean useWifiOnly;
+    @Getter @Setter private boolean useWifiOnly;
 
     /**
      * Upload only if phone being charged?
      */
-    private boolean whileChargingOnly;
+    @Getter @Setter private boolean whileChargingOnly;
 
     /**
      * Token to unlock E2E folder
      */
-    private String folderUnlockToken;
+    @Getter @Setter private String folderUnlockToken;
 
     /**
      * temporary values, used for sorting
      */
-    private UploadStatus fixedUploadStatus;
-    private boolean fixedUploadingNow;
-    private long fixedUploadEndTimeStamp;
-    private long fixedId;
+    @Getter private UploadStatus fixedUploadStatus;
+    @Getter private boolean fixedUploadingNow;
+    @Getter private long fixedUploadEndTimeStamp;
+    @Getter private long fixedUploadId;
 
     /**
      * Main constructor.
@@ -168,7 +171,7 @@ public class OCUpload implements Parcelable {
         localPath = "";
         accountName = "";
         fileSize = -1;
-        id = -1;
+        uploadId = -1;
         localAction = FileUploader.LOCAL_BEHAVIOUR_COPY;
         forceOverwrite = false;
         createRemoteFolder = false;
@@ -183,26 +186,11 @@ public class OCUpload implements Parcelable {
     public void setDataFixed(FileUploader.FileUploaderBinder binder) {
         fixedUploadStatus = uploadStatus;
         fixedUploadingNow = binder != null && binder.isUploadingNow(this);
-        fixedUploadEndTimeStamp = uploadEndTimeStamp;
-        fixedId = id;
-    }
-
-    // Getters & Setters
-    public void setUploadId(long id) {
-        this.id = id;
-    }
-
-    public long getUploadId() {
-        return id;
-    }
-
-    /**
-     * @return the uploadStatus
-     */
-    public UploadStatus getUploadStatus() {
-        return uploadStatus;
+        fixedUploadEndTimeStamp = uploadEndTimestamp;
+        fixedUploadId = uploadId;
     }
 
+    // custom Getters & Setters
     /**
      * Sets uploadStatus AND SETS lastResult = null;
      * @param uploadStatus the uploadStatus to set
@@ -212,13 +200,6 @@ public class OCUpload implements Parcelable {
         setLastResult(UploadResult.UNKNOWN);
     }
 
-    /**
-     * @return the lastResult
-     */
-    public UploadResult getLastResult() {
-        return lastResult;
-    }
-
     /**
      * @param lastResult the lastResult to set
      */
@@ -226,44 +207,6 @@ public class OCUpload implements Parcelable {
         this.lastResult = lastResult != null ? lastResult : UploadResult.UNKNOWN;
     }
 
-
-    /**
-     * @return the localPath
-     */
-    public String getLocalPath() {
-        return localPath;
-    }
-
-    public void setLocalPath(String localPath) {
-        this.localPath = localPath;
-    }
-
-    /**
-     * @return the remotePath
-     */
-    public String getRemotePath() {
-        return remotePath;
-    }
-
-    /**
-     * @param remotePath the remotePath
-     */
-    public void setRemotePath(String remotePath) {
-        this.remotePath = remotePath;
-    }
-
-
-    /**
-     * @return File size
-     */
-    public long getFileSize() {
-        return fileSize;
-    }
-
-    public void setFileSize(long fileSize) {
-        this.fileSize = fileSize;
-    }
-
     /**
      * @return the mimeType
      */
@@ -272,77 +215,12 @@ public class OCUpload implements Parcelable {
     }
 
     /**
-     * @return the localAction
-     */
-    public int getLocalAction() {
-        return localAction;
-    }
-
-    /**
-     * @param localAction the localAction to set
-     */
-    public void setLocalAction(int localAction) {
-        this.localAction = localAction;
-    }
-
-    /**
-     * @return the forceOverwrite
-     */
-    public boolean isForceOverwrite() {
-        return forceOverwrite;
-    }
-
-    /**
-     * @param forceOverwrite the forceOverwrite to set
-     */
-    public void setForceOverwrite(boolean forceOverwrite) {
-        this.forceOverwrite = forceOverwrite;
-    }
-
-    /**
-     * @return the isCreateRemoteFolder
-     */
-    public boolean isCreateRemoteFolder() {
-        return createRemoteFolder;
-    }
-
-    /**
-     * @param createRemoteFolder the createRemoteFolder to set
-     */
-    public void setCreateRemoteFolder(boolean createRemoteFolder) {
-        this.createRemoteFolder = createRemoteFolder;
-    }
-
-    /**
-     * @return the accountName
-     */
-    public String getAccountName() {
-        return accountName;
-    }
-
-    /**
-     * Returns owncloud account as {@link Account} object.  
+     * Returns owncloud account as {@link Account} object.
      */
     public Account getAccount(Context context) {
         return AccountUtils.getOwnCloudAccountByName(context, getAccountName());
     }
 
-    public void setCreatedBy(int createdBy) {
-        this.createdBy = createdBy;
-    }
-
-    public int getCreatedBy() {
-        return createdBy;
-    }
-
-    public void setUploadEndTimestamp(long uploadEndTimestamp) {
-        uploadEndTimeStamp = uploadEndTimestamp;
-    }
-
-    public long getUploadEndTimestamp() {
-        return uploadEndTimeStamp;
-    }
-
     /**
      * For debugging purposes only.
      */
@@ -373,36 +251,6 @@ public class OCUpload implements Parcelable {
         }
     };
 
-    /**
-     * @return the isUseWifiOnly
-     */
-    public boolean isUseWifiOnly() {
-        return useWifiOnly;
-    }
-
-    /**
-     * @param useWifiOnly the useWifiOnly to set
-     */
-    public void setUseWifiOnly(boolean useWifiOnly) {
-        this.useWifiOnly = useWifiOnly;
-    }
-
-    public void setWhileChargingOnly(boolean whileChargingOnly) {
-        this.whileChargingOnly = whileChargingOnly;
-    }
-
-    public boolean isWhileChargingOnly() {
-        return whileChargingOnly;
-    }
-
-    public void setFolderUnlockToken(String token) {
-        folderUnlockToken = token;
-    }
-
-    public String getFolderUnlockToken() {
-        return folderUnlockToken;
-    }
-
     /**
      * Reconstruct from parcel
      *
@@ -413,7 +261,7 @@ public class OCUpload implements Parcelable {
     }
 
     private void readFromParcel(Parcel source) {
-        id = source.readLong();
+        uploadId = source.readLong();
         localPath = source.readString();
         remotePath = source.readString();
         accountName = source.readString();
@@ -425,7 +273,7 @@ public class OCUpload implements Parcelable {
         } catch (IllegalArgumentException x) {
             uploadStatus = UploadStatus.UPLOAD_IN_PROGRESS;
         }
-        uploadEndTimeStamp = source.readLong();
+        uploadEndTimestamp = source.readLong();
         try {
             lastResult = UploadResult.valueOf(source.readString());
         } catch (IllegalArgumentException x) {
@@ -444,7 +292,7 @@ public class OCUpload implements Parcelable {
 
     @Override
     public void writeToParcel(Parcel dest, int flags) {
-        dest.writeLong(id);
+        dest.writeLong(uploadId);
         dest.writeString(localPath);
         dest.writeString(remotePath);
         dest.writeString(accountName);
@@ -452,7 +300,7 @@ public class OCUpload implements Parcelable {
         dest.writeInt(forceOverwrite ? 1 : 0);
         dest.writeInt(createRemoteFolder ? 1 : 0);
         dest.writeString(uploadStatus.name());
-        dest.writeLong(uploadEndTimeStamp);
+        dest.writeLong(uploadEndTimestamp);
         dest.writeString(lastResult == null ? "" : lastResult.name());
         dest.writeInt(createdBy);
         dest.writeInt(useWifiOnly ? 1 : 0);
@@ -460,21 +308,5 @@ public class OCUpload implements Parcelable {
         dest.writeString(folderUnlockToken);
     }
 
-    public UploadStatus getFixedUploadStatus() {
-        return fixedUploadStatus;
-    }
-
-    public boolean isFixedUploadingNow() {
-        return fixedUploadingNow;
-    }
-
-    public long getFixedUploadEndTimestamp() {
-        return fixedUploadEndTimeStamp;
-    }
-
-    public Long getFixedUploadId() {
-        return fixedId;
-    }
-
     enum CanUploadFileNowStatus {NOW, LATER, FILE_GONE, ERROR}
 }

+ 5 - 15
src/main/java/com/owncloud/android/features/FeatureItem.java

@@ -27,15 +27,17 @@ import android.os.Parcelable;
 
 import com.owncloud.android.R;
 
+import lombok.Getter;
+
 /**
  * @author Bartosz Przybylski
  * @author Tobias Kaminsky
  */
 public class FeatureItem implements Parcelable {
     private static final int DO_NOT_SHOW = -1;
-    private int image;
-    private int titleText;
-    private int contentText;
+    @Getter private int image;
+    @Getter private int titleText;
+    @Getter private int contentText;
     private boolean contentCentered;
     private boolean bulletList;
 
@@ -51,26 +53,14 @@ public class FeatureItem implements Parcelable {
         return image != DO_NOT_SHOW;
     }
 
-    public int getImage() {
-        return image;
-    }
-
     public boolean shouldShowTitleText() {
         return titleText != DO_NOT_SHOW && titleText != R.string.empty;
     }
 
-    public int getTitleText() {
-        return titleText;
-    }
-
     public boolean shouldShowContentText() {
         return contentText != DO_NOT_SHOW && contentText != R.string.empty;
     }
 
-    public int getContentText() {
-        return contentText;
-    }
-
     public boolean shouldContentCentered() {
         return contentCentered;
     }

+ 3 - 3
src/main/java/com/owncloud/android/files/services/FileDownloader.java

@@ -496,7 +496,7 @@ public class FileDownloader extends Service
         file.setModificationTimestamp(mCurrentDownload.getModificationTimestamp());
         file.setModificationTimestampAtLastSyncForData(mCurrentDownload.getModificationTimestamp());
         file.setEtag(mCurrentDownload.getEtag());
-        file.setMimetype(mCurrentDownload.getMimeType());
+        file.setMimeType(mCurrentDownload.getMimeType());
         file.setStoragePath(mCurrentDownload.getSavePath());
         file.setFileLength(new File(mCurrentDownload.getSavePath()).length());
         file.setRemoteId(mCurrentDownload.getFile().getRemoteId());
@@ -528,7 +528,7 @@ public class FileDownloader extends Service
         if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
             mNotificationBuilder.setChannelId(NotificationUtils.NOTIFICATION_CHANNEL_DOWNLOAD);
         }
-        
+
         /// includes a pending intent in the notification showing the details view of the file
         Intent showDetailsIntent = null;
         if (PreviewImageFragment.canBePreviewed(download.getFile())) {
@@ -569,7 +569,7 @@ public class FileDownloader extends Service
             if (mNotificationManager == null) {
                 mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
             }
-            
+
             if (mNotificationManager != null) {
                 mNotificationManager.notify(R.string.downloader_download_in_progress_ticker,
                         mNotificationBuilder.build());

+ 8 - 8
src/main/java/com/owncloud/android/operations/CreateFolderOperation.java

@@ -40,16 +40,16 @@ import com.owncloud.android.utils.MimeType;
  * Save the new folder in Database
  */
 public class CreateFolderOperation extends SyncOperation implements OnRemoteOperationListener{
-    
+
     private static final String TAG = CreateFolderOperation.class.getSimpleName();
-    
+
     protected String mRemotePath;
     private boolean mCreateFullPath;
     private RemoteFile createdRemoteFolder;
 
     /**
      * Constructor
-     * 
+     *
      * @param createFullPath        'True' means that all the ancestor folders should be created
      *                              if don't exist yet.
      */
@@ -63,7 +63,7 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper
     protected RemoteOperationResult run(OwnCloudClient client) {
         CreateRemoteFolderOperation operation = new CreateRemoteFolderOperation(mRemotePath, mCreateFullPath);
         RemoteOperationResult result = operation.execute(client, true);
-        
+
         if (result.isSuccess()) {
             ReadRemoteFolderOperation remoteFolderOperation = new ReadRemoteFolderOperation(mRemotePath);
             RemoteOperationResult remoteFolderOperationResult = remoteFolderOperation.execute(client, true);
@@ -73,7 +73,7 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper
         } else {
             Log_OC.e(TAG, mRemotePath + " hasn't been created");
         }
-        
+
         return result;
     }
 
@@ -83,7 +83,7 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper
             onCreateRemoteFolderOperationFinish(result);
         }
     }
-    
+
     private void onCreateRemoteFolderOperationFinish(RemoteOperationResult result) {
        if (result.isSuccess()) {
            saveFolderInDB();
@@ -99,7 +99,7 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper
         if (mCreateFullPath && getStorageManager().
                 getFileByPath(FileStorageUtils.getParentPath(mRemotePath)) == null){// When parent
                                                                                     // of remote path
-                                                                                    // is not created 
+                                                                                    // is not created
             String[] subFolders = mRemotePath.split("/");
             String composedRemotePath = "/";
 
@@ -113,7 +113,7 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper
             }
         } else { // Create directory on DB
             OCFile newDir = new OCFile(mRemotePath);
-            newDir.setMimetype(MimeType.DIRECTORY);
+            newDir.setMimeType(MimeType.DIRECTORY);
             long parentId = getStorageManager().getFileByPath(FileStorageUtils.getParentPath(mRemotePath)).getFileId();
             newDir.setParentId(parentId);
             newDir.setRemoteId(createdRemoteFolder.getRemoteId());

+ 5 - 5
src/main/java/com/owncloud/android/operations/CreateShareViaLinkOperation.java

@@ -89,7 +89,7 @@ public class CreateShareViaLinkOperation extends SyncOperation {
             createOp.setGetShareDetails(true);
             result = createOp.execute(client);
         }
-        
+
         if (result.isSuccess()) {
             if (result.getData().size() > 0) {
                 Object item = result.getData().get(0);
@@ -106,10 +106,10 @@ public class CreateShareViaLinkOperation extends SyncOperation {
                 result = new RemoteOperationResult(RemoteOperationResult.ResultCode.SHARE_NOT_FOUND);
             }
         }
-        
+
         return result;
     }
-    
+
     public String getPath() {
         return mPath;
     }
@@ -128,12 +128,12 @@ public class CreateShareViaLinkOperation extends SyncOperation {
         }
 
         getStorageManager().saveShare(share);
-        
+
         // Update OCFile with data from share: ShareByLink  and publicLink
         OCFile file = getStorageManager().getFileByPath(mPath);
         if (file!=null) {
             file.setPublicLink(share.getShareLink());
-            file.setShareViaLink(true);
+            file.setSharedViaLink(true);
             getStorageManager().saveFile(file);
         }
     }

+ 5 - 6
src/main/java/com/owncloud/android/operations/CreateShareWithShareeOperation.java

@@ -84,15 +84,15 @@ public class CreateShareWithShareeOperation extends SyncOperation {
         operation.setGetShareDetails(true);
         RemoteOperationResult result = operation.execute(client);
 
-        
+
         if (result.isSuccess() && result.getData().size() > 0) {
             OCShare share = (OCShare) result.getData().get(0);
             updateData(share);
         }
-        
+
         return result;
     }
-    
+
     public String getPath() {
         return mPath;
     }
@@ -103,13 +103,12 @@ public class CreateShareWithShareeOperation extends SyncOperation {
         share.setIsFolder(mPath.endsWith(FileUtils.PATH_SEPARATOR));
 
         getStorageManager().saveShare(share);
-        
+
         // Update OCFile with data from share: ShareByLink  and publicLink
         OCFile file = getStorageManager().getFileByPath(mPath);
         if (file!=null) {
-            file.setShareWithSharee(true);    // TODO - this should be done by the FileContentProvider, as part of getStorageManager().saveShare(share)
+            file.setSharedWithSharee(true);    // TODO - this should be done by the FileContentProvider, as part of getStorageManager().saveShare(share)
             getStorageManager().saveFile(file);
         }
     }
-
 }

+ 20 - 20
src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java

@@ -54,10 +54,10 @@ import java.util.Vector;
 
 
 /**
- *  Remote operation performing the synchronization of the list of files contained 
+ *  Remote operation performing the synchronization of the list of files contained
  *  in a folder identified with its remote path.
  *
- *  Fetches the list and properties of the files contained in the given folder, including their 
+ *  Fetches the list and properties of the files contained in the given folder, including their
  *  properties, and updates the local database with them.
  *
  *  Does NOT enter in the child folders to synchronize their contents also.
@@ -97,8 +97,8 @@ public class RefreshFolderOperation extends RemoteOperation {
     private int mFailsInKeptInSyncFound;
 
     /**
-     * Map of remote and local paths to files that where locally stored in a location 
-     * out of the ownCloud folder and couldn't be copied automatically into it 
+     * Map of remote and local paths to files that where locally stored in a location
+     * out of the ownCloud folder and couldn't be copied automatically into it
      **/
     private Map<String, String> mForgottenLocalFiles;
 
@@ -122,13 +122,13 @@ public class RefreshFolderOperation extends RemoteOperation {
      *
      * @param   folder                  Folder to synchronize.
      * @param   currentSyncTime         Time stamp for the synchronization process in progress.
-     * @param   syncFullAccount         'True' means that this operation is part of a full account 
+     * @param   syncFullAccount         'True' means that this operation is part of a full account
      *                                  synchronization.
      * @param   ignoreETag              'True' means that the content of the remote folder should
-     *                                  be fetched and updated even though the 'eTag' did not 
-     *                                  change.  
+     *                                  be fetched and updated even though the 'eTag' did not
+     *                                  change.
      * @param   dataStorageManager      Interface with the local database.
-     * @param   account                 ownCloud account where the folder is located. 
+     * @param   account                 ownCloud account where the folder is located.
      * @param   context                 Application context.
      */
     public RefreshFolderOperation(OCFile folder,
@@ -163,7 +163,7 @@ public class RefreshFolderOperation extends RemoteOperation {
     }
 
     /**
-     * Returns the list of files and folders contained in the synchronized folder, 
+     * Returns the list of files and folders contained in the synchronized folder,
      * if called after synchronization is complete.
      *
      * @return List of files and folders contained in the synchronized folder.
@@ -215,7 +215,7 @@ public class RefreshFolderOperation extends RemoteOperation {
         }
 
         if (result.isSuccess() && !mSyncFullAccount) {
-            refreshSharesForFolder(client); // share result is ignored 
+            refreshSharesForFolder(client); // share result is ignored
         }
 
         if (!mSyncFullAccount) {
@@ -262,7 +262,7 @@ public class RefreshFolderOperation extends RemoteOperation {
 
         Log_OC.d(TAG, "Checking changes in " + mAccount.name + remotePath);
 
-        // remote request 
+        // remote request
         ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath);
         result = operation.execute(client, true);
         if (result.isSuccess()) {
@@ -349,7 +349,7 @@ public class RefreshFolderOperation extends RemoteOperation {
         // get 'fresh data' from the database
         mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath());
 
-        // parse data from remote folder 
+        // parse data from remote folder
         OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) folderAndFiles.get(0));
         remoteFolder.setParentId(mLocalFolder.getParentId());
         remoteFolder.setFileId(mLocalFolder.getFileId());
@@ -387,7 +387,7 @@ public class RefreshFolderOperation extends RemoteOperation {
             updatedFile = FileStorageUtils.fillOCFile(r);
             updatedFile.setParentId(mLocalFolder.getFileId());
 
-            // retrieve local data for the read file 
+            // retrieve local data for the read file
             localFile = localFilesMap.remove(remoteFile.getRemotePath());
 
             // add to updatedFile data about LOCAL STATE (not existing in server)
@@ -414,7 +414,7 @@ public class RefreshFolderOperation extends RemoteOperation {
             // we parse content, so either the folder itself or its direct parent (which we check) must be encrypted
             boolean encrypted = updatedFile.isEncrypted() || mLocalFolder.isEncrypted();
             updatedFile.setEncrypted(encrypted);
-            
+
             updatedFiles.add(updatedFile);
         }
 
@@ -444,9 +444,9 @@ public class RefreshFolderOperation extends RemoteOperation {
             updatedFile.setFileName(decryptedFileName);
 
             if (mimetype == null || mimetype.isEmpty()) {
-                updatedFile.setMimetype("application/octet-stream");
+                updatedFile.setMimeType("application/octet-stream");
             } else {
-                updatedFile.setMimetype(mimetype);
+                updatedFile.setMimeType(mimetype);
             }
         } catch (NullPointerException e) {
             Log_OC.e(TAG, "Metadata for file " + updatedFile.getFileId() + " not found!");
@@ -482,8 +482,8 @@ public class RefreshFolderOperation extends RemoteOperation {
             }
 
             updatedFile.setPublicLink(localFile.getPublicLink());
-            updatedFile.setShareViaLink(localFile.isSharedViaLink());
-            updatedFile.setShareWithSharee(localFile.isSharedWithSharee());
+            updatedFile.setSharedViaLink(localFile.isSharedViaLink());
+            updatedFile.setSharedWithSharee(localFile.isSharedWithSharee());
         } else {
             // remote eTag will not be updated unless file CONTENTS are synchronized
             updatedFile.setEtag("");
@@ -509,7 +509,7 @@ public class RefreshFolderOperation extends RemoteOperation {
      * Performs a list of synchronization operations, determining if a download or upload is needed
      * or if exists conflict due to changes both in local and remote contents of the each file.
      *
-     * If download or upload is needed, request the operation to the corresponding service and goes 
+     * If download or upload is needed, request the operation to the corresponding service and goes
      * on.
      *
      * @param filesToSyncContents       Synchronization operations to execute.
@@ -545,7 +545,7 @@ public class RefreshFolderOperation extends RemoteOperation {
     private RemoteOperationResult refreshSharesForFolder(OwnCloudClient client) {
         RemoteOperationResult result;
 
-        // remote request 
+        // remote request
         GetRemoteSharesForFileOperation operation =
                 new GetRemoteSharesForFileOperation(mLocalFolder.getRemotePath(), true, true);
         result = operation.execute(client);

+ 25 - 25
src/main/java/com/owncloud/android/operations/SynchronizeFolderOperation.java

@@ -50,12 +50,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
 
 
 /**
- *  Remote operation performing the synchronization of the list of files contained 
+ *  Remote operation performing the synchronization of the list of files contained
  *  in a folder identified with its remote path.
- *  
- *  Fetches the list and properties of the files contained in the given folder, including their 
+ *
+ *  Fetches the list and properties of the files contained in the given folder, including their
  *  properties, and updates the local database with them.
- *  
+ *
  *  Does NOT enter in the child folders to synchronize their contents also, BUT requests for a new operation instance
  *  doing so.
  */
@@ -68,7 +68,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
 
     /** Remote path of the folder to synchronize */
     private String mRemotePath;
-    
+
     /** Account where the file to synchronize belongs */
     private Account mAccount;
 
@@ -92,9 +92,9 @@ public class SynchronizeFolderOperation extends SyncOperation {
 
     private List<OCFile> mFilesForDirectDownload;
         // to avoid extra PROPFINDs when there was no change in the folder
-    
+
     private List<SyncOperation> mFilesToSyncContents;
-        // this will be used for every file when 'folder synchronization' replaces 'folder download' 
+        // this will be used for every file when 'folder synchronization' replaces 'folder download'
 
     private final AtomicBoolean mCancellationRequested;
 
@@ -137,30 +137,30 @@ public class SynchronizeFolderOperation extends SyncOperation {
         RemoteOperationResult result = null;
         mFailsInFileSyncsFound = 0;
         mConflictsFound = 0;
-        
+
         try {
-            // get locally cached information about folder 
-            mLocalFolder = getStorageManager().getFileByPath(mRemotePath);   
-            
+            // get locally cached information about folder
+            mLocalFolder = getStorageManager().getFileByPath(mRemotePath);
+
             result = checkForChanges(client);
-    
+
             if (result.isSuccess()) {
                 if (mRemoteFolderChanged) {
                     result = fetchAndSyncRemoteFolder(client);
-                    
+
                 } else {
                     prepareOpsFromLocalKnowledge();
                 }
-                
+
                 if (result.isSuccess()) {
                     syncContents();
                 }
             }
-            
+
             if (mCancellationRequested.get()) {
                 throw new OperationCancelledException();
             }
-            
+
         } catch (OperationCancelledException e) {
             result = new RemoteOperationResult(e);
         }
@@ -172,11 +172,11 @@ public class SynchronizeFolderOperation extends SyncOperation {
         Log_OC.d(TAG, "Checking changes in " + mAccount.name + mRemotePath);
 
         mRemoteFolderChanged = true;
-        
+
         if (mCancellationRequested.get()) {
             throw new OperationCancelledException();
         }
-        
+
         // remote request
         ReadRemoteFileOperation operation = new ReadRemoteFileOperation(mRemotePath);
         RemoteOperationResult result = operation.execute(client);
@@ -214,7 +214,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
         if (mCancellationRequested.get()) {
             throw new OperationCancelledException();
         }
-        
+
         ReadRemoteFolderOperation operation = new ReadRemoteFolderOperation(mRemotePath);
         RemoteOperationResult result = operation.execute(client);
         Log_OC.d(TAG, "Synchronizing " + mAccount.name + mRemotePath);
@@ -306,7 +306,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
 
             /// check and fix, if needed, local storage path
             searchForLocalFileInDefaultPath(updatedFile);
-            
+
             /// classify file to sync/download contents later
             classifyFileForLaterSyncOrDownload(remoteFile, localFile);
 
@@ -339,8 +339,8 @@ public class SynchronizeFolderOperation extends SyncOperation {
                 Log.d(TAG, "Image " + remoteFile.getFileName() + " updated on the server");
             }
             updatedFile.setPublicLink(localFile.getPublicLink());
-            updatedFile.setShareViaLink(localFile.isSharedViaLink());
-            updatedFile.setShareWithSharee(localFile.isSharedWithSharee());
+            updatedFile.setSharedViaLink(localFile.isSharedViaLink());
+            updatedFile.setSharedWithSharee(localFile.isSharedWithSharee());
             updatedFile.setEtagInConflict(localFile.getEtagInConflict());
         } else {
             // remote eTag will not be updated unless file CONTENTS are synchronized
@@ -414,7 +414,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
         startContentSynchronizations(mFilesToSyncContents);
     }
 
-    
+
     private void startDirectDownloads() throws OperationCancelledException {
         for (OCFile file : mFilesForDirectDownload) {
             synchronized(mCancellationRequested) {
@@ -473,7 +473,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
      * Scans the default location for saving local copies of files searching for
      * a 'lost' file with the same full name as the {@link com.owncloud.android.datamodel.OCFile}
      * received as parameter.
-     *  
+     *
      * @param file      File to associate a possible 'lost' local file.
      */
     private void searchForLocalFileInDefaultPath(OCFile file) {
@@ -486,7 +486,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
         }
     }
 
-    
+
     /**
      * Cancel operation
      */

+ 6 - 6
src/main/java/com/owncloud/android/operations/UnshareOperation.java

@@ -49,7 +49,7 @@ public class UnshareOperation extends SyncOperation {
     private ShareType mShareType;
     private String mShareWith;
     private Context mContext;
-    
+
     public UnshareOperation(String remotePath, ShareType shareType, String shareWith,
                                 Context context) {
         mRemotePath = remotePath;
@@ -61,11 +61,11 @@ public class UnshareOperation extends SyncOperation {
     @Override
     protected RemoteOperationResult run(OwnCloudClient client) {
         RemoteOperationResult result  = null;
-        
+
         // Get Share for a file
         OCShare share = getStorageManager().getFirstShareByPathAndType(mRemotePath,
                 mShareType, mShareWith);
-        
+
         if (share != null) {
             OCFile file = getStorageManager().getFileByPath(mRemotePath);
             RemoveRemoteShareOperation operation =
@@ -76,7 +76,7 @@ public class UnshareOperation extends SyncOperation {
                 Log_OC.d(TAG, "Share id = " + share.getRemoteId() + " deleted");
 
                 if (ShareType.PUBLIC_LINK.equals(mShareType)) {
-                    file.setShareViaLink(false);
+                    file.setSharedViaLink(false);
                     file.setPublicLink("");
                 } else if (ShareType.USER.equals(mShareType) || ShareType.GROUP.equals(mShareType)
                     || ShareType.FEDERATED.equals(mShareType)){
@@ -85,7 +85,7 @@ public class UnshareOperation extends SyncOperation {
                             getSharesWithForAFile(mRemotePath,
                             getStorageManager().getAccount().name);
                     if (sharesWith.size() == SINGLY_SHARED) {
-                        file.setShareWithSharee(false);
+                        file.setSharedWithSharee(false);
                     }
                 }
 
@@ -103,7 +103,7 @@ public class UnshareOperation extends SyncOperation {
 
         return result;
     }
-    
+
     private boolean existsFile(OwnCloudClient client, String remotePath){
         ExistenceCheckRemoteOperation existsOperation =
                 new ExistenceCheckRemoteOperation(remotePath, mContext, false);

+ 1 - 1
src/main/java/com/owncloud/android/operations/UpdateShareViaLinkOperation.java

@@ -147,7 +147,7 @@ public class UpdateShareViaLinkOperation extends SyncOperation {
         OCFile file = getStorageManager().getFileByPath(mPath);
         if (file != null) {
             file.setPublicLink(share.getShareLink());
-            file.setShareViaLink(true);
+            file.setSharedViaLink(true);
             getStorageManager().saveFile(file);
         }
     }

+ 7 - 7
src/main/java/com/owncloud/android/operations/UploadFileOperation.java

@@ -167,7 +167,7 @@ public class UploadFileOperation extends SyncOperation {
         // are checked when the UploadFileOperation instance is created
 
 
-        newFile.setMimetype(mimeType);
+        newFile.setMimeType(mimeType);
 
         return newFile;
     }
@@ -385,7 +385,7 @@ public class UploadFileOperation extends SyncOperation {
         // parent file is not null anymore:
         // - it was created on fresh upload or
         // - resume of encrypted upload, then parent file exists already as unlock is only for direct parent
-        
+
         mFile.setParentId(parent.getFileId());
 
         // try to unlock folder with stored token, e.g. when upload needs to be resumed or app crashed
@@ -436,7 +436,7 @@ public class UploadFileOperation extends SyncOperation {
         String publicKey = arbitraryDataProvider.getValue(getAccount().name, EncryptionUtils.PUBLIC_KEY);
 
         try {
-            // check conditions 
+            // check conditions
             result = checkConditions(originalFile);
 
             if (result != null) {
@@ -450,7 +450,7 @@ public class UploadFileOperation extends SyncOperation {
 
             if (lockFileOperationResult.isSuccess()) {
                 token = (String) lockFileOperationResult.getData().get(0);
-                // immediately store it 
+                // immediately store it
                 mUpload.setFolderUnlockToken(token);
                 uploadsStorageManager.updateUpload(mUpload);
             } else if (lockFileOperationResult.getHttpCode() == HttpStatus.SC_FORBIDDEN) {
@@ -1027,7 +1027,7 @@ public class UploadFileOperation extends SyncOperation {
         }
         if (parent != null) {
             OCFile createdFolder = new OCFile(remotePath);
-            createdFolder.setMimetype(MimeType.DIRECTORY);
+            createdFolder.setMimeType(MimeType.DIRECTORY);
             createdFolder.setParentId(parent.getFileId());
             getStorageManager().saveFile(createdFolder);
             return createdFolder;
@@ -1047,7 +1047,7 @@ public class UploadFileOperation extends SyncOperation {
         OCFile newFile = new OCFile(newRemotePath);
         newFile.setCreationTimestamp(mFile.getCreationTimestamp());
         newFile.setFileLength(mFile.getFileLength());
-        newFile.setMimetype(mFile.getMimeType());
+        newFile.setMimeType(mFile.getMimeType());
         newFile.setModificationTimestamp(mFile.getModificationTimestamp());
         newFile.setModificationTimestampAtLastSyncForData(
                 mFile.getModificationTimestampAtLastSyncForData()
@@ -1347,7 +1347,7 @@ public class UploadFileOperation extends SyncOperation {
     private void updateOCFile(OCFile file, RemoteFile remoteFile) {
         file.setCreationTimestamp(remoteFile.getCreationTimestamp());
         file.setFileLength(remoteFile.getLength());
-        file.setMimetype(remoteFile.getMimeType());
+        file.setMimeType(remoteFile.getMimeType());
         file.setModificationTimestamp(remoteFile.getModifiedTimestamp());
         file.setModificationTimestampAtLastSyncForData(remoteFile.getModifiedTimestamp());
         file.setEtag(remoteFile.getEtag());

+ 3 - 3
src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java

@@ -388,7 +388,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
                         ThumbnailsCacheManager.PREFIX_THUMBNAIL + file.getRemoteId()
                 );
 
-                if (thumbnail != null && !file.needsUpdateThumbnail()) {
+                if (thumbnail != null && !file.isNeedsUpdateThumbnail()) {
                     if (MimeTypeUtil.isVideo(file)) {
                         Bitmap withOverlay = ThumbnailsCacheManager.addVideoOverlay(thumbnail);
                         thumbnailView.setImageBitmap(withOverlay);
@@ -611,10 +611,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
 
                     ShareType newShareType = ocShare.getShareType();
                     if (newShareType == ShareType.PUBLIC_LINK) {
-                        file.setShareViaLink(true);
+                        file.setSharedViaLink(true);
                     } else if (newShareType == ShareType.USER || newShareType == ShareType.GROUP ||
                             newShareType == ShareType.EMAIL || newShareType == ShareType.FEDERATED) {
-                        file.setShareWithSharee(true);
+                        file.setSharedWithSharee(true);
                     }
 
                     mStorageManager.saveFile(file);

+ 4 - 4
src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java

@@ -298,7 +298,7 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedVie
          */
         OCFile fakeFileToCheatThumbnailsCacheManagerInterface = new OCFile(item.getRemotePath());
         fakeFileToCheatThumbnailsCacheManagerInterface.setStoragePath(item.getLocalPath());
-        fakeFileToCheatThumbnailsCacheManagerInterface.setMimetype(item.getMimeType());
+        fakeFileToCheatThumbnailsCacheManagerInterface.setMimeType(item.getMimeType());
 
         boolean allowedToCreateNewThumbnail = ThumbnailsCacheManager.cancelPotentialThumbnailWork(
                 fakeFileToCheatThumbnailsCacheManagerInterface, itemViewHolder.thumbnail
@@ -312,7 +312,7 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedVie
             Bitmap thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(
                     String.valueOf(fakeFileToCheatThumbnailsCacheManagerInterface.getRemoteId())
             );
-            if (thumbnail != null && !fakeFileToCheatThumbnailsCacheManagerInterface.needsUpdateThumbnail()) {
+            if (thumbnail != null && !fakeFileToCheatThumbnailsCacheManagerInterface.isNeedsUpdateThumbnail()) {
                 itemViewHolder.thumbnail.setImageBitmap(thumbnail);
             } else {
                 // generate new Thumbnail
@@ -649,7 +649,7 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedVie
                 } else if (upload2.getFixedUploadStatus().equals(UploadStatus.UPLOAD_IN_PROGRESS)) {
                     return 1;
                 }
-                if (upload1.getFixedUploadEndTimestamp() == 0 || upload2.getFixedUploadEndTimestamp() == 0) {
+                if (upload1.getFixedUploadEndTimeStamp() == 0 || upload2.getFixedUploadEndTimeStamp() == 0) {
                     return compareUploadId(upload1, upload2);
                 } else {
                     return compareUpdateTime(upload1, upload2);
@@ -663,7 +663,7 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedVie
 
             @SuppressFBWarnings("Bx")
             private int compareUpdateTime(OCUpload upload1, OCUpload upload2) {
-                return Long.valueOf(upload2.getFixedUploadEndTimestamp()).compareTo(upload1.getFixedUploadEndTimestamp());
+                return Long.valueOf(upload2.getFixedUploadEndTimeStamp()).compareTo(upload1.getFixedUploadEndTimeStamp());
             }
         };
     }

+ 2 - 2
src/main/java/com/owncloud/android/ui/adapter/UploaderAdapter.java

@@ -43,7 +43,7 @@ import java.util.List;
 import java.util.Map;
 
 public class UploaderAdapter extends SimpleAdapter {
-    
+
     private Context mContext;
     private Account mAccount;
     private FileDataStorageManager mStorageManager;
@@ -102,7 +102,7 @@ public class UploaderAdapter extends SimpleAdapter {
                 Bitmap thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(
                         String.valueOf(file.getRemoteId())
                 );
-                if (thumbnail != null && !file.needsUpdateThumbnail()) {
+                if (thumbnail != null && !file.isNeedsUpdateThumbnail()) {
                     fileIcon.setImageBitmap(thumbnail);
                 } else {
                     // generate new Thumbnail

+ 1 - 1
src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java

@@ -560,7 +560,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
             String tagId = String.valueOf(ThumbnailsCacheManager.PREFIX_RESIZED_IMAGE + getFile().getRemoteId());
             resizedImage = ThumbnailsCacheManager.getBitmapFromDiskCache(tagId);
 
-            if (resizedImage != null && !file.needsUpdateThumbnail()) {
+            if (resizedImage != null && !file.isNeedsUpdateThumbnail()) {
                 activity.setPreviewImageBitmap(resizedImage);
                 activatePreviewImage();
                 previewLoaded = true;

+ 2 - 2
src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java

@@ -227,7 +227,7 @@ public class PreviewImageFragment extends FileFragment {
                 Bitmap resizedImage = ThumbnailsCacheManager.getBitmapFromDiskCache(
                         String.valueOf(ThumbnailsCacheManager.PREFIX_RESIZED_IMAGE + getFile().getRemoteId()));
 
-                if (resizedImage != null && !getFile().needsUpdateThumbnail()) {
+                if (resizedImage != null && !getFile().isNeedsUpdateThumbnail()) {
                     mImageView.setImageBitmap(resizedImage);
                     mImageView.setVisibility(View.VISIBLE);
                     mBitmap = resizedImage;
@@ -320,7 +320,7 @@ public class PreviewImageFragment extends FileFragment {
             mf.filter(menu, true);
         }
 
-        // additional restriction for this fragment 
+        // additional restriction for this fragment
         // TODO allow renaming in PreviewImageFragment
         // TODO allow refresh file in PreviewImageFragment
         FileMenuFilter.hideMenuItems(

+ 1 - 1
src/main/java/com/owncloud/android/utils/FileStorageUtils.java

@@ -167,7 +167,7 @@ public final class FileStorageUtils {
         } else {
             file.setFileLength(remote.getLength());
         }
-        file.setMimetype(remote.getMimeType());
+        file.setMimeType(remote.getMimeType());
         file.setModificationTimestamp(remote.getModifiedTimestamp());
         file.setEtag(remote.getEtag());
         file.setPermissions(remote.getPermissions());