I need to open a .txt file from a website. I tried this code:
int len = 0;
FileReader fr = new FileReader("http://www.cinndev.com/testFile.txt");
BufferedReader br = new BufferedReader(fr);
String str = "";
while ((str = br.readLine()) != null) {
System.out.println(str);
len++;
}
but the program froze on me. What is the best way to do this?
Thanks!