- Event[] getEventList() {
- Event events[];
- URL hostUrlJson;
- InputStreamReader in;
- try {
- hostUrlJson=new URL(Constants.searchUrl);
- URLConnection calConnection = hostUrlJson.openConnection();
- calConnection.setRequestProperty("Authorization", "Basic "+Base64.encodeToString( (Constants.user+':'+Constants.password).getBytes(), Base64.NO_WRAP));
- in = new InputStreamReader(calConnection.getInputStream());
- Gson gson=new Gson();
- events=gson.fromJson(in,Event[].class);
- in.close();
- return events;
- } catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- System.err.println("catch1");
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- System.err.println("catch2");
- e.printStackTrace();
- }
- throw new AssertionError();
- }