public static HttpEntity newBufferedHttpEntity ( HttpEntity entity ) throws FakeIOException { try { return new BufferedHttpEntity ( entity ) ; } catch ( FakeIOException e ) { // Only for test simulation. throw e ; } catch ( IOException e ) { throw new SdkClientException ( "Unable to create HTTP entity: " + e . getMessage ( ) , e ) ; } }
Utility function for creating a new BufferedEntity and wrapping any errors as a SdkClientException .