Archived
Removed unnecessary try-catch block from openHttpConnection.
This commit is contained in:
1 parent
55868eec63
commit
62f3406d1f
1 file changed
+10
-14
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user