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

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

commit 7a990a6482a6f045db0108e807a645e25013ca70
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Fri Mar 24 14:03:47 2023 +0100

    (chores) camel-file: use builtin Java methods for data conversion
---
 .../src/main/java/org/apache/camel/component/file/GenericFile.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFile.java
 
b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFile.java
index 19b85360b28..03480973257 100644
--- 
a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFile.java
+++ 
b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFile.java
@@ -216,7 +216,7 @@ public class GenericFile<T> implements WrappedFile<T> {
         // Make sure the names is normalized.
         String newFileName = FileUtil.normalizePath(newName);
         String newEndpointPath = FileUtil.normalizePath(
-                endpointPath.endsWith("" + File.separatorChar) ? endpointPath 
: endpointPath + File.separatorChar);
+                endpointPath.endsWith(String.valueOf(File.separatorChar)) ? 
endpointPath : endpointPath + File.separatorChar);
 
         LOG.trace("Normalized endpointPath: {}", newEndpointPath);
         LOG.trace("Normalized newFileName: {}", newFileName);
@@ -230,7 +230,7 @@ public class GenericFile<T> implements WrappedFile<T> {
                 // use File.separatorChar as the normalizePath uses this as 
path
                 // separator so we should use the same
                 // in this logic here
-                if (newEndpointPath.endsWith("" + File.separatorChar)) {
+                if 
(newEndpointPath.endsWith(String.valueOf(File.separatorChar))) {
                     newFileName = StringHelper.after(newFileName, 
newEndpointPath);
                 } else {
                     newFileName = StringHelper.after(newFileName, 
newEndpointPath + File.separatorChar);

Reply via email to