]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CC-308: Fixed issue downloading large blobs.
authorRichard Millet <remillet@gmail.com>
Mon, 25 Feb 2019 19:09:29 +0000 (11:09 -0800)
committerRichard Millet <remillet@gmail.com>
Mon, 25 Feb 2019 19:09:29 +0000 (11:09 -0800)
services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoBlobUtils.java

index 34c3af8575966e536cf482be83048532c699b7d3..5cbc10a676fa706ccbf4362200e812abd2cca58e 100644 (file)
@@ -999,7 +999,7 @@ public class NuxeoBlobUtils {
                if (blob != null) {
                        try {
                                InputStream blobStream = blob.getStream(); // By default, the result will be whatever stream Nuxeo returns to us.
-                               int blobSize = blobsCommon.getLength() != null ? Integer.parseInt(blobsCommon.getLength()) : 0;
+                               long blobSize = blobsCommon.getLength() != null ? Long.parseLong(blobsCommon.getLength()) : 0;
                                if (blobSize > 0 && blobSize < MAX_IMAGE_BUFFER) {
                                        byte[] bytes = IOUtils.toByteArray(blobStream);
                                        blobStream.close(); // Close the InputStream that we got from Nuxeo since it's usually a FileInputStream -we definitely want FileInputStreams closed.