From a5055bc67b26f40fb8025f65a886fc844556269f Mon Sep 17 00:00:00 2001 From: janv Date: Thu, 1 Feb 2018 22:52:36 +0000 Subject: [PATCH] MM-682 / MM-683: S3 Content Reference Handler - initial fix for "exists" check (causing http connection pool timeout) - fix compile error (port back to 0.3.N - since S3Object in SDK 1.4.7 does not support "close" method) --- .../content/handler/s3/S3ContentReferenceHandlerImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gytheio-content-handlers/gytheio-content-handler-s3/src/main/java/org/gytheio/content/handler/s3/S3ContentReferenceHandlerImpl.java b/gytheio-content-handlers/gytheio-content-handler-s3/src/main/java/org/gytheio/content/handler/s3/S3ContentReferenceHandlerImpl.java index 4279192f..883fc08a 100644 --- a/gytheio-content-handlers/gytheio-content-handler-s3/src/main/java/org/gytheio/content/handler/s3/S3ContentReferenceHandlerImpl.java +++ b/gytheio-content-handlers/gytheio-content-handler-s3/src/main/java/org/gytheio/content/handler/s3/S3ContentReferenceHandlerImpl.java @@ -224,10 +224,11 @@ public boolean isContentReferenceExists(ContentReference contentReference) } finally { - if (object != null) + if ((object != null) && (object.getObjectContent() != null)) { - try { - object.close(); + try + { + object.getObjectContent().close(); } catch (IOException ioe) {