MCPcopy Create free account
hub / github.com/apache/pig / getScriptFromFile

Method getScriptFromFile

src/org/apache/pig/scripting/Pig.java:349–363  ·  view source on GitHub ↗
(String filename)

Source from the content-addressed store, hash-verified

347 //-------------------------------------------------------------------------
348
349 private static String getScriptFromFile(String filename) throws IOException {
350 LineNumberReader rd = new LineNumberReader(new FileReader(filename));
351 StringBuilder sb = new StringBuilder();
352 try {
353 String line = rd.readLine();
354 while (line != null) {
355 sb.append(line);
356 sb.append("\n");
357 line = rd.readLine();
358 }
359 } finally {
360 rd.close();
361 }
362 return sb.toString();
363 }
364
365 private static void addDefineClause(String alias, String definition) {
366 defineCache.add("DEFINE " + alias + " " + definition + ";\n");

Callers 1

compileFromFileMethod · 0.95

Calls 4

appendMethod · 0.65
closeMethod · 0.65
readLineMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected