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

Method exists

test/org/apache/pig/test/Util.java:507–516  ·  view source on GitHub ↗
(PigContext pigContext, String fileName)

Source from the content-addressed store, hash-verified

505 }
506
507 static public boolean exists(PigContext pigContext, String fileName)
508 throws IOException {
509 Configuration conf = ConfigurationUtil.toConfiguration(
510 pigContext.getProperties());
511 FileSystem fs = FileSystem.get(conf);
512 if(Util.WINDOWS){
513 fileName = fileName.replace('\\','/');
514 }
515 return fs.exists(new Path(fileName));
516 }
517
518 /**
519 * Helper function to check if the result of a Pig Query is in line with

Calls 5

toConfigurationMethod · 0.95
getMethod · 0.65
replaceMethod · 0.65
existsMethod · 0.65
getPropertiesMethod · 0.45

Tested by

no test coverage detected