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

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


The following commit(s) were added to refs/heads/master by this push:
     new 7cae96f  CAMEL-15915: remote type converter that may cause problems 
for camel-ftp tests.
7cae96f is described below

commit 7cae96f399712217eee278f9cba5568b456d5c28
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Wed Dec 9 15:50:58 2020 +0100

    CAMEL-15915: remote type converter that may cause problems for camel-ftp 
tests.
---
 .../camel/component/file/GenericFileConverterLoader.java |  2 --
 .../camel/component/file/GenericFileConverter.java       | 16 ----------------
 2 files changed, 18 deletions(-)

diff --git 
a/components/camel-file/src/generated/java/org/apache/camel/component/file/GenericFileConverterLoader.java
 
b/components/camel-file/src/generated/java/org/apache/camel/component/file/GenericFileConverterLoader.java
index 013dd28..72ad802 100644
--- 
a/components/camel-file/src/generated/java/org/apache/camel/component/file/GenericFileConverterLoader.java
+++ 
b/components/camel-file/src/generated/java/org/apache/camel/component/file/GenericFileConverterLoader.java
@@ -26,8 +26,6 @@ public final class GenericFileConverterLoader implements 
TypeConverterLoader {
     }
 
     private void registerConverters(TypeConverterRegistry registry) {
-        addTypeConverter(registry, byte[].class, 
org.apache.camel.component.file.GenericFile.class, false,
-            (type, exchange, value) -> 
org.apache.camel.component.file.GenericFileConverter.genericFileToByteArray((org.apache.camel.component.file.GenericFile)
 value, exchange));
         addTypeConverter(registry, java.io.InputStream.class, 
org.apache.camel.component.file.GenericFile.class, false,
             (type, exchange, value) -> 
org.apache.camel.component.file.GenericFileConverter.genericFileToInputStream((org.apache.camel.component.file.GenericFile)
 value, exchange));
         addTypeConverter(registry, java.io.Reader.class, 
org.apache.camel.component.file.GenericFile.class, false,
diff --git 
a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
 
b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
index 55f6cd9..6cf547c 100644
--- 
a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
+++ 
b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
@@ -136,22 +136,6 @@ public final class GenericFileConverter {
     }
 
     @Converter
-    public static byte[] genericFileToByteArray(GenericFile<?> file, Exchange 
exchange) throws IOException {
-        String str = genericFileToString(file, exchange);
-        if (str != null) {
-            // and use charset if the exchange was explicit configured or the 
file was configured, and fallback to system
-            String charset = ExchangeHelper.getCharsetName(exchange, false);
-            if (charset != null) {
-                return str.getBytes(charset);
-            } else {
-                return str.getBytes();
-            }
-        } else {
-            return null;
-        }
-    }
-
-    @Converter
     public static String genericFileToString(GenericFile<?> file, Exchange 
exchange)
             throws IOException {
         // use reader first as it supports the file charset

Reply via email to