From de83e9528fc4edc2f45fef9460b0bf51e2e643a8 Mon Sep 17 00:00:00 2001 From: Richard Millet Date: Mon, 25 Feb 2019 11:09:29 -0800 Subject: [PATCH] CC-308: Fixed issue downloading large blobs. --- .../services/common/imaging/nuxeo/NuxeoBlobUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoBlobUtils.java b/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoBlobUtils.java index 34c3af857..5cbc10a67 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoBlobUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoBlobUtils.java @@ -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. -- 2.47.3