static AzureAsyncOperation fromResponse ( SerializerAdapter < ? > serializerAdapter , Response < ResponseBody > response ) throws CloudException { AzureAsyncOperation asyncOperation = null ; String rawString = null ; if ( response . body ( ) != null ) { try { rawString = response . body ( ) . string ( ) ; asyncOperation = serializerAdapter . deserialize ( rawString , AzureAsyncOperation . class ) ; } catch ( IOException exception ) { // Exception will be handled below } finally { response . body ( ) . close ( ) ; } } if ( asyncOperation == null || asyncOperation . status ( ) == null ) { throw new CloudException ( "polling response does not contain a valid body: " + rawString , response ) ; } else { asyncOperation . rawString = rawString ; } return asyncOperation ; }
Creates AzureAsyncOperation from the given HTTP response .