summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ProviderListContent.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-06-13 17:37:37 +0200
committerParménides GV <parmegv@sdf.org>2013-06-13 17:37:37 +0200
commit30c7bab5d8618df665e602fdd08bafa010a15497 (patch)
tree2c6c55568e73c06e10f475425e21365fd8961ce2 /src/se/leap/leapclient/ProviderListContent.java
parent2f69eb6eb9aa3993354e8de295df68558ab7b71e (diff)
bitmask json files are downloaded.
There was a problem on the assets file "bitmask.url". It had an error in the eip-service url. We should use this file only for main url, and proceed as if it were a new provider but with a preseeded main url.
Diffstat (limited to 'src/se/leap/leapclient/ProviderListContent.java')
-rw-r--r--src/se/leap/leapclient/ProviderListContent.java17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/se/leap/leapclient/ProviderListContent.java b/src/se/leap/leapclient/ProviderListContent.java
index b83bbd8e..10dce578 100644
--- a/src/se/leap/leapclient/ProviderListContent.java
+++ b/src/se/leap/leapclient/ProviderListContent.java
@@ -1,6 +1,5 @@
package se.leap.leapclient;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@@ -78,21 +77,14 @@ public class ProviderListContent {
}
}
- public ProviderItem(String name, String provider_json_url, String provider_json_filename, boolean custom, boolean danger_on) {
+ public ProviderItem(String name, String provider_json_url, JSONObject provider_json, boolean custom, boolean danger_on) {
-
- FileInputStream provider_json = ConfigHelper.openFileInputStream(provider_json_filename);
try {
- byte[] urls_file_bytes = new byte[provider_json.available()];
- provider_json.read(urls_file_bytes);
- String urls_file_content = new String(urls_file_bytes);
- JSONObject file_contents = new JSONObject(urls_file_content);
id = name;
this.name = name;
this.provider_json_url = provider_json_url;
- this.provider_json_filename = provider_json_filename;
- eip_service_json_url = file_contents.getString("api_uri") + "/" + file_contents.getString("api_version") + "/" + ConfigHelper.EIP_SERVICE_API_PATH;
- cert_json_url = (String) file_contents.get("ca_cert_uri");
+ eip_service_json_url = provider_json.getString("api_uri") + "/" + provider_json.getString("api_version") + "/" + ConfigHelper.EIP_SERVICE_API_PATH;
+ cert_json_url = (String) provider_json.get("ca_cert_uri");
this.custom = custom;
this.danger_on = danger_on;
if(custom)
@@ -100,9 +92,6 @@ public class ProviderListContent {
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
}
}