Displaying differences for changeset |
@@ -16,7 +16,7 @@ |
import org.codehaus.jettison.json.JSONObject; |
/** |
-* Last Updated: 17-May-2016 |
+* Last Updated: 6-July-2016 |
* @author Tyler Wible |
* @since 19-April-2016 |
*/ |
@@ -58,17 +58,20 @@ |
//WatershedManagementUnit (?) |
//Open the provided website |
- URL webpage = new URL(cdsnStationWebsite); |
- URLConnection yc = webpage.openConnection(); |
- BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream())); |
- //Read out all of the webpage out into an ArrayList<String> |
- String inputLine; |
- ArrayList<String> pageData = new ArrayList<String>( ); |
- |
- while((inputLine = in.readLine()) != null){ |
- pageData.add(inputLine); |
+ ArrayList<String> pageData = new ArrayList<String>(); |
+ try{ |
+ URL webpage = new URL(cdsnStationWebsite); |
+ URLConnection yc = webpage.openConnection(); |
+ BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream())); |
+ //Read out all of the webpage out into an ArrayList<String> |
+ String inputLine; |
+ while((inputLine = in.readLine()) != null){ |
+ pageData.add(inputLine); |
+ } |
+ in.close(); |
+ }catch(FileNotFoundException e){ |
+ //Leave array blank for later error messages pasted onto the user |
} |
- in.close(); |
return pageData; |
} |