From: Richard Millet Date: Mon, 25 Feb 2019 19:09:29 +0000 (-0800) Subject: CC-308: Fixed issue downloading large blobs. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=de83e9528fc4edc2f45fef9460b0bf51e2e643a8;p=tmp%2Fjakarta-migration.git CC-308: Fixed issue downloading large blobs. --- 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.