X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/c963eb0fad38ec71f511de231bd81deadecc70fb..afaa2879d192be067cae523b51dad75d89a6c6cb:/src/com/owncloud/android/operations/DownloadFileOperation.java diff --git a/src/com/owncloud/android/operations/DownloadFileOperation.java b/src/com/owncloud/android/operations/DownloadFileOperation.java index 78811f8b..0cb303ce 100644 --- a/src/com/owncloud/android/operations/DownloadFileOperation.java +++ b/src/com/owncloud/android/operations/DownloadFileOperation.java @@ -27,6 +27,7 @@ import java.util.Iterator; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; +import com.owncloud.android.MainApp; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.common.network.OnDatatransferProgressListener; import com.owncloud.android.lib.common.OwnCloudClient; @@ -58,9 +59,11 @@ public class DownloadFileOperation extends RemoteOperation { public DownloadFileOperation(Account account, OCFile file) { if (account == null) - throw new IllegalArgumentException("Illegal null account in DownloadFileOperation creation"); + throw new IllegalArgumentException("Illegal null account in DownloadFileOperation " + + "creation"); if (file == null) - throw new IllegalArgumentException("Illegal null file in DownloadFileOperation creation"); + throw new IllegalArgumentException("Illegal null file in DownloadFileOperation " + + "creation"); mAccount = account; mFile = file; @@ -77,7 +80,7 @@ public class DownloadFileOperation extends RemoteOperation { } public String getSavePath() { - String path = mFile.getStoragePath(); // re-downloads should be done over the original file + String path = mFile.getStoragePath(); // re-downloads should be done over the original file if (path != null && path.length() > 0) { return path; } @@ -102,9 +105,11 @@ public class DownloadFileOperation extends RemoteOperation { try { mimeType = MimeTypeMap.getSingleton() .getMimeTypeFromExtension( - mFile.getRemotePath().substring(mFile.getRemotePath().lastIndexOf('.') + 1)); + mFile.getRemotePath().substring( + mFile.getRemotePath().lastIndexOf('.') + 1)); } catch (IndexOutOfBoundsException e) { - Log_OC.e(TAG, "Trying to find out MIME type of a file without extension: " + mFile.getRemotePath()); + Log_OC.e(TAG, "Trying to find out MIME type of a file without extension: " + + mFile.getRemotePath()); } } if (mimeType == null) { @@ -118,7 +123,8 @@ public class DownloadFileOperation extends RemoteOperation { } public long getModificationTimestamp() { - return (mModificationTimestamp > 0) ? mModificationTimestamp : mFile.getModificationTimestamp(); + return (mModificationTimestamp > 0) ? mModificationTimestamp : + mFile.getModificationTimestamp(); } @Override @@ -152,9 +158,11 @@ public class DownloadFileOperation extends RemoteOperation { newFile.getParentFile().mkdirs(); moved = tmpFile.renameTo(newFile); if (!moved) - result = new RemoteOperationResult(RemoteOperationResult.ResultCode.LOCAL_STORAGE_NOT_MOVED); + result = new RemoteOperationResult( + RemoteOperationResult.ResultCode.LOCAL_STORAGE_NOT_MOVED); } - Log_OC.i(TAG, "Download of " + mFile.getRemotePath() + " to " + getSavePath() + ": " + result.getLogMessage()); + Log_OC.i(TAG, "Download of " + mFile.getRemotePath() + " to " + getSavePath() + ": " + + result.getLogMessage()); return result; }