diff --git a/app/src/main/java/org/fdroid/fdroid/RepoUpdater.java b/app/src/main/java/org/fdroid/fdroid/RepoUpdater.java index 2c75c06bd..653e975b2 100644 --- a/app/src/main/java/org/fdroid/fdroid/RepoUpdater.java +++ b/app/src/main/java/org/fdroid/fdroid/RepoUpdater.java @@ -106,9 +106,9 @@ public class RepoUpdater { } } catch (IOException e) { - if (downloader != null && downloader.getFile() != null) { - if (!downloader.getFile().delete()) { - Log.w(TAG, "Couldn't delete file: " + downloader.getFile().getAbsolutePath()); + if (downloader != null && downloader.outputFile != null) { + if (!downloader.outputFile.delete()) { + Log.w(TAG, "Couldn't delete file: " + downloader.outputFile.getAbsolutePath()); } } @@ -136,7 +136,7 @@ public class RepoUpdater { // Don't worry about checking the status code for 200. If it was a // successful download, then we will have a file ready to use: cacheTag = downloader.getCacheTag(); - processDownloadedFile(downloader.getFile()); + processDownloadedFile(downloader.outputFile); } } diff --git a/app/src/main/java/org/fdroid/fdroid/net/Downloader.java b/app/src/main/java/org/fdroid/fdroid/net/Downloader.java index 61b6af116..45ba5b884 100644 --- a/app/src/main/java/org/fdroid/fdroid/net/Downloader.java +++ b/app/src/main/java/org/fdroid/fdroid/net/Downloader.java @@ -27,7 +27,7 @@ public abstract class Downloader { private final OutputStream outputStream; - private final File outputFile; + public final File outputFile; protected final URL sourceUrl; protected String cacheTag; @@ -78,15 +78,6 @@ public abstract class Downloader { return cacheTag != null; } - /** - * Only available if you passed a context object into the constructor - * (rather than an outputStream, which may or may not be associated with - * a file). - */ - public File getFile() { - return outputFile; - } - public abstract boolean hasChanged(); protected abstract int totalDownloadSize();