Process multi-line "contents" variable when printing a file

This commit is contained in:
Francois Steyn 2016-05-09 13:03:41 +02:00
parent 4f0b3208a8
commit 7ef283df90
1 changed files with 8 additions and 0 deletions

View File

@ -312,6 +312,14 @@ public final class ApiConnectionImpl extends ApiConnection {
if (parts.length == 3) { if (parts.length == 3) {
if (!parts[2].endsWith("\r")) { if (!parts[2].endsWith("\r")) {
res.put(parts[1], unpackResult(parts[2])); res.put(parts[1], unpackResult(parts[2]));
} else {
final StringBuilder sb = new StringBuilder();
sb.append(parts[2]);
while (!lines.isEmpty()) {
nextLine();
sb.append(line);
}
res.put(parts[1], sb.toString());
} }
} else { } else {
throw new ApiDataException(String.format("Malformed line '%s'", line)); throw new ApiDataException(String.format("Malformed line '%s'", line));