Searched refs:urlConnection (Results 1 – 5 of 5) sorted by relevance
161 HttpURLConnection urlConnection = null; in connectToWebsite() local164 urlConnection = (HttpURLConnection) url.openConnection(); in connectToWebsite()165 urlConnection.setConnectTimeout(2000); in connectToWebsite()166 urlConnection.setReadTimeout(2000); in connectToWebsite()167 urlConnection.getResponseCode(); in connectToWebsite()171 if (urlConnection != null) { in connectToWebsite()172 urlConnection.disconnect(); in connectToWebsite()
119 HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); in connectToWebsite() local120 try (AutoCloseable ac = () -> urlConnection.disconnect()){ in connectToWebsite()121 urlConnection.setConnectTimeout(2000); in connectToWebsite()122 urlConnection.setReadTimeout(2000); in connectToWebsite()123 urlConnection.getResponseCode(); in connectToWebsite()
244 HttpURLConnection urlConnection = null;247 urlConnection = (HttpURLConnection) url.openConnection();248 if (urlConnection.getResponseCode() != 200) {250 + urlConnection.getResponseCode());253 new InputStreamReader(urlConnection.getInputStream()));259 if (urlConnection != null) {260 urlConnection.disconnect();
196 HttpURLConnection urlConnection = null; in connectToWebsite() local199 urlConnection = (HttpURLConnection) url.openConnection(); in connectToWebsite()200 urlConnection.setConnectTimeout(2000); in connectToWebsite()201 urlConnection.setReadTimeout(2000); in connectToWebsite()202 urlConnection.getResponseCode(); in connectToWebsite()206 if (urlConnection != null) { in connectToWebsite()207 urlConnection.disconnect(); in connectToWebsite()
362 HttpURLConnection urlConnection = null; in connectToWebsite() local369 urlConnection = (HttpURLConnection) url.openConnection(); in connectToWebsite()370 urlConnection.setConnectTimeout(CONNECTION_TIMEOUT_MS); in connectToWebsite()371 urlConnection.setReadTimeout(CONNECTION_TIMEOUT_MS); in connectToWebsite()372 final int responseCode = urlConnection.getResponseCode(); in connectToWebsite()379 if (urlConnection != null) { in connectToWebsite()380 urlConnection.disconnect(); in connectToWebsite()