Skip to content Skip to sidebar Skip to footer

Read Text File Returned By URL

This URL return & open text file directly, i just want to read its content how can i do it http://translate.google.com.tw/translate_a/t?client=t&hl=en&sl=en&tl=

Solution 1:

If Your Url directly open's the Text File then this code reads the TextFile and print's also as follows:

public class URLReader {
public static void main(String[] args) throws Exception {

    URL oracle = new URL("http://www.oracle.com/");
    BufferedReader in = new BufferedReader(
    new InputStreamReader(oracle.openStream()));

    String inputLine;
    while ((inputLine = in.readLine()) != null)
        System.out.println(inputLine);
    in.close();
}

}


Post a Comment for "Read Text File Returned By URL"