You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/09/09 11:30:41 UTC

[camel] 01/02: Windows does not throw FileNotFoundException (#8335)

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

commit 4b40d4312437c235ca0977027f99184da0dd9021
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Sep 9 13:21:46 2022 +0200

    Windows does not throw FileNotFoundException (#8335)
---
 .../file/strategy/GenericFileRenameExclusiveReadLockStrategy.java    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/GenericFileRenameExclusiveReadLockStrategy.java b/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/GenericFileRenameExclusiveReadLockStrategy.java
index 2a130fc3924..389f1611f30 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/GenericFileRenameExclusiveReadLockStrategy.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/strategy/GenericFileRenameExclusiveReadLockStrategy.java
@@ -16,8 +16,7 @@
  */
 package org.apache.camel.component.file.strategy;
 
-import java.io.FileNotFoundException;
-import java.nio.file.FileSystemException;
+import java.io.IOException;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.LoggingLevel;
@@ -80,7 +79,7 @@ public class GenericFileRenameExclusiveReadLockStrategy<T> implements GenericFil
             try {
                 exclusive = operations.renameFile(file.getAbsoluteFilePath(), newFile.getAbsoluteFilePath());
             } catch (GenericFileOperationFailedException ex) {
-                if (ex.getCause() instanceof FileNotFoundException || ex.getCause() instanceof FileSystemException) {
+                if (ex.getCause() instanceof IOException) {
                     exclusive = false;
                 } else {
                     throw ex;