Code example for FileReader

Methods: close, toString

0
			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);