final static String trimURISubstring(URL src,String sub){
  final String s=src.toExternalForm();
  final int endIndex=s.lastIndexOf(sub);
  final String t=s.substring(0,endIndex);
  return t;
}

final static String trimURISubstring ( URL src , String sub ) { final String s = src . toExternalForm ( ) ; final int endIndex = s . lastIndexOf ( sub ) ; final String t = s . substring ( 0 , endIndex ) ; return t ; }
convenience method to prune last substring occurance from url .
