diff --git a/app/src/main/java/org/fdroid/fdroid/IndexV1Updater.java b/app/src/main/java/org/fdroid/fdroid/IndexV1Updater.java index b961f3abb..a0ac78cbb 100644 --- a/app/src/main/java/org/fdroid/fdroid/IndexV1Updater.java +++ b/app/src/main/java/org/fdroid/fdroid/IndexV1Updater.java @@ -82,8 +82,7 @@ public class IndexV1Updater extends RepoUpdater { Downloader downloader = null; try { // read file name from file - final Uri dataUri = Uri.parse(indexUrl); - downloader = DownloaderFactory.create(context, dataUri.toString()); + downloader = DownloaderFactory.create(context, indexUrl); downloader.setCacheTag(repo.lastetag); downloader.setListener(downloadListener); downloader.download(); @@ -108,8 +107,7 @@ public class IndexV1Updater extends RepoUpdater { try { mirrorUrl = FDroidApp.getMirror(prevMirrorUrl, repo); prevMirrorUrl = mirrorUrl; - Uri dataUri2 = Uri.parse(mirrorUrl); - downloader = DownloaderFactory.create(context, dataUri2.toString()); + downloader = DownloaderFactory.create(context, mirrorUrl); downloader.setCacheTag(repo.lastetag); downloader.setListener(downloadListener); downloader.setTimeout(FDroidApp.getTimeout()); diff --git a/app/src/main/java/org/fdroid/fdroid/net/DownloaderFactory.java b/app/src/main/java/org/fdroid/fdroid/net/DownloaderFactory.java index 3d124eed9..4704ae279 100644 --- a/app/src/main/java/org/fdroid/fdroid/net/DownloaderFactory.java +++ b/app/src/main/java/org/fdroid/fdroid/net/DownloaderFactory.java @@ -20,19 +20,14 @@ public class DownloaderFactory { throws IOException { File destFile = File.createTempFile("dl-", "", context.getCacheDir()); destFile.deleteOnExit(); // this probably does nothing, but maybe... - return create(context, urlString, destFile); + Uri uri = Uri.parse(urlString); + return create(context, uri, destFile); } public static Downloader create(Context context, Uri uri, File destFile) throws IOException { - return create(context, uri.toString(), destFile); - } - - public static Downloader create(Context context, String urlString, File destFile) - throws IOException { Downloader downloader; - Uri uri = Uri.parse(urlString); String scheme = uri.getScheme(); if ("bluetooth".equals(scheme)) { downloader = new BluetoothDownloader(uri, destFile);