This is an automated email from the ASF dual-hosted git repository.
gfournier 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 e9a5e4aa9858 Revert to use FileUtils instead of built-in Files
e9a5e4aa9858 is described below
commit e9a5e4aa98586c28a206d7b171c0ea292ed481fa
Author: Aurélien Pupier <[email protected]>
AuthorDate: Fri Mar 6 08:42:25 2026 +0100
Revert to use FileUtils instead of built-in Files
* using Files is not taking care of all cases, if the target folder was
cleaned, the parent folders are not created, it requires additional
lines of code compared to the FileUtils of commons.io
* use the non-deprecated version of FileUtils with charset
Signed-off-by: Aurélien Pupier <[email protected]>
---
.../component/file/remote/mina/sftp/SftpFromSedaDeleteFileIT.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git
a/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/sftp/SftpFromSedaDeleteFileIT.java
b/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/sftp/SftpFromSedaDeleteFileIT.java
index b363caa73ef6..12599bad33b1 100644
---
a/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/sftp/SftpFromSedaDeleteFileIT.java
+++
b/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/sftp/SftpFromSedaDeleteFileIT.java
@@ -19,11 +19,11 @@ package org.apache.camel.component.file.remote.mina.sftp;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
import java.util.concurrent.TimeUnit;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Test;
import static org.awaitility.Awaitility.await;
@@ -63,8 +63,7 @@ public class SftpFromSedaDeleteFileIT extends
SftpServerTestSupport {
private void createSampleFile() throws IOException {
File file = new File(service.getFtpRootDir() + "/" + "foo.txt");
-
- Files.writeString(file.toPath(), "Hello World this file will be
deleted", StandardCharsets.UTF_8);
+ FileUtils.writeStringToFile(file, "Hello World this file will be
deleted", StandardCharsets.UTF_8);
}
@Override