Skip to content

Commit 59f02e4

Browse files
committed
Adding logging around the bulk xml response parsing.
1 parent f1d7e99 commit 59f02e4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/BulkResponse.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@
2020
import com.spectralogic.ds3client.serializer.XmlOutput;
2121

2222
import org.apache.commons.io.IOUtils;
23+
import org.slf4j.Logger;
24+
import org.slf4j.LoggerFactory;
2325

2426
import java.io.IOException;
2527
import java.io.InputStream;
2628
import java.io.StringWriter;
2729

2830
public 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

Comments
 (0)