Skip to content

Commit

Permalink
formatting fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-cnx committed Nov 12, 2024
1 parent 74ddd0d commit a036977
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit a036977

Please sign in to comment.