diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-03-28 21:16:27 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-03-28 21:16:27 +0100 |
commit | b2de7512f4c871e882760bfe8bffa27d10c1c68a (patch) | |
tree | 2cc17eb8cdcbb8bfdb79f5e32dfab47abe9acc59 /src/de/danoeh/antennapod/storage/DownloadRequester.java | |
parent | 7dec032d2cfb8835e29cb939b596752380650dcb (diff) | |
download | AntennaPod-b2de7512f4c871e882760bfe8bffa27d10c1c68a.zip |
Replaced AppConfig.DEBUG with BuildConfig.DEBUG
Diffstat (limited to 'src/de/danoeh/antennapod/storage/DownloadRequester.java')
-rw-r--r-- | src/de/danoeh/antennapod/storage/DownloadRequester.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/de/danoeh/antennapod/storage/DownloadRequester.java b/src/de/danoeh/antennapod/storage/DownloadRequester.java index 357f44faa..0a1747253 100644 --- a/src/de/danoeh/antennapod/storage/DownloadRequester.java +++ b/src/de/danoeh/antennapod/storage/DownloadRequester.java @@ -4,7 +4,7 @@ import android.content.Context; import android.content.Intent; import android.util.Log; import android.webkit.URLUtil; -import de.danoeh.antennapod.AppConfig; +import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.feed.*; import de.danoeh.antennapod.preferences.UserPreferences; import de.danoeh.antennapod.service.download.DownloadRequest; @@ -59,7 +59,7 @@ public class DownloadRequester { if (context == null) throw new IllegalArgumentException("context = null"); if (request == null) throw new IllegalArgumentException("request = null"); if (downloads.containsKey(request.getSource())) { - if (AppConfig.DEBUG) Log.i(TAG, "DownloadRequest is already stored."); + if (BuildConfig.DEBUG) Log.i(TAG, "DownloadRequest is already stored."); return false; } downloads.put(request.getSource(), request); @@ -75,11 +75,11 @@ public class DownloadRequester { boolean overwriteIfExists, String username, String password) { if (!isDownloadingFile(item)) { if (!isFilenameAvailable(dest.toString()) || dest.exists()) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Filename already used."); if (isFilenameAvailable(dest.toString()) && overwriteIfExists) { boolean result = dest.delete(); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Deleting file. Result: " + result); } else { // find different name @@ -91,12 +91,12 @@ public class DownloadRequester { + i + FilenameUtils.EXTENSION_SEPARATOR + FilenameUtils.getExtension(dest.getName()); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Testing filename " + newName); newDest = new File(dest.getParent(), newName); if (!newDest.exists() && isFilenameAvailable(newDest.toString())) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "File doesn't exist yet. Using " + newName); break; @@ -107,7 +107,7 @@ public class DownloadRequester { } } } - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Requesting download of url " + item.getDownload_url()); item.setDownload_url(URLChecker.prepareURL(item.getDownload_url())); @@ -131,13 +131,13 @@ public class DownloadRequester { for (String key : downloads.keySet()) { DownloadRequest r = downloads.get(key); if (StringUtils.equals(r.getDestination(), path)) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, path + " is already used by another requested download"); return false; } } - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, path + " is available as a download destination"); return true; } @@ -198,7 +198,7 @@ public class DownloadRequester { * Cancels a running download. */ public void cancelDownload(final Context context, final String downloadUrl) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Cancelling download with url " + downloadUrl); Intent cancelIntent = new Intent(DownloadService.ACTION_CANCEL_DOWNLOAD); cancelIntent.putExtra(DownloadService.EXTRA_DOWNLOAD_URL, downloadUrl); @@ -209,7 +209,7 @@ public class DownloadRequester { * Cancels all running downloads */ public void cancelAllDownloads(Context context) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Cancelling all running downloads"); context.sendBroadcast(new Intent( DownloadService.ACTION_CANCEL_ALL_DOWNLOADS)); |