Code example for URI

Methods: toString

    assertEquals("files option does not match",
      localFs.makeQualified(tmpPath).toString(), files);
    // pass file as uri 
    Configuration conf1 = new Configuration();
    URI tmpURI = new URI(tmpFile.toString() + "#link");
    args[0] = "-files";
    args[1] = tmpURI.toString();
    new GenericOptionsParser(conf1, args);
    files = conf1.get("tmpfiles");
    assertNotNull("files is null", files);
    assertEquals("files option does not match", 
      localFs.makeQualified(new Path(tmpURI)).toString(), files);
    // pass a file that does not exist. 
    // GenericOptionParser should throw exception 
    Configuration conf2 = new Configuration();
    args[0] = "-files";
    args[1] = "file:///xyz.txt";
    Throwable th = null;
Experience pair programming with AI  Get Codota for Java