public static String getDownloadAddedMessage() {
return FileDownloader.class.getName().toString() + DOWNLOAD_ADDED_MESSAGE;
public static String getDownloadAddedMessage() {
return FileDownloader.class.getName().toString() + DOWNLOAD_ADDED_MESSAGE;
- mAccount = intent.getParcelableExtra(EXTRA_ACCOUNT);
- mFile = intent.getParcelableExtra(EXTRA_FILE);
+ final Account account = intent.getParcelableExtra(EXTRA_ACCOUNT);
+ final OCFile file = intent.getParcelableExtra(EXTRA_FILE);
mPendingDownloads.putIfAbsent(downloadKey, newDownload);
newDownload.addDatatransferProgressListener(this);
newDownload.addDatatransferProgressListener((FileDownloaderBinder) mBinder);
mPendingDownloads.putIfAbsent(downloadKey, newDownload);
newDownload.addDatatransferProgressListener(this);
newDownload.addDatatransferProgressListener((FileDownloaderBinder) mBinder);
* @param account Owncloud account where the remote file is stored.
* @param file A file that could be in the queue of downloads.
*/
* @param account Owncloud account where the remote file is stored.
* @param file A file that could be in the queue of downloads.
*/
public boolean isDownloading(Account account, OCFile file) {
if (account == null || file == null) return false;
String targetKey = buildRemoteName(account, file);
public boolean isDownloading(Account account, OCFile file) {
if (account == null || file == null) return false;
String targetKey = buildRemoteName(account, file);
* @param file File OCFile
*/
public void cancel(Account account, OCFile file){
* @param file File OCFile
*/
public void cancel(Account account, OCFile file){
DownloadFileOperation download = null;
String targetKey = buildRemoteName(account, file);
ArrayList<String> keyItems = new ArrayList<String>();
DownloadFileOperation download = null;
String targetKey = buildRemoteName(account, file);
ArrayList<String> keyItems = new ArrayList<String>();
Log_OC.d(TAG, "Canceling file download");
keyItems.add(buildRemoteName(account, file));
}
Log_OC.d(TAG, "Canceling file download");
keyItems.add(buildRemoteName(account, file));
}