List of usage examples for java.io FileReader toString
public String toString()
From source file:org.jaggeryjs.jaggery.tools.JaggeryShell.java
/** * Evaluate JavaScript source.//from www . jav a 2 s.co m * * @param cx the current context * @param filename the name of the file to compile, or null * for interactive mode. */ @SuppressWarnings("unused") private void processSource(Context cx, String filename) { if (filename == null) { processSource(cx); } else { final String fileSeparator = System.getProperty("file.separator"); String fileToProcess = filename.replace("\\", fileSeparator + fileSeparator); fileToProcess = fileToProcess.replace("/", fileSeparator + fileSeparator); FileReader in = null; try { in = new FileReader(fileToProcess); in.toString(); } catch (FileNotFoundException ex) { Context.reportError("Couldn't open file \"" + fileToProcess + "\"."); return; } finally { try { in.close(); } catch (IOException e) { LOG.error("Error closing file reader for file " + filename, e); } } CommandLineExecutor.parseJaggeryScript(fileToProcess); } }