I have an assingment I have to do so please do not post the code, but can someone explain to me logically how it is possible to save a URL source code as a text file?
So far I have this code from the Oracle docs:
import java.net.*;
import java.io.*;
public class URLConnectionReader {
public static void main(String[] args) throws Exception {
URL oracle = new URL("http://www.oracle.com/");
URLConnection yc = oracle.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(
yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
So this is basically showing me the entire source code in the console, but I want to turn it into a text file which I can then analyze to find trends in the data.