camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r738467 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java
Date Wed, 28 Jan 2009 12:15:07 GMT
Author: davsclaus
Date: Wed Jan 28 12:15:07 2009
New Revision: 738467

URL: http://svn.apache.org/viewvc?rev=738467&view=rev
Log:
CAMEL-1241: added genericfile<file> converters where we have file as well.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
    camel/trunk/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java?rev=738467&r1=738466&r2=738467&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java Wed
Jan 28 12:15:07 2009
@@ -26,6 +26,7 @@
 
 import org.apache.camel.Converter;
 import org.apache.camel.Exchange;
+import org.apache.camel.component.file.GenericFile;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -61,6 +62,11 @@
     }
 
     @Converter
+    public static ByteBuffer toByteBuffer(GenericFile<File> file) throws IOException
{
+        return toByteBuffer(file.getFile());
+    }
+
+    @Converter
     public static ByteBuffer toByteBuffer(File file) throws IOException {
         InputStream in = null;
         try {

Modified: camel/trunk/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java?rev=738467&r1=738466&r2=738467&view=diff
==============================================================================
--- camel/trunk/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java
(original)
+++ camel/trunk/components/camel-xmlbeans/src/main/java/org/apache/camel/converter/xmlbeans/XmlBeansConverter.java
Wed Jan 28 12:15:07 2009
@@ -32,6 +32,7 @@
 
 import org.apache.camel.Converter;
 import org.apache.camel.Exchange;
+import org.apache.camel.component.file.GenericFile;
 import org.apache.camel.converter.IOConverter;
 import org.apache.camel.converter.NIOConverter;
 import org.apache.camel.converter.jaxp.XmlConverter;
@@ -50,6 +51,11 @@
     private XmlConverter xmlConverter = new XmlConverter();
 
     @Converter
+    public static XmlObject toXmlObject(GenericFile<File> value) throws IOException,
XmlException {
+        return toXmlObject(value.getFile());
+    }
+
+    @Converter
     public static XmlObject toXmlObject(File value) throws IOException, XmlException {
         return XmlObject.Factory.parse(value);
     }



Mime
View raw message