Removed unnecessary try-catch block from openHttpConnection.

This commit is contained in:
Robert Kolner committed 2011-09-21 18:19:48 +02:00
1 parent 55868eec63
commit 62f3406d1f
1 file changed
+10 -14
+10 -14
View File
@@ -31,20 +31,16 @@ public class FeedFetcher {
if (!(con instanceof HttpURLConnection))
throw new IOException("Not an HTTP connection!");
try {
HttpURLConnection httpCon = (HttpURLConnection) con;
httpCon.setAllowUserInteraction(false);
httpCon.setInstanceFollowRedirects(true);
httpCon.setRequestMethod("GET");
httpCon.connect();
response = httpCon.getResponseCode();
if (response == HttpURLConnection.HTTP_OK)
in = httpCon.getInputStream();
} catch (Exception e) {
throw new IOException("Error connecting.");
}
HttpURLConnection httpCon = (HttpURLConnection) con;
httpCon.setAllowUserInteraction(false);
httpCon.setInstanceFollowRedirects(true);
httpCon.setRequestMethod("GET");
httpCon.connect();
response = httpCon.getResponseCode();
if (response == HttpURLConnection.HTTP_OK)
in = httpCon.getInputStream();
return in;
}