public void setFragment ( String p_fragment ) throws MalformedURIException { if ( p_fragment == null ) { m_fragment = null ; } else if ( ! isGenericURI ( ) ) { throw new MalformedURIException ( "Fragment can only be set for a generic URI!" ) ; } else if ( getPath ( ) == null ) { throw new MalformedURIException ( "Fragment cannot be set when path is null!" ) ; } else if ( ! isURIString ( p_fragment ) ) { throw new MalformedURIException ( "Fragment contains invalid character!" ) ; } else { m_fragment = p_fragment ; } }
Set the fragment for this URI . A non - null value is valid only if this is a URI conforming to the generic URI syntax and the path value is not null .