Class java.io.File


  • File access with most browsers forbidden for security reasons.
  • Applications have normal file system access.
  • Opening a file:

public String open(String filename)
{
	try
	{
		return load(
			new BufferedReader(
				new FileReader(
					new File(filename))));
	}
	catch(FileNotFoundException file_not_found_exception)
	{
		System.err.println(filename+" read error:"
			+file_not_found_exception+"!");
	}

	return null;
}
  • For more comfortable File access InputStreams replaced by Reader, outputstreams replaced by Writer.

Java Tutorial - Standard Classes Jens Trapp, 1997