Merge pull request #2706 from brad/unnecessary-param-context

avoid unused context parameter
This commit is contained in:
H. Lehmann 2018-05-21 08:14:45 +02:00 committed by GitHub
commit 04a635307d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 13 deletions

View File

@ -176,8 +176,8 @@ public class DownloadRequester {
args.putInt(REQUEST_ARG_PAGE_NR, feed.getPageNr()); args.putInt(REQUEST_ARG_PAGE_NR, feed.getPageNr());
args.putBoolean(REQUEST_ARG_LOAD_ALL_PAGES, loadAllPages); args.putBoolean(REQUEST_ARG_LOAD_ALL_PAGES, loadAllPages);
download(context, feed, null, new File(getFeedfilePath(context), download(context, feed, null, new File(getFeedfilePath(), getFeedfileName(feed)),
getFeedfileName(feed)), true, username, password, lastModified, true, args); true, username, password, lastModified, true, args);
} }
} }
@ -203,8 +203,7 @@ public class DownloadRequester {
if (feedmedia.getFile_url() != null) { if (feedmedia.getFile_url() != null) {
dest = new File(feedmedia.getFile_url()); dest = new File(feedmedia.getFile_url());
} else { } else {
dest = new File(getMediafilePath(context, feedmedia), dest = new File(getMediafilePath(feedmedia), getMediafilename(feedmedia));
getMediafilename(feedmedia));
} }
download(context, feedmedia, feed, download(context, feedmedia, feed,
dest, false, username, password, null, false, null); dest, false, username, password, null, false, null);
@ -305,10 +304,8 @@ public class DownloadRequester {
return downloads.size(); return downloads.size();
} }
private synchronized String getFeedfilePath(Context context) private synchronized String getFeedfilePath() throws DownloadRequestException {
throws DownloadRequestException { return getExternalFilesDirOrThrowException(FEED_DOWNLOADPATH).toString() + "/";
return getExternalFilesDirOrThrowException(context, FEED_DOWNLOADPATH)
.toString() + "/";
} }
private synchronized String getFeedfileName(Feed feed) { private synchronized String getFeedfileName(Feed feed) {
@ -319,10 +316,8 @@ public class DownloadRequester {
return "feed-" + FileNameGenerator.generateFileName(filename); return "feed-" + FileNameGenerator.generateFileName(filename);
} }
private synchronized String getMediafilePath(Context context, FeedMedia media) private synchronized String getMediafilePath(FeedMedia media) throws DownloadRequestException {
throws DownloadRequestException {
File externalStorage = getExternalFilesDirOrThrowException( File externalStorage = getExternalFilesDirOrThrowException(
context,
MEDIA_DOWNLOADPATH MEDIA_DOWNLOADPATH
+ FileNameGenerator.generateFileName(media.getItem() + FileNameGenerator.generateFileName(media.getItem()
.getFeed().getTitle()) + "/" .getFeed().getTitle()) + "/"
@ -330,8 +325,7 @@ public class DownloadRequester {
return externalStorage.toString(); return externalStorage.toString();
} }
private File getExternalFilesDirOrThrowException(Context context, private File getExternalFilesDirOrThrowException(String type) throws DownloadRequestException {
String type) throws DownloadRequestException {
File result = UserPreferences.getDataFolder(type); File result = UserPreferences.getDataFolder(type);
if (result == null) { if (result == null) {
throw new DownloadRequestException( throw new DownloadRequestException(