projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed ClassCastException in FileUploader
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
files
/
services
/
FileUploader.java
diff --git
a/src/com/owncloud/android/files/services/FileUploader.java
b/src/com/owncloud/android/files/services/FileUploader.java
index
f776768
..
8107eb5
100644
(file)
--- a/
src/com/owncloud/android/files/services/FileUploader.java
+++ b/
src/com/owncloud/android/files/services/FileUploader.java
@@
-35,9
+35,7
@@
import com.owncloud.android.authenticator.AccountAuthenticator;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.InstantUploadBroadcastReceiver;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.InstantUploadBroadcastReceiver;
-import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.operations.ChunkedUploadFileOperation;
import com.owncloud.android.operations.ChunkedUploadFileOperation;
-import com.owncloud.android.operations.DownloadFileOperation;
import com.owncloud.android.operations.RemoteOperationResult;
import com.owncloud.android.operations.UploadFileOperation;
import com.owncloud.android.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.operations.RemoteOperationResult;
import com.owncloud.android.operations.UploadFileOperation;
import com.owncloud.android.operations.RemoteOperationResult.ResultCode;
@@
-121,8
+119,8
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
/**
* Builds a key for mPendingUploads from the account and file to upload
*
/**
* Builds a key for mPendingUploads from the account and file to upload
*
- * @param account Account where the file to
down
load is stored
- * @param file File to
down
load
+ * @param account Account where the file to
up
load is stored
+ * @param file File to
up
load
*/
private String buildRemoteName(Account account, OCFile file) {
return account.name + file.getRemotePath();
*/
private String buildRemoteName(Account account, OCFile file) {
return account.name + file.getRemotePath();
@@
-301,7
+299,7
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
*/
@Override
public boolean onUnbind(Intent intent) {
*/
@Override
public boolean onUnbind(Intent intent) {
- ((File
Down
loaderBinder)mBinder).clearListeners();
+ ((File
Up
loaderBinder)mBinder).clearListeners();
return false; // not accepting rebinding (default behaviour)
}
return false; // not accepting rebinding (default behaviour)
}
@@
-314,7
+312,7
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
public class FileUploaderBinder extends Binder implements OnDatatransferProgressListener {
/**
public class FileUploaderBinder extends Binder implements OnDatatransferProgressListener {
/**
- * Map of listeners that will be reported about progress of uploads from a {@link File
Down
loaderBinder} instance
+ * Map of listeners that will be reported about progress of uploads from a {@link File
Up
loaderBinder} instance
*/
private Map<String, OnDatatransferProgressListener> mBoundListeners = new HashMap<String, OnDatatransferProgressListener>();
*/
private Map<String, OnDatatransferProgressListener> mBoundListeners = new HashMap<String, OnDatatransferProgressListener>();
@@
-346,7
+344,7
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
/**
* Returns True when the file described by 'file' is being uploaded to the ownCloud account 'account' or waiting for it
*
/**
* Returns True when the file described by 'file' is being uploaded to the ownCloud account 'account' or waiting for it
*
- * If 'file' is a directory, returns 'true' if some of its descendant files is
downloading or waiting to down
load.
+ * If 'file' is a directory, returns 'true' if some of its descendant files is
uploading or waiting to up
load.
*
* @param account Owncloud account where the remote file will be stored.
* @param file A file that could be in the queue of pending uploads
*
* @param account Owncloud account where the remote file will be stored.
* @param file A file that could be in the queue of pending uploads
@@
-356,7
+354,7
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
String targetKey = buildRemoteName(account, file);
synchronized (mPendingUploads) {
if (file.isDirectory()) {
String targetKey = buildRemoteName(account, file);
synchronized (mPendingUploads) {
if (file.isDirectory()) {
- // this can be slow if there are many
down
loads :(
+ // this can be slow if there are many
up
loads :(
Iterator<String> it = mPendingUploads.keySet().iterator();
boolean found = false;
while (it.hasNext() && !found) {
Iterator<String> it = mPendingUploads.keySet().iterator();
boolean found = false;
while (it.hasNext() && !found) {
@@
-371,7
+369,7
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
/**
/**
- * Adds a listener interested in the progress of the
down
load for a concrete file.
+ * Adds a listener interested in the progress of the
up
load for a concrete file.
*
* @param listener Object to notify about progress of transfer.
* @param account ownCloud account holding the file of interest.
*
* @param listener Object to notify about progress of transfer.
* @param account ownCloud account holding the file of interest.
@@
-386,7
+384,7
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
/**
/**
- * Removes a listener interested in the progress of the
down
load for a concrete file.
+ * Removes a listener interested in the progress of the
up
load for a concrete file.
*
* @param listener Object to notify about progress of transfer.
* @param account ownCloud account holding the file of interest.
*
* @param listener Object to notify about progress of transfer.
* @param account ownCloud account holding the file of interest.
@@
-569,7
+567,7
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
file.setMimetype(we.contentType());
file.setModificationTimestamp(we.modifiedTimestamp());
file.setModificationTimestampAtLastSyncForData(we.modifiedTimestamp());
file.setMimetype(we.contentType());
file.setModificationTimestamp(we.modifiedTimestamp());
file.setModificationTimestampAtLastSyncForData(we.modifiedTimestamp());
- // file.setEtag(mCurrent
Down
load.getEtag()); // TODO Etag, where available
+ // file.setEtag(mCurrent
Up
load.getEtag()); // TODO Etag, where available
}
}