diff options
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/base/utils/InputStreamHelper.java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/utils/InputStreamHelper.java | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/utils/InputStreamHelper.java b/app/src/main/java/se/leap/bitmaskclient/base/utils/InputStreamHelper.java index 6dfe0861..34082bcb 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/utils/InputStreamHelper.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/utils/InputStreamHelper.java @@ -15,30 +15,6 @@ import de.blinkt.openvpn.core.NativeUtils; */ public class InputStreamHelper { - public interface InputStreamHelperInterface { - InputStream getInputStreamFrom(String filePath) throws FileNotFoundException; - - } - - private static InputStreamHelperInterface instance = new DefaultInputStreamHelper(); - - private static class DefaultInputStreamHelper implements InputStreamHelperInterface { - @Override - public InputStream getInputStreamFrom(String filePath) throws FileNotFoundException { - return new FileInputStream(filePath); - } - } - - public InputStreamHelper(InputStreamHelperInterface helperInterface) { - if (!NativeUtils.isUnitTest()) { - throw new IllegalStateException("InputStreamHelper injected with InputStreamHelperInterface outside of an unit test"); - } - instance = helperInterface; - } - //allows us to mock FileInputStream - public static InputStream getInputStreamFrom(String filePath) throws FileNotFoundException { - return instance.getInputStreamFrom(filePath); - } public static String loadInputStreamAsString(InputStream is) { java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A"); |