From a036977555769b38498c6ad0b3d600650dff5528 Mon Sep 17 00:00:00 2001 From: dominik-cnx <30789476+dominik-cnx@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:19:34 +0700 Subject: [PATCH] formatting fixed --- .../org/swisspush/reststorage/s3/S3FileSystemStorage.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/swisspush/reststorage/s3/S3FileSystemStorage.java b/src/main/java/org/swisspush/reststorage/s3/S3FileSystemStorage.java index 461769e..e4780e2 100644 --- a/src/main/java/org/swisspush/reststorage/s3/S3FileSystemStorage.java +++ b/src/main/java/org/swisspush/reststorage/s3/S3FileSystemStorage.java @@ -129,7 +129,7 @@ public S3FileSystemStorage(Vertx vertx, RestStorageExceptionFactory exceptionFac // Cache string length of root without trailing slashes int rootLen; - for (rootLen = tmpRoot.length() - 1; tmpRoot.charAt(rootLen) == '/'; --rootLen); + for (rootLen = tmpRoot.length() - 1; tmpRoot.charAt(rootLen) == '/'; --rootLen) ; this.rootLen = rootLen; } @@ -146,8 +146,8 @@ public void get(String path, String etag, final int offset, final int count, fin if (Files.isRegularFile(fullFilePath, LinkOption.NOFOLLOW_LINKS)) { log.debug("Open file '{}' ({})", path, fullFilePath); DocumentResource d = new DocumentResource(); - // DON'T close it with try or finally, async code try { + // the stream is closed in the closeHandler / errorHandler, see further down final InputStream inputStream = Files.newInputStream(fullFilePath); d.length = Files.size(fullFilePath); log.debug("Successfully opened '{}' which is {} bytes in size.", path, d.length); @@ -156,8 +156,8 @@ public void get(String path, String etag, final int offset, final int count, fin d.readStream = readStream; final Runnable cleanUp = () -> { - if (!readStream.isClosed()){ - readStream.close(); + if (!readStream.isClosed()) { + readStream.close(); } try { inputStream.close();