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 2020/12/09 14:51:29 UTC

[camel] branch CAMEL-15915 created (now b531996)

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

davsclaus pushed a change to branch CAMEL-15915
in repository https://gitbox.apache.org/repos/asf/camel.git.


      at b531996  CAMEL-15915: remote type converter that may cause problems for camel-ftp tests.

This branch includes the following new commits:

     new b531996  CAMEL-15915: remote type converter that may cause problems for camel-ftp tests.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel] 01/01: CAMEL-15915: remote type converter that may cause problems for camel-ftp tests.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b53199693c5ef9885e2bc375584cd6d0b9857cab
Author: Claus Ibsen <cl...@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