protected final String prepareUri ( final URI uri ) { if ( compareRelative ) { final String path = uri . getRawPath ( ) ; final String query = uri . getRawQuery ( ) ; final String fragment = uri . getRawFragment ( ) ; if ( query != null && fragment != null ) { return path + "?" + query + "#" + fragment ; } else if ( query != null ) { return path + "?" + query ; } else if ( fragment != null ) { return path + "#" + fragment ; } else { return path ; } } else { return uri . toString ( ) ; } }
Prepare the URI for matching .