I've written a code that reads web pages and transfers them into a .txt file. The problem is that the output file (something.txt) is LOCKED (I use OS X if that helps). I figured out that there could be a problem with unclosed BufferedReader(), but it seems closed. Thanks.
PrintStream ps = new PrintStream(new File("/Users/MyName/Desktop/something.txt"));
URL myUrl = new URL("webPage");
BufferedReader in = new BufferedReader(new InputStreamReader(myUrl.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
ps.println(inputLine);
System.out.println(inputLine);
}
in.close();
ps.close();