Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String getPage(URL url) throws IOException{
- StringBuffer page = new StringBuffer();
- String s = null;
- URLConnection urlCon = url.openConnection();
- urlCon.setConnectTimeout(10000);
- BufferedReader in = new BufferedReader(new InputStreamReader(urlCon.getInputStream()));
- while ((s = in.readLine()) != null) {
- page.append(s);
- }
- in.close();
- return page.toString();
- }
Add Comment
Please, Sign In to add comment