This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 34e086a  Drop Java 8
34e086a is described below

commit 34e086affe5e390121e276a06bb5c16470ae7f6a
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sat Dec 25 09:16:45 2021 +0100

    Drop Java 8
---
 .../main/java/org/apache/camel/component/file/FileOperations.java  | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git 
a/components/camel-file/src/main/java/org/apache/camel/component/file/FileOperations.java
 
b/components/camel-file/src/main/java/org/apache/camel/component/file/FileOperations.java
index 4d6710e..cfe03cd 100644
--- 
a/components/camel-file/src/main/java/org/apache/camel/component/file/FileOperations.java
+++ 
b/components/camel-file/src/main/java/org/apache/camel/component/file/FileOperations.java
@@ -80,7 +80,7 @@ public class FileOperations implements 
GenericFileOperations<File> {
 
     @Override
     public boolean renameFile(String from, String to) throws 
GenericFileOperationFailedException {
-        boolean renamed = false;
+        boolean renamed;
         File file = new File(from);
         File target = new File(to);
         try {
@@ -456,7 +456,6 @@ public class FileOperations implements 
GenericFileOperations<File> {
 
     private void writeFileByStream(InputStream in, File target) throws 
IOException {
         try (SeekableByteChannel out = prepareOutputFileChannel(target)) {
-
             LOG.debug("Using InputStream to write file: {}", target);
             int size = endpoint.getBufferSize();
             byte[] buffer = new byte[size];
@@ -464,12 +463,10 @@ public class FileOperations implements 
GenericFileOperations<File> {
             int bytesRead;
             while ((bytesRead = in.read(buffer)) != -1) {
                 if (bytesRead < size) {
-                    // to be compatible with java 8
                     Buffer buf = byteBuffer;
                     buf.limit(bytesRead);
                 }
                 out.write(byteBuffer);
-                // to be compatible with java 8
                 Buffer buf = byteBuffer;
                 buf.clear();
             }
@@ -478,11 +475,9 @@ public class FileOperations implements 
GenericFileOperations<File> {
             if (append && endpoint.getAppendChars() != null) {
                 byteBuffer = 
ByteBuffer.wrap(endpoint.getAppendChars().getBytes());
                 out.write(byteBuffer);
-                // to be compatible with java 8
                 Buffer buf = byteBuffer;
                 buf.clear();
             }
-
         } finally {
             IOHelper.close(in, target.getName(), LOG);
         }

Reply via email to