From 03f207db16e100e21600e6f1d9a63123ad8cd4e1 Mon Sep 17 00:00:00 2001 From: misaochan Date: Fri, 9 Dec 2016 17:00:14 +1300 Subject: [PATCH] Modify testSHA1() to use InputStream instead of File --- app/src/main/java/fr/free/nrw/commons/Utils.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/Utils.java b/app/src/main/java/fr/free/nrw/commons/Utils.java index 509626d2b..44fd805c5 100644 --- a/app/src/main/java/fr/free/nrw/commons/Utils.java +++ b/app/src/main/java/fr/free/nrw/commons/Utils.java @@ -45,7 +45,7 @@ public class Utils { private static final String TAG = Utils.class.getName(); - public static boolean testSHA1(String sha1, File file) { + public static boolean testSHA1(String sha1, InputStream is) { MessageDigest digest; try { digest = MessageDigest.getInstance("SHA1"); @@ -54,14 +54,6 @@ public class Utils { return false; } - InputStream is; - try { - is = new FileInputStream(file); - } catch (FileNotFoundException e) { - Log.e(TAG, "Exception while getting FileInputStream", e); - return false; - } - byte[] buffer = new byte[8192]; int read; try {