diff options
author | Parménides GV <parmegv@sdf.org> | 2015-01-07 16:44:11 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2015-01-19 15:57:44 +0100 |
commit | e1f028e6a27f209ed1f1773c234faf85085d87ab (patch) | |
tree | 278cbddf45d6a1da9a875a4580eb02406fac840a /app/src/androidTest/java/se/leap/bitmaskclient/test/FromAssets.java | |
parent | a74d09929575e44f86d09283ae4633b0dcfcb566 (diff) |
Tests for valid certificate.
Diffstat (limited to 'app/src/androidTest/java/se/leap/bitmaskclient/test/FromAssets.java')
-rw-r--r-- | app/src/androidTest/java/se/leap/bitmaskclient/test/FromAssets.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/FromAssets.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/FromAssets.java new file mode 100644 index 00000000..4f771922 --- /dev/null +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/FromAssets.java @@ -0,0 +1,26 @@ +package se.leap.bitmaskclient.test; + +import android.content.Context; + +import org.json.JSONException; + +import java.io.IOException; +import java.io.InputStream; + +public class FromAssets { + + Context context; + + public FromAssets(Context context) { + this.context = context; + } + public String toString(String filename) throws IOException, JSONException { + String result = ""; + InputStream is = context.getAssets().open(filename); + byte[] bytes = new byte[is.available()]; + if(is.read(bytes) > 0) { + result = new String(bytes); + } + return result; + } +} |