public URI toURILenient() throws URISyntaxException {
  if (streamHandler == null) {
    throw new IllegalStateException(protocol);
  }
  return new URI(streamHandler.toExternalForm(this,true));
}

public URI toURILenient ( ) throws URISyntaxException { if ( streamHandler == null ) { throw new IllegalStateException ( protocol ) ; } return new URI ( streamHandler . toExternalForm ( this , true ) ) ; }
encodes this url to the equivalent uri after escaping characters that are not permitted by uri .
