Code example for URI

Methods: getFragment, getPath, getQuery

0
 
  @Override 
  public void initialize(URI name, Configuration conf) throws IOException {
    try { 
      URI realUri = new URI (realScheme, realAuthority,
                            name.getPath(), name.getQuery(), name.getFragment());
      super.initialize(realUri, conf);
    } catch (URISyntaxException e) {
      throw new RuntimeException(e);
    } 
  } 
 
  @Override 
  public URI getUri() {
    return myUri;
  } 
 
  @Override 
  public String getName() {
    return getUri().toString();
  }