question: 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 ; }
target:  Convenience method to prune last substring occurance from URL.