> @@ -119,4 +129,9 @@ private static boolean hasPayload(final HttpResponse
> response) {
> return response.getPayload() != null &&
> response.getPayload().getRawContent() != null;
> }
>
> + private static boolean isSoapPayload( final InputStream is ) throws
> IOException {
> + String content = CharStreams.toString( new InputStreamReader( is,
> Charsets.UTF_8 ) );
> + is.reset();
> + return endSoapTag.matcher( content ).find();
> + }
Hmmm, so now we're buffering the input stream in memory twice: first to check
if it is a SOAP payload, and then to actually parse the payload and see if it
is an error. Could the same be done without this extra stream processing? Would
the `faultHandler.parse(in);` fail, or can we use the parser (directly or
indirectly) to cover that case too?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/128/files#r23725366