Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.WebResource.Builder;
import com.sun.jersey.core.header.InBoundHeaders;
import com.sun.jersey.core.util.ReaderWriter;

public class TableRestProxy implements TableContract {
private static final String API_VERSION = "2011-08-18";
Expand Down Expand Up @@ -662,7 +663,13 @@ public BatchResult batch(BatchOperations operations, TableServiceOptions options
ThrowIfError(response);

BatchResult result = new BatchResult();
result.setEntries(parseBatchResponse(response, operations));

try {
result.setEntries(parseBatchResponse(response, operations));
}
catch (IOException e) {
throw new ServiceException(e);
}

return result;
}
Expand Down Expand Up @@ -781,7 +788,14 @@ private DataSource createBatchDeleteEntityPart(String table, String partitionKey
return bodyPartContent;
}

private List<Entry> parseBatchResponse(ClientResponse response, BatchOperations operations) {
private List<Entry> parseBatchResponse(ClientResponse response, BatchOperations operations) throws IOException {
// Default stream cannot be reset, but it is needed by multiple parts of this method.
// Replace the default response stream with one that can be read multiple times.
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
InputStream inputStream = response.getEntityInputStream();
ReaderWriter.writeTo(inputStream, byteArrayOutputStream);
response.setEntityInputStream(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()));

List<DataSource> parts = mimeReaderWriter.parseParts(response.getEntityInputStream(), response.getHeaders()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the indentation of this line appear to be incorrect, I believe the team uses 4 character soft tab.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw what you were talking about, then I couldn't repo the issue. Might be a browser rendering issue.
Regardless, I've verified there are not tabs in the code.

.getFirst("Content-Type"));

Expand Down