public static String getURL(String sourceURI) {
        String retval = sourceURI;
        int qPos = sourceURI.indexOf("?");
        if (qPos != -1) {
            retval = retval.substring(0, qPos);
        }

        return retval;
    }
public static String getURL ( String sourceURI ) { String retval = sourceURI ; int qPos = sourceURI . indexOf ( "?" ) ; if ( qPos != - 1 ) { retval = retval . substring ( 0 , qPos ) ; } return retval ; }
Retrieve URL without parameters

@param sourceURI source URI
@return URL without parameters