public void sendRequest ( ) throws IOException { if ( _conn instanceof HttpURLConnection ) { HttpURLConnection httpConn = ( HttpURLConnection ) _conn ; _statusCode = 500 ; try { _statusCode = httpConn . getResponseCode ( ) ; } catch ( Exception e ) { } parseResponseHeaders ( httpConn ) ; InputStream is = null ; if ( _statusCode != 200 ) { StringBuffer sb = new StringBuffer ( ) ; int ch ; try { is = httpConn . getInputStream ( ) ; if ( is != null ) { while ( ( ch = is . read ( ) ) >= 0 ) sb . append ( ( char ) ch ) ; is . close ( ) ; } is = httpConn . getErrorStream ( ) ; if ( is != null ) { while ( ( ch = is . read ( ) ) >= 0 ) sb . append ( ( char ) ch ) ; } _statusMessage = sb . toString ( ) ; } catch ( FileNotFoundException e ) { throw new HessianConnectionException ( "HessianProxy cannot connect to '" + _url , e ) ; } catch ( IOException e ) { if ( is == null ) throw new HessianConnectionException ( _statusCode + ": " + e , e ) ; else throw new HessianConnectionException ( _statusCode + ": " + sb , e ) ; } if ( is != null ) is . close ( ) ; throw new HessianConnectionException ( _statusCode + ": " + sb . toString ( ) ) ; } } }
Sends the request