@Override public String resolveURI(String baseUri,String uri){
  if (uri == null || uri.isEmpty())   return null;
  try {
    URI possiblyRelative=new URI(uri);
    if (possiblyRelative.isAbsolute()) {
      return possiblyRelative.toString();
    }
    URI base=new URI(baseUri);
    URI absolute=base.resolve(uri);
    return absolute.toString();
  }
 catch (  URISyntaxException e) {
    XRLog.exception("When trying to load uri(" + uri + ") with base URI("+ baseUri+ "), one or both were invalid URIs.",e);
    return null;
  }
}

@ Override public String resolveURI ( String baseUri , String uri ) { if ( uri == null || uri . isEmpty ( ) ) return null ; try { URI possiblyRelative = new URI ( uri ) ; if ( possiblyRelative . isAbsolute ( ) ) { return possiblyRelative . toString ( ) ; } URI base = new URI ( baseUri ) ; URI absolute = base . resolve ( uri ) ; return absolute . toString ( ) ; } catch ( URISyntaxException e ) { XRLog . exception ( "When trying to load uri(" + uri + ") with base URI(" + baseUri + "), one or both were invalid URIs." , e ) ; return null ; } }
resolves the uri ; if absolute , leaves as is , if relative , returns an absolute uri based on the baseurl for the agent .
