static String getCanonicalURL(String legalurl)
    {
        if(legalurl == null) return null;
        int index = legalurl.indexOf('?');
        if(index >= 0) legalurl = legalurl.substring(0, index);
        // remove any trailing extension
        //index = legalurl.lastIndexOf('.');
        //if(index >= 0) legalurl = legalurl.substring(0,index);
        return HTTPUtil.canonicalpath(legalurl);
    }
static String getCanonicalURL ( String legalurl ) { if ( legalurl == null ) return null ; int index = legalurl . indexOf ( '?' ) ; if ( index >= 0 ) legalurl = legalurl . substring ( 0 , index ) ; return HTTPUtil . canonicalpath ( legalurl ) ; }
Utilities