MCPcopy Create free account
hub / github.com/mozilla/rhino / getReader

Method getReader

examples/src/main/java/File.java:315–324  ·  view source on GitHub ↗

Get the LineNumberReader for this file, creating it if necessary. This method ensures that we're not already writing to this file before allowing read access. If no reader exists, it creates one using either the specified file or System.in if no file was specified. @return the LineNumberReader

()

Source from the content-addressed store, hash-verified

313 * @throws FileNotFoundException if the specified file cannot be found or opened
314 */
315 private LineNumberReader getReader() throws FileNotFoundException {
316 if (writer != null) {
317 throw Context.reportRuntimeError("already writing file \"" + name + "\"");
318 }
319 if (reader == null)
320 reader =
321 new LineNumberReader(
322 file == null ? new InputStreamReader(System.in) : new FileReader(file));
323 return reader;
324 }
325
326 /**
327 * Perform the common functionality for write and writeLine methods.

Callers 3

readLineMethod · 0.95
readCharMethod · 0.95
getLineNumberMethod · 0.95

Calls 1

reportRuntimeErrorMethod · 0.95

Tested by

no test coverage detected