2020import com .spectralogic .ds3client .serializer .XmlOutput ;
2121
2222import org .apache .commons .io .IOUtils ;
23+ import org .slf4j .Logger ;
24+ import org .slf4j .LoggerFactory ;
2325
2426import java .io .IOException ;
2527import java .io .InputStream ;
2628import java .io .StringWriter ;
2729
2830public abstract class BulkResponse extends AbstractResponse {
31+ private final static Logger LOG = LoggerFactory .getLogger (BulkResponse .class );
2932 private MasterObjectList result ;
3033 public BulkResponse (final WebResponse response ) throws IOException {
3134 super (response );
@@ -39,10 +42,10 @@ public MasterObjectList getResult() {
3942 protected void processResponse () throws IOException {
4043 try (final WebResponse response = this .getResponse ()) {
4144 this .checkStatusCode (200 );
42- try (final StringWriter writer = new StringWriter ();
43- final InputStream content = response . getResponseStream ()) {
44- IOUtils . copy (content , writer , UTF8 );
45- this . result = XmlOutput . fromXml ( writer . toString (), MasterObjectList . class );
45+ try (final InputStream content = response . getResponseStream ()) {
46+ LOG . debug ( "Starting bulk response parsing" );
47+ this . result = XmlOutput . fromXml (content , MasterObjectList . class );
48+ LOG . debug ( "Finished bulk response parsing" );
4649 }
4750 }
4851 }
0 commit comments