juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [09/37] incubator-juneau-website git commit: Update javadocs
Date Mon, 27 Mar 2017 01:21:19 GMT
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/236aea45/content/site/apidocs/src-html/org/apache/juneau/rest/client/RestCallException.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/client/RestCallException.html b/content/site/apidocs/src-html/org/apache/juneau/rest/client/RestCallException.html
index a5d51e2..f17a320 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/rest/client/RestCallException.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/rest/client/RestCallException.html
@@ -23,140 +23,199 @@
 <span class="sourceLineNo">015</span>import static java.lang.String.*;<a name="line.15"></a>
 <span class="sourceLineNo">016</span><a name="line.16"></a>
 <span class="sourceLineNo">017</span>import java.io.*;<a name="line.17"></a>
-<span class="sourceLineNo">018</span>import java.net.*;<a name="line.18"></a>
-<span class="sourceLineNo">019</span>import java.util.regex.*;<a name="line.19"></a>
-<span class="sourceLineNo">020</span><a name="line.20"></a>
-<span class="sourceLineNo">021</span>import org.apache.http.*;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import org.apache.http.client.*;<a name="line.22"></a>
-<span class="sourceLineNo">023</span>import org.apache.http.util.*;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.juneau.internal.*;<a name="line.24"></a>
-<span class="sourceLineNo">025</span><a name="line.25"></a>
-<span class="sourceLineNo">026</span>/**<a name="line.26"></a>
-<span class="sourceLineNo">027</span> * Exception representing a &lt;code&gt;400+&lt;/code&gt; HTTP response code against a remote resource.<a name="line.27"></a>
-<span class="sourceLineNo">028</span> */<a name="line.28"></a>
-<span class="sourceLineNo">029</span>public final class RestCallException extends IOException {<a name="line.29"></a>
-<span class="sourceLineNo">030</span><a name="line.30"></a>
-<span class="sourceLineNo">031</span>   private static final long serialVersionUID = 1L;<a name="line.31"></a>
-<span class="sourceLineNo">032</span><a name="line.32"></a>
-<span class="sourceLineNo">033</span>   private int responseCode;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>   private String response, responseStatusMessage;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>   HttpResponseException e;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>   private HttpResponse httpResponse;<a name="line.36"></a>
-<span class="sourceLineNo">037</span><a name="line.37"></a>
+<span class="sourceLineNo">018</span>import java.lang.reflect.*;<a name="line.18"></a>
+<span class="sourceLineNo">019</span>import java.net.*;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import java.util.regex.*;<a name="line.20"></a>
+<span class="sourceLineNo">021</span><a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.http.*;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.http.client.*;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.http.util.*;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.juneau.internal.*;<a name="line.25"></a>
+<span class="sourceLineNo">026</span><a name="line.26"></a>
+<span class="sourceLineNo">027</span>/**<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * Exception representing a &lt;code&gt;400+&lt;/code&gt; HTTP response code against a remote resource.<a name="line.28"></a>
+<span class="sourceLineNo">029</span> */<a name="line.29"></a>
+<span class="sourceLineNo">030</span>public final class RestCallException extends IOException {<a name="line.30"></a>
+<span class="sourceLineNo">031</span><a name="line.31"></a>
+<span class="sourceLineNo">032</span>   private static final long serialVersionUID = 1L;<a name="line.32"></a>
+<span class="sourceLineNo">033</span><a name="line.33"></a>
+<span class="sourceLineNo">034</span>   private int responseCode;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>   private String response, responseStatusMessage;<a name="line.35"></a>
+<span class="sourceLineNo">036</span>   HttpResponseException e;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>   private HttpResponse httpResponse;<a name="line.37"></a>
 <span class="sourceLineNo">038</span><a name="line.38"></a>
-<span class="sourceLineNo">039</span>   /**<a name="line.39"></a>
-<span class="sourceLineNo">040</span>    * Constructor.<a name="line.40"></a>
-<span class="sourceLineNo">041</span>    *<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    * @param msg The exception message.<a name="line.42"></a>
-<span class="sourceLineNo">043</span>    */<a name="line.43"></a>
-<span class="sourceLineNo">044</span>   public RestCallException(String msg) {<a name="line.44"></a>
-<span class="sourceLineNo">045</span>      super(msg);<a name="line.45"></a>
-<span class="sourceLineNo">046</span>   }<a name="line.46"></a>
-<span class="sourceLineNo">047</span><a name="line.47"></a>
-<span class="sourceLineNo">048</span>   /**<a name="line.48"></a>
-<span class="sourceLineNo">049</span>    * Constructor.<a name="line.49"></a>
-<span class="sourceLineNo">050</span>    *<a name="line.50"></a>
-<span class="sourceLineNo">051</span>    * @param e The inner cause of the exception.<a name="line.51"></a>
-<span class="sourceLineNo">052</span>    */<a name="line.52"></a>
-<span class="sourceLineNo">053</span>   public RestCallException(Exception e) {<a name="line.53"></a>
-<span class="sourceLineNo">054</span>      super(e.getLocalizedMessage(), e);<a name="line.54"></a>
-<span class="sourceLineNo">055</span>      if (e instanceof FileNotFoundException) {<a name="line.55"></a>
-<span class="sourceLineNo">056</span>         responseCode = 404;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>      } else if (e.getMessage() != null) {<a name="line.57"></a>
-<span class="sourceLineNo">058</span>         Pattern p = Pattern.compile("[^\\d](\\d{3})[^\\d]");<a name="line.58"></a>
-<span class="sourceLineNo">059</span>         Matcher m = p.matcher(e.getMessage());<a name="line.59"></a>
-<span class="sourceLineNo">060</span>         if (m.find())<a name="line.60"></a>
-<span class="sourceLineNo">061</span>            responseCode = Integer.parseInt(m.group(1));<a name="line.61"></a>
-<span class="sourceLineNo">062</span>      }<a name="line.62"></a>
-<span class="sourceLineNo">063</span>      setStackTrace(e.getStackTrace());<a name="line.63"></a>
-<span class="sourceLineNo">064</span>   }<a name="line.64"></a>
-<span class="sourceLineNo">065</span><a name="line.65"></a>
-<span class="sourceLineNo">066</span>   /**<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    * Create an exception with a simple message and the status code and body of the specified response.<a name="line.67"></a>
-<span class="sourceLineNo">068</span>    *<a name="line.68"></a>
-<span class="sourceLineNo">069</span>    * @param msg The exception message.<a name="line.69"></a>
-<span class="sourceLineNo">070</span>    * @param response The HTTP response object.<a name="line.70"></a>
-<span class="sourceLineNo">071</span>    * @throws ParseException<a name="line.71"></a>
-<span class="sourceLineNo">072</span>    * @throws IOException<a name="line.72"></a>
-<span class="sourceLineNo">073</span>    */<a name="line.73"></a>
-<span class="sourceLineNo">074</span>   public RestCallException(String msg, HttpResponse response) throws ParseException, IOException {<a name="line.74"></a>
-<span class="sourceLineNo">075</span>      super(format("%s%nstatus='%s'%nResponse: %n%s%n", msg, response.getStatusLine().getStatusCode(), EntityUtils.toString(response.getEntity(), IOUtils.UTF8)));<a name="line.75"></a>
-<span class="sourceLineNo">076</span>   }<a name="line.76"></a>
-<span class="sourceLineNo">077</span><a name="line.77"></a>
-<span class="sourceLineNo">078</span>   /**<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    * Constructor.<a name="line.79"></a>
-<span class="sourceLineNo">080</span>    *<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    * @param responseCode The response code.<a name="line.81"></a>
-<span class="sourceLineNo">082</span>    * @param responseMsg The response message.<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    * @param method The HTTP method (for message purposes).<a name="line.83"></a>
-<span class="sourceLineNo">084</span>    * @param url The HTTP URL (for message purposes).<a name="line.84"></a>
-<span class="sourceLineNo">085</span>    * @param response The reponse from the server.<a name="line.85"></a>
-<span class="sourceLineNo">086</span>    */<a name="line.86"></a>
-<span class="sourceLineNo">087</span>   public RestCallException(int responseCode, String responseMsg, String method, URI url, String response) {<a name="line.87"></a>
-<span class="sourceLineNo">088</span>      super(format("HTTP method '%s' call to '%s' caused response code '%s,%s'.%nResponse: %n%s%n", method, url, responseCode, responseMsg, response));<a name="line.88"></a>
-<span class="sourceLineNo">089</span>      this.responseCode = responseCode;<a name="line.89"></a>
-<span class="sourceLineNo">090</span>      this.responseStatusMessage = responseMsg;<a name="line.90"></a>
-<span class="sourceLineNo">091</span>      this.response = response;<a name="line.91"></a>
-<span class="sourceLineNo">092</span>   }<a name="line.92"></a>
-<span class="sourceLineNo">093</span><a name="line.93"></a>
-<span class="sourceLineNo">094</span>   /**<a name="line.94"></a>
-<span class="sourceLineNo">095</span>    * Sets the HTTP response object that caused this exception.<a name="line.95"></a>
-<span class="sourceLineNo">096</span>    *<a name="line.96"></a>
-<span class="sourceLineNo">097</span>    * @param httpResponse The HTTP respose object.<a name="line.97"></a>
-<span class="sourceLineNo">098</span>    * @return This object (for method chaining).<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    */<a name="line.99"></a>
-<span class="sourceLineNo">100</span>   protected RestCallException setHttpResponse(HttpResponse httpResponse) {<a name="line.100"></a>
-<span class="sourceLineNo">101</span>      this.httpResponse = httpResponse;<a name="line.101"></a>
-<span class="sourceLineNo">102</span>      return this;<a name="line.102"></a>
-<span class="sourceLineNo">103</span>   }<a name="line.103"></a>
-<span class="sourceLineNo">104</span><a name="line.104"></a>
-<span class="sourceLineNo">105</span>   /**<a name="line.105"></a>
-<span class="sourceLineNo">106</span>    * Returns the HTTP response object that caused this exception.<a name="line.106"></a>
-<span class="sourceLineNo">107</span>    *<a name="line.107"></a>
-<span class="sourceLineNo">108</span>    * @return The HTTP response object that caused this exception, or &lt;jk&gt;null&lt;/jk&gt; if no response was created yet when the exception was thrown.<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    */<a name="line.109"></a>
-<span class="sourceLineNo">110</span>   public HttpResponse getHttpResponse() {<a name="line.110"></a>
-<span class="sourceLineNo">111</span>      return this.httpResponse;<a name="line.111"></a>
-<span class="sourceLineNo">112</span>   }<a name="line.112"></a>
-<span class="sourceLineNo">113</span><a name="line.113"></a>
-<span class="sourceLineNo">114</span>   /**<a name="line.114"></a>
-<span class="sourceLineNo">115</span>    * Returns the HTTP response status code.<a name="line.115"></a>
-<span class="sourceLineNo">116</span>    *<a name="line.116"></a>
-<span class="sourceLineNo">117</span>    * @return The response status code.  If a connection could not be made at all, returns &lt;code&gt;0&lt;/code&gt;.<a name="line.117"></a>
-<span class="sourceLineNo">118</span>    */<a name="line.118"></a>
-<span class="sourceLineNo">119</span>   public int getResponseCode() {<a name="line.119"></a>
-<span class="sourceLineNo">120</span>      return responseCode;<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   }<a name="line.121"></a>
-<span class="sourceLineNo">122</span><a name="line.122"></a>
-<span class="sourceLineNo">123</span>   /**<a name="line.123"></a>
-<span class="sourceLineNo">124</span>    * Returns the HTTP response message body text.<a name="line.124"></a>
-<span class="sourceLineNo">125</span>    *<a name="line.125"></a>
-<span class="sourceLineNo">126</span>    * @return The response message body text.<a name="line.126"></a>
-<span class="sourceLineNo">127</span>    */<a name="line.127"></a>
-<span class="sourceLineNo">128</span>   public String getResponseMessage() {<a name="line.128"></a>
-<span class="sourceLineNo">129</span>      return response;<a name="line.129"></a>
-<span class="sourceLineNo">130</span>   }<a name="line.130"></a>
-<span class="sourceLineNo">131</span><a name="line.131"></a>
-<span class="sourceLineNo">132</span>   /**<a name="line.132"></a>
-<span class="sourceLineNo">133</span>    * Returns the response status message as a plain string.<a name="line.133"></a>
-<span class="sourceLineNo">134</span>    *<a name="line.134"></a>
-<span class="sourceLineNo">135</span>    * @return The response status message.<a name="line.135"></a>
-<span class="sourceLineNo">136</span>    */<a name="line.136"></a>
-<span class="sourceLineNo">137</span>   public String getResponseStatusMessage() {<a name="line.137"></a>
-<span class="sourceLineNo">138</span>      return responseStatusMessage;<a name="line.138"></a>
-<span class="sourceLineNo">139</span>   }<a name="line.139"></a>
-<span class="sourceLineNo">140</span><a name="line.140"></a>
-<span class="sourceLineNo">141</span>   /**<a name="line.141"></a>
-<span class="sourceLineNo">142</span>    * Sets the inner cause for this exception.<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    * @param cause The inner cause.<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    * @return This object (for method chaining).<a name="line.144"></a>
-<span class="sourceLineNo">145</span>    */<a name="line.145"></a>
-<span class="sourceLineNo">146</span>   @Override /* Throwable */<a name="line.146"></a>
-<span class="sourceLineNo">147</span>   public synchronized RestCallException initCause(Throwable cause) {<a name="line.147"></a>
-<span class="sourceLineNo">148</span>      super.initCause(cause);<a name="line.148"></a>
-<span class="sourceLineNo">149</span>      return this;<a name="line.149"></a>
-<span class="sourceLineNo">150</span>   }<a name="line.150"></a>
-<span class="sourceLineNo">151</span>}<a name="line.151"></a>
+<span class="sourceLineNo">039</span>   @SuppressWarnings("unused")<a name="line.39"></a>
+<span class="sourceLineNo">040</span>   private String serverExceptionName, serverExceptionMessage, serverExceptionTrace;<a name="line.40"></a>
+<span class="sourceLineNo">041</span><a name="line.41"></a>
+<span class="sourceLineNo">042</span><a name="line.42"></a>
+<span class="sourceLineNo">043</span>   /**<a name="line.43"></a>
+<span class="sourceLineNo">044</span>    * Constructor.<a name="line.44"></a>
+<span class="sourceLineNo">045</span>    *<a name="line.45"></a>
+<span class="sourceLineNo">046</span>    * @param msg The exception message.<a name="line.46"></a>
+<span class="sourceLineNo">047</span>    */<a name="line.47"></a>
+<span class="sourceLineNo">048</span>   public RestCallException(String msg) {<a name="line.48"></a>
+<span class="sourceLineNo">049</span>      super(msg);<a name="line.49"></a>
+<span class="sourceLineNo">050</span>   }<a name="line.50"></a>
+<span class="sourceLineNo">051</span><a name="line.51"></a>
+<span class="sourceLineNo">052</span>   /**<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    * Constructor.<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    *<a name="line.54"></a>
+<span class="sourceLineNo">055</span>    * @param e The inner cause of the exception.<a name="line.55"></a>
+<span class="sourceLineNo">056</span>    */<a name="line.56"></a>
+<span class="sourceLineNo">057</span>   public RestCallException(Exception e) {<a name="line.57"></a>
+<span class="sourceLineNo">058</span>      super(e.getLocalizedMessage(), e);<a name="line.58"></a>
+<span class="sourceLineNo">059</span>      if (e instanceof FileNotFoundException) {<a name="line.59"></a>
+<span class="sourceLineNo">060</span>         responseCode = 404;<a name="line.60"></a>
+<span class="sourceLineNo">061</span>      } else if (e.getMessage() != null) {<a name="line.61"></a>
+<span class="sourceLineNo">062</span>         Pattern p = Pattern.compile("[^\\d](\\d{3})[^\\d]");<a name="line.62"></a>
+<span class="sourceLineNo">063</span>         Matcher m = p.matcher(e.getMessage());<a name="line.63"></a>
+<span class="sourceLineNo">064</span>         if (m.find())<a name="line.64"></a>
+<span class="sourceLineNo">065</span>            responseCode = Integer.parseInt(m.group(1));<a name="line.65"></a>
+<span class="sourceLineNo">066</span>      }<a name="line.66"></a>
+<span class="sourceLineNo">067</span>      setStackTrace(e.getStackTrace());<a name="line.67"></a>
+<span class="sourceLineNo">068</span>   }<a name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span>   /**<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    * Create an exception with a simple message and the status code and body of the specified response.<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    *<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    * @param msg The exception message.<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    * @param response The HTTP response object.<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    * @throws ParseException<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    * @throws IOException<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    */<a name="line.77"></a>
+<span class="sourceLineNo">078</span>   public RestCallException(String msg, HttpResponse response) throws ParseException, IOException {<a name="line.78"></a>
+<span class="sourceLineNo">079</span>      super(format("%s%nstatus='%s'%nResponse: %n%s%n", msg, response.getStatusLine().getStatusCode(), EntityUtils.toString(response.getEntity(), IOUtils.UTF8)));<a name="line.79"></a>
+<span class="sourceLineNo">080</span>   }<a name="line.80"></a>
+<span class="sourceLineNo">081</span><a name="line.81"></a>
+<span class="sourceLineNo">082</span>   /**<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    * Constructor.<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    *<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    * @param responseCode The response code.<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    * @param responseMsg The response message.<a name="line.86"></a>
+<span class="sourceLineNo">087</span>    * @param method The HTTP method (for message purposes).<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    * @param url The HTTP URL (for message purposes).<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    * @param response The reponse from the server.<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    */<a name="line.90"></a>
+<span class="sourceLineNo">091</span>   public RestCallException(int responseCode, String responseMsg, String method, URI url, String response) {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>      super(format("HTTP method '%s' call to '%s' caused response code '%s,%s'.%nResponse: %n%s%n", method, url, responseCode, responseMsg, response));<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      this.responseCode = responseCode;<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      this.responseStatusMessage = responseMsg;<a name="line.94"></a>
+<span class="sourceLineNo">095</span>      this.response = response;<a name="line.95"></a>
+<span class="sourceLineNo">096</span>   }<a name="line.96"></a>
+<span class="sourceLineNo">097</span><a name="line.97"></a>
+<span class="sourceLineNo">098</span>   /**<a name="line.98"></a>
+<span class="sourceLineNo">099</span>    * Sets the server-side exception details.<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    *<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    * @param exceptionName The &lt;code&gt;Exception-Name:&lt;/code&gt; header specifying the full name of the exception.<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    * @param exceptionMessage The &lt;code&gt;Exception-Message:&lt;/code&gt; header specifying the message returned by {@link Throwable#getMessage()}.<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    * @param exceptionTrace The stack trace of the exception returned by {@link Throwable#printStackTrace()}.<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    * @return This object (for method chaining).<a name="line.104"></a>
+<span class="sourceLineNo">105</span>    */<a name="line.105"></a>
+<span class="sourceLineNo">106</span>   protected RestCallException setServerException(Header exceptionName, Header exceptionMessage, Header exceptionTrace) {<a name="line.106"></a>
+<span class="sourceLineNo">107</span>      if (exceptionName != null)<a name="line.107"></a>
+<span class="sourceLineNo">108</span>         serverExceptionName = exceptionName.getValue();<a name="line.108"></a>
+<span class="sourceLineNo">109</span>      if (exceptionMessage != null)<a name="line.109"></a>
+<span class="sourceLineNo">110</span>         serverExceptionMessage = exceptionMessage.getValue();<a name="line.110"></a>
+<span class="sourceLineNo">111</span>      if (exceptionTrace != null)<a name="line.111"></a>
+<span class="sourceLineNo">112</span>         serverExceptionTrace = exceptionTrace.getValue();<a name="line.112"></a>
+<span class="sourceLineNo">113</span>      return this;<a name="line.113"></a>
+<span class="sourceLineNo">114</span>   }<a name="line.114"></a>
+<span class="sourceLineNo">115</span><a name="line.115"></a>
+<span class="sourceLineNo">116</span>   /**<a name="line.116"></a>
+<span class="sourceLineNo">117</span>    * Tries to reconstruct and re-throw the server-side exception.<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    * &lt;p&gt;<a name="line.118"></a>
+<span class="sourceLineNo">119</span>    * The exception is based on the following HTTP response headers:<a name="line.119"></a>
+<span class="sourceLineNo">120</span>    * &lt;ul&gt;<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    *    &lt;li&gt;&lt;code&gt;Exception-Name:&lt;/code&gt; - The full class name of the exception.<a name="line.121"></a>
+<span class="sourceLineNo">122</span>    *    &lt;li&gt;&lt;code&gt;Exception-Message:&lt;/code&gt; - The message returned by {@link Throwable#getMessage()}.<a name="line.122"></a>
+<span class="sourceLineNo">123</span>    *    &lt;li&gt;&lt;code&gt;Exception-Trace:&lt;/code&gt; - The stack trace of the exception returned by {@link Throwable#printStackTrace()}.<a name="line.123"></a>
+<span class="sourceLineNo">124</span>    * &lt;/ul&gt;<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    * &lt;p&gt;<a name="line.125"></a>
+<span class="sourceLineNo">126</span>    * Does nothing if the server-side exception could not be reconstructed.<a name="line.126"></a>
+<span class="sourceLineNo">127</span>    * &lt;p&gt;<a name="line.127"></a>
+<span class="sourceLineNo">128</span>    * Currently only supports &lt;code&gt;Throwables&lt;/code&gt; with either a public no-arg constructor<a name="line.128"></a>
+<span class="sourceLineNo">129</span>    * or a public constructor that takes in a simple string message.<a name="line.129"></a>
+<span class="sourceLineNo">130</span>    *<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    * @param cl The classloader to use to resolve the throwable class name.<a name="line.131"></a>
+<span class="sourceLineNo">132</span>    * @throws Throwable If the throwable could be reconstructed.<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    */<a name="line.133"></a>
+<span class="sourceLineNo">134</span>   protected void throwServerException(ClassLoader cl) throws Throwable {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>      if (serverExceptionName != null) {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>         Throwable t = null;<a name="line.136"></a>
+<span class="sourceLineNo">137</span>         try {<a name="line.137"></a>
+<span class="sourceLineNo">138</span>            Class&lt;?&gt; exceptionClass = cl.loadClass(serverExceptionName);<a name="line.138"></a>
+<span class="sourceLineNo">139</span>            Constructor&lt;?&gt; c = ClassUtils.findPublicConstructor(exceptionClass, String.class);<a name="line.139"></a>
+<span class="sourceLineNo">140</span>            if (c != null)<a name="line.140"></a>
+<span class="sourceLineNo">141</span>               t = (Throwable)c.newInstance(serverExceptionMessage);<a name="line.141"></a>
+<span class="sourceLineNo">142</span>            if (t == null) {<a name="line.142"></a>
+<span class="sourceLineNo">143</span>               c = ClassUtils.findPublicConstructor(exceptionClass);<a name="line.143"></a>
+<span class="sourceLineNo">144</span>               if (c != null)<a name="line.144"></a>
+<span class="sourceLineNo">145</span>                  t = (Throwable)c.newInstance();<a name="line.145"></a>
+<span class="sourceLineNo">146</span>            }<a name="line.146"></a>
+<span class="sourceLineNo">147</span>         } catch (Exception e2) { /* Ignore */ }<a name="line.147"></a>
+<span class="sourceLineNo">148</span>         if (t != null)<a name="line.148"></a>
+<span class="sourceLineNo">149</span>            throw t;<a name="line.149"></a>
+<span class="sourceLineNo">150</span>      }<a name="line.150"></a>
+<span class="sourceLineNo">151</span>   }<a name="line.151"></a>
+<span class="sourceLineNo">152</span><a name="line.152"></a>
+<span class="sourceLineNo">153</span>   /**<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    * Sets the HTTP response object that caused this exception.<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    *<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    * @param httpResponse The HTTP respose object.<a name="line.156"></a>
+<span class="sourceLineNo">157</span>    * @return This object (for method chaining).<a name="line.157"></a>
+<span class="sourceLineNo">158</span>    */<a name="line.158"></a>
+<span class="sourceLineNo">159</span>   protected RestCallException setHttpResponse(HttpResponse httpResponse) {<a name="line.159"></a>
+<span class="sourceLineNo">160</span>      this.httpResponse = httpResponse;<a name="line.160"></a>
+<span class="sourceLineNo">161</span>      return this;<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   }<a name="line.162"></a>
+<span class="sourceLineNo">163</span><a name="line.163"></a>
+<span class="sourceLineNo">164</span>   /**<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    * Returns the HTTP response object that caused this exception.<a name="line.165"></a>
+<span class="sourceLineNo">166</span>    *<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    * @return The HTTP response object that caused this exception, or &lt;jk&gt;null&lt;/jk&gt; if no response was created yet when the exception was thrown.<a name="line.167"></a>
+<span class="sourceLineNo">168</span>    */<a name="line.168"></a>
+<span class="sourceLineNo">169</span>   public HttpResponse getHttpResponse() {<a name="line.169"></a>
+<span class="sourceLineNo">170</span>      return this.httpResponse;<a name="line.170"></a>
+<span class="sourceLineNo">171</span>   }<a name="line.171"></a>
+<span class="sourceLineNo">172</span><a name="line.172"></a>
+<span class="sourceLineNo">173</span>   /**<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    * Returns the HTTP response status code.<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    *<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    * @return The response status code.  If a connection could not be made at all, returns &lt;code&gt;0&lt;/code&gt;.<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    */<a name="line.177"></a>
+<span class="sourceLineNo">178</span>   public int getResponseCode() {<a name="line.178"></a>
+<span class="sourceLineNo">179</span>      return responseCode;<a name="line.179"></a>
+<span class="sourceLineNo">180</span>   }<a name="line.180"></a>
+<span class="sourceLineNo">181</span><a name="line.181"></a>
+<span class="sourceLineNo">182</span>   /**<a name="line.182"></a>
+<span class="sourceLineNo">183</span>    * Returns the HTTP response message body text.<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    *<a name="line.184"></a>
+<span class="sourceLineNo">185</span>    * @return The response message body text.<a name="line.185"></a>
+<span class="sourceLineNo">186</span>    */<a name="line.186"></a>
+<span class="sourceLineNo">187</span>   public String getResponseMessage() {<a name="line.187"></a>
+<span class="sourceLineNo">188</span>      return response;<a name="line.188"></a>
+<span class="sourceLineNo">189</span>   }<a name="line.189"></a>
+<span class="sourceLineNo">190</span><a name="line.190"></a>
+<span class="sourceLineNo">191</span>   /**<a name="line.191"></a>
+<span class="sourceLineNo">192</span>    * Returns the response status message as a plain string.<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    *<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    * @return The response status message.<a name="line.194"></a>
+<span class="sourceLineNo">195</span>    */<a name="line.195"></a>
+<span class="sourceLineNo">196</span>   public String getResponseStatusMessage() {<a name="line.196"></a>
+<span class="sourceLineNo">197</span>      return responseStatusMessage;<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   }<a name="line.198"></a>
+<span class="sourceLineNo">199</span><a name="line.199"></a>
+<span class="sourceLineNo">200</span>   /**<a name="line.200"></a>
+<span class="sourceLineNo">201</span>    * Sets the inner cause for this exception.<a name="line.201"></a>
+<span class="sourceLineNo">202</span>    * @param cause The inner cause.<a name="line.202"></a>
+<span class="sourceLineNo">203</span>    * @return This object (for method chaining).<a name="line.203"></a>
+<span class="sourceLineNo">204</span>    */<a name="line.204"></a>
+<span class="sourceLineNo">205</span>   @Override /* Throwable */<a name="line.205"></a>
+<span class="sourceLineNo">206</span>   public synchronized RestCallException initCause(Throwable cause) {<a name="line.206"></a>
+<span class="sourceLineNo">207</span>      super.initCause(cause);<a name="line.207"></a>
+<span class="sourceLineNo">208</span>      return this;<a name="line.208"></a>
+<span class="sourceLineNo">209</span>   }<a name="line.209"></a>
+<span class="sourceLineNo">210</span>}<a name="line.210"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/236aea45/content/site/apidocs/src-html/org/apache/juneau/rest/client/RestCallLogger.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/client/RestCallLogger.html b/content/site/apidocs/src-html/org/apache/juneau/rest/client/RestCallLogger.html
index 9a47f37..0741b42 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/rest/client/RestCallLogger.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/rest/client/RestCallLogger.html
@@ -40,92 +40,98 @@
 <span class="sourceLineNo">032</span> */<a name="line.32"></a>
 <span class="sourceLineNo">033</span>public class RestCallLogger extends RestCallInterceptor {<a name="line.33"></a>
 <span class="sourceLineNo">034</span><a name="line.34"></a>
-<span class="sourceLineNo">035</span>   private Level level;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>   private Logger log;<a name="line.36"></a>
-<span class="sourceLineNo">037</span><a name="line.37"></a>
-<span class="sourceLineNo">038</span>   /**<a name="line.38"></a>
-<span class="sourceLineNo">039</span>    * Constructor.<a name="line.39"></a>
-<span class="sourceLineNo">040</span>    *<a name="line.40"></a>
-<span class="sourceLineNo">041</span>    * @param level The log level to log messages at.<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    * @param log The logger to log to.<a name="line.42"></a>
-<span class="sourceLineNo">043</span>    */<a name="line.43"></a>
-<span class="sourceLineNo">044</span>   protected RestCallLogger(Level level, Logger log) {<a name="line.44"></a>
-<span class="sourceLineNo">045</span>      this.level = level;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>      this.log = log;<a name="line.46"></a>
-<span class="sourceLineNo">047</span>   }<a name="line.47"></a>
-<span class="sourceLineNo">048</span><a name="line.48"></a>
-<span class="sourceLineNo">049</span>   @Override /* RestCallInterceptor */<a name="line.49"></a>
-<span class="sourceLineNo">050</span>   public void onInit(RestCall restCall) {<a name="line.50"></a>
-<span class="sourceLineNo">051</span>      if (log.isLoggable(level))<a name="line.51"></a>
-<span class="sourceLineNo">052</span>         restCall.captureResponse();<a name="line.52"></a>
+<span class="sourceLineNo">035</span>   /**<a name="line.35"></a>
+<span class="sourceLineNo">036</span>    * Default HTTP request logger.<a name="line.36"></a>
+<span class="sourceLineNo">037</span>    * Logs outgoing HTTP requests to the &lt;code&gt;org.apache.juneau.rest.client&lt;/code&gt; logger at &lt;jsf&gt;WARNING&lt;/jsf&gt; level.<a name="line.37"></a>
+<span class="sourceLineNo">038</span>    */<a name="line.38"></a>
+<span class="sourceLineNo">039</span>   public static final RestCallLogger DEFAULT = new RestCallLogger(Level.WARNING, Logger.getLogger("org.apache.juneau.rest.client"));<a name="line.39"></a>
+<span class="sourceLineNo">040</span><a name="line.40"></a>
+<span class="sourceLineNo">041</span>   private Level level;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>   private Logger log;<a name="line.42"></a>
+<span class="sourceLineNo">043</span><a name="line.43"></a>
+<span class="sourceLineNo">044</span>   /**<a name="line.44"></a>
+<span class="sourceLineNo">045</span>    * Constructor.<a name="line.45"></a>
+<span class="sourceLineNo">046</span>    *<a name="line.46"></a>
+<span class="sourceLineNo">047</span>    * @param level The log level to log messages at.<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    * @param log The logger to log to.<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    */<a name="line.49"></a>
+<span class="sourceLineNo">050</span>   protected RestCallLogger(Level level, Logger log) {<a name="line.50"></a>
+<span class="sourceLineNo">051</span>      this.level = level;<a name="line.51"></a>
+<span class="sourceLineNo">052</span>      this.log = log;<a name="line.52"></a>
 <span class="sourceLineNo">053</span>   }<a name="line.53"></a>
 <span class="sourceLineNo">054</span><a name="line.54"></a>
 <span class="sourceLineNo">055</span>   @Override /* RestCallInterceptor */<a name="line.55"></a>
-<span class="sourceLineNo">056</span>   public void onConnect(RestCall restCall, int statusCode, HttpRequest req, HttpResponse res) {<a name="line.56"></a>
-<span class="sourceLineNo">057</span>      // Do nothing.<a name="line.57"></a>
-<span class="sourceLineNo">058</span>   }<a name="line.58"></a>
-<span class="sourceLineNo">059</span><a name="line.59"></a>
-<span class="sourceLineNo">060</span>   @Override /* RestCallInterceptor */<a name="line.60"></a>
-<span class="sourceLineNo">061</span>   public void onRetry(RestCall restCall, int statusCode, HttpRequest req, HttpResponse res, Exception ex) {<a name="line.61"></a>
-<span class="sourceLineNo">062</span>      if (log.isLoggable(level)) {<a name="line.62"></a>
-<span class="sourceLineNo">063</span>         if (ex == null)<a name="line.63"></a>
-<span class="sourceLineNo">064</span>         log.log(level, MessageFormat.format("Call to {0} returned {1}.  Will retry.", req.getRequestLine().getUri(), statusCode)); //$NON-NLS-1$<a name="line.64"></a>
-<span class="sourceLineNo">065</span>         else<a name="line.65"></a>
-<span class="sourceLineNo">066</span>            log.log(level, MessageFormat.format("Call to {0} caused exception {1}.  Will retry.", req.getRequestLine().getUri(), ex.getLocalizedMessage()), ex); //$NON-NLS-1$<a name="line.66"></a>
-<span class="sourceLineNo">067</span>      }<a name="line.67"></a>
-<span class="sourceLineNo">068</span>   }<a name="line.68"></a>
-<span class="sourceLineNo">069</span><a name="line.69"></a>
-<span class="sourceLineNo">070</span>   @Override /* RestCallInterceptor */<a name="line.70"></a>
-<span class="sourceLineNo">071</span>   public void onClose(RestCall restCall) throws RestCallException {<a name="line.71"></a>
-<span class="sourceLineNo">072</span>      try {<a name="line.72"></a>
-<span class="sourceLineNo">073</span>         if (log.isLoggable(level)) {<a name="line.73"></a>
-<span class="sourceLineNo">074</span>            String output = restCall.getCapturedResponse();<a name="line.74"></a>
-<span class="sourceLineNo">075</span>            StringBuilder sb = new StringBuilder();<a name="line.75"></a>
-<span class="sourceLineNo">076</span>            HttpUriRequest req = restCall.getRequest();<a name="line.76"></a>
-<span class="sourceLineNo">077</span>            HttpResponse res = restCall.getResponse();<a name="line.77"></a>
-<span class="sourceLineNo">078</span>            if (req != null) {<a name="line.78"></a>
-<span class="sourceLineNo">079</span>               sb.append("\n=== HTTP Call ==================================================================");<a name="line.79"></a>
-<span class="sourceLineNo">080</span><a name="line.80"></a>
-<span class="sourceLineNo">081</span>               sb.append("\n=== REQUEST ===\n").append(req);<a name="line.81"></a>
-<span class="sourceLineNo">082</span>               sb.append("\n---request headers---");<a name="line.82"></a>
-<span class="sourceLineNo">083</span>               for (Header h : req.getAllHeaders())<a name="line.83"></a>
-<span class="sourceLineNo">084</span>                  sb.append("\n").append(h);<a name="line.84"></a>
-<span class="sourceLineNo">085</span>               if (req instanceof HttpEntityEnclosingRequestBase) {<a name="line.85"></a>
-<span class="sourceLineNo">086</span>                  sb.append("\n---request entity---");<a name="line.86"></a>
-<span class="sourceLineNo">087</span>                  HttpEntityEnclosingRequestBase req2 = (HttpEntityEnclosingRequestBase)req;<a name="line.87"></a>
-<span class="sourceLineNo">088</span>                  HttpEntity e = req2.getEntity();<a name="line.88"></a>
-<span class="sourceLineNo">089</span>                  if (e == null)<a name="line.89"></a>
-<span class="sourceLineNo">090</span>                     sb.append("\nEntity is null");<a name="line.90"></a>
-<span class="sourceLineNo">091</span>                  else {<a name="line.91"></a>
-<span class="sourceLineNo">092</span>                     if (e.getContentType() != null)<a name="line.92"></a>
-<span class="sourceLineNo">093</span>                        sb.append("\n").append(e.getContentType());<a name="line.93"></a>
-<span class="sourceLineNo">094</span>                     if (e.getContentEncoding() != null)<a name="line.94"></a>
-<span class="sourceLineNo">095</span>                        sb.append("\n").append(e.getContentEncoding());<a name="line.95"></a>
-<span class="sourceLineNo">096</span>                     if (e.isRepeatable()) {<a name="line.96"></a>
-<span class="sourceLineNo">097</span>                        try {<a name="line.97"></a>
-<span class="sourceLineNo">098</span>                           sb.append("\n---request content---\n").append(EntityUtils.toString(e));<a name="line.98"></a>
-<span class="sourceLineNo">099</span>                        } catch (Exception ex) {<a name="line.99"></a>
-<span class="sourceLineNo">100</span>                           throw new RuntimeException(ex);<a name="line.100"></a>
-<span class="sourceLineNo">101</span>                        }<a name="line.101"></a>
-<span class="sourceLineNo">102</span>                     }<a name="line.102"></a>
-<span class="sourceLineNo">103</span>                  }<a name="line.103"></a>
-<span class="sourceLineNo">104</span>               }<a name="line.104"></a>
-<span class="sourceLineNo">105</span>            }<a name="line.105"></a>
-<span class="sourceLineNo">106</span>            if (res != null) {<a name="line.106"></a>
-<span class="sourceLineNo">107</span>               sb.append("\n=== RESPONSE ===\n").append(res.getStatusLine());<a name="line.107"></a>
-<span class="sourceLineNo">108</span>               sb.append("\n---response headers---");<a name="line.108"></a>
-<span class="sourceLineNo">109</span>               for (Header h : res.getAllHeaders())<a name="line.109"></a>
-<span class="sourceLineNo">110</span>                  sb.append("\n").append(h);<a name="line.110"></a>
-<span class="sourceLineNo">111</span>               sb.append("\n---response content---\n").append(output);<a name="line.111"></a>
-<span class="sourceLineNo">112</span>               sb.append("\n=== END ========================================================================");<a name="line.112"></a>
-<span class="sourceLineNo">113</span>            }<a name="line.113"></a>
-<span class="sourceLineNo">114</span>            log.log(level, sb.toString());<a name="line.114"></a>
-<span class="sourceLineNo">115</span>         }<a name="line.115"></a>
-<span class="sourceLineNo">116</span>      } catch (IOException e) {<a name="line.116"></a>
-<span class="sourceLineNo">117</span>         log.log(Level.SEVERE, e.getLocalizedMessage(), e);<a name="line.117"></a>
-<span class="sourceLineNo">118</span>      }<a name="line.118"></a>
-<span class="sourceLineNo">119</span>   }<a name="line.119"></a>
-<span class="sourceLineNo">120</span>}<a name="line.120"></a>
+<span class="sourceLineNo">056</span>   public void onInit(RestCall restCall) {<a name="line.56"></a>
+<span class="sourceLineNo">057</span>      if (log.isLoggable(level))<a name="line.57"></a>
+<span class="sourceLineNo">058</span>         restCall.captureResponse();<a name="line.58"></a>
+<span class="sourceLineNo">059</span>   }<a name="line.59"></a>
+<span class="sourceLineNo">060</span><a name="line.60"></a>
+<span class="sourceLineNo">061</span>   @Override /* RestCallInterceptor */<a name="line.61"></a>
+<span class="sourceLineNo">062</span>   public void onConnect(RestCall restCall, int statusCode, HttpRequest req, HttpResponse res) {<a name="line.62"></a>
+<span class="sourceLineNo">063</span>      // Do nothing.<a name="line.63"></a>
+<span class="sourceLineNo">064</span>   }<a name="line.64"></a>
+<span class="sourceLineNo">065</span><a name="line.65"></a>
+<span class="sourceLineNo">066</span>   @Override /* RestCallInterceptor */<a name="line.66"></a>
+<span class="sourceLineNo">067</span>   public void onRetry(RestCall restCall, int statusCode, HttpRequest req, HttpResponse res, Exception ex) {<a name="line.67"></a>
+<span class="sourceLineNo">068</span>      if (log.isLoggable(level)) {<a name="line.68"></a>
+<span class="sourceLineNo">069</span>         if (ex == null)<a name="line.69"></a>
+<span class="sourceLineNo">070</span>         log.log(level, MessageFormat.format("Call to {0} returned {1}.  Will retry.", req.getRequestLine().getUri(), statusCode)); //$NON-NLS-1$<a name="line.70"></a>
+<span class="sourceLineNo">071</span>         else<a name="line.71"></a>
+<span class="sourceLineNo">072</span>            log.log(level, MessageFormat.format("Call to {0} caused exception {1}.  Will retry.", req.getRequestLine().getUri(), ex.getLocalizedMessage()), ex); //$NON-NLS-1$<a name="line.72"></a>
+<span class="sourceLineNo">073</span>      }<a name="line.73"></a>
+<span class="sourceLineNo">074</span>   }<a name="line.74"></a>
+<span class="sourceLineNo">075</span><a name="line.75"></a>
+<span class="sourceLineNo">076</span>   @Override /* RestCallInterceptor */<a name="line.76"></a>
+<span class="sourceLineNo">077</span>   public void onClose(RestCall restCall) throws RestCallException {<a name="line.77"></a>
+<span class="sourceLineNo">078</span>      try {<a name="line.78"></a>
+<span class="sourceLineNo">079</span>         if (log.isLoggable(level)) {<a name="line.79"></a>
+<span class="sourceLineNo">080</span>            String output = restCall.getCapturedResponse();<a name="line.80"></a>
+<span class="sourceLineNo">081</span>            StringBuilder sb = new StringBuilder();<a name="line.81"></a>
+<span class="sourceLineNo">082</span>            HttpUriRequest req = restCall.getRequest();<a name="line.82"></a>
+<span class="sourceLineNo">083</span>            HttpResponse res = restCall.getResponse();<a name="line.83"></a>
+<span class="sourceLineNo">084</span>            if (req != null) {<a name="line.84"></a>
+<span class="sourceLineNo">085</span>               sb.append("\n=== HTTP Call (outgoing) =======================================================");<a name="line.85"></a>
+<span class="sourceLineNo">086</span><a name="line.86"></a>
+<span class="sourceLineNo">087</span>               sb.append("\n=== REQUEST ===\n").append(req);<a name="line.87"></a>
+<span class="sourceLineNo">088</span>               sb.append("\n---request headers---");<a name="line.88"></a>
+<span class="sourceLineNo">089</span>               for (Header h : req.getAllHeaders())<a name="line.89"></a>
+<span class="sourceLineNo">090</span>                  sb.append("\n\t").append(h);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>               if (req instanceof HttpEntityEnclosingRequestBase) {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>                  sb.append("\n---request entity---");<a name="line.92"></a>
+<span class="sourceLineNo">093</span>                  HttpEntityEnclosingRequestBase req2 = (HttpEntityEnclosingRequestBase)req;<a name="line.93"></a>
+<span class="sourceLineNo">094</span>                  HttpEntity e = req2.getEntity();<a name="line.94"></a>
+<span class="sourceLineNo">095</span>                  if (e == null)<a name="line.95"></a>
+<span class="sourceLineNo">096</span>                     sb.append("\nEntity is null");<a name="line.96"></a>
+<span class="sourceLineNo">097</span>                  else {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>                     if (e.getContentType() != null)<a name="line.98"></a>
+<span class="sourceLineNo">099</span>                        sb.append("\n").append(e.getContentType());<a name="line.99"></a>
+<span class="sourceLineNo">100</span>                     if (e.getContentEncoding() != null)<a name="line.100"></a>
+<span class="sourceLineNo">101</span>                        sb.append("\n").append(e.getContentEncoding());<a name="line.101"></a>
+<span class="sourceLineNo">102</span>                     if (e.isRepeatable()) {<a name="line.102"></a>
+<span class="sourceLineNo">103</span>                        try {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>                           sb.append("\n---request content---\n").append(EntityUtils.toString(e));<a name="line.104"></a>
+<span class="sourceLineNo">105</span>                        } catch (Exception ex) {<a name="line.105"></a>
+<span class="sourceLineNo">106</span>                           throw new RuntimeException(ex);<a name="line.106"></a>
+<span class="sourceLineNo">107</span>                        }<a name="line.107"></a>
+<span class="sourceLineNo">108</span>                     }<a name="line.108"></a>
+<span class="sourceLineNo">109</span>                  }<a name="line.109"></a>
+<span class="sourceLineNo">110</span>               }<a name="line.110"></a>
+<span class="sourceLineNo">111</span>            }<a name="line.111"></a>
+<span class="sourceLineNo">112</span>            if (res != null) {<a name="line.112"></a>
+<span class="sourceLineNo">113</span>               sb.append("\n=== RESPONSE ===\n").append(res.getStatusLine());<a name="line.113"></a>
+<span class="sourceLineNo">114</span>               sb.append("\n---response headers---");<a name="line.114"></a>
+<span class="sourceLineNo">115</span>               for (Header h : res.getAllHeaders())<a name="line.115"></a>
+<span class="sourceLineNo">116</span>                  sb.append("\n\t").append(h);<a name="line.116"></a>
+<span class="sourceLineNo">117</span>               sb.append("\n---response content---\n").append(output);<a name="line.117"></a>
+<span class="sourceLineNo">118</span>               sb.append("\n=== END ========================================================================");<a name="line.118"></a>
+<span class="sourceLineNo">119</span>            }<a name="line.119"></a>
+<span class="sourceLineNo">120</span>            log.log(level, sb.toString());<a name="line.120"></a>
+<span class="sourceLineNo">121</span>         }<a name="line.121"></a>
+<span class="sourceLineNo">122</span>      } catch (IOException e) {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>         log.log(Level.SEVERE, e.getLocalizedMessage(), e);<a name="line.123"></a>
+<span class="sourceLineNo">124</span>      }<a name="line.124"></a>
+<span class="sourceLineNo">125</span>   }<a name="line.125"></a>
+<span class="sourceLineNo">126</span>}<a name="line.126"></a>
 
 
 


Mime
View raw message