camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r790177 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/component/file/ camel-core/src/test/java/org/apache/camel/language/ components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/
Date Wed, 01 Jul 2009 14:13:46 GMT
Author: hadrian
Date: Wed Jul  1 14:13:46 2009
New Revision: 790177

URL: http://svn.apache.org/viewvc?rev=790177&view=rev
Log:
CAMEL-1078.  More cleanup.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java
    camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/DefaultRemoteFileSorter.java
    camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java?rev=790177&r1=790176&r2=790177&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java
Wed Jul  1 14:13:46 2009
@@ -32,12 +32,6 @@
     }
 
     @Override
-    @SuppressWarnings("unchecked")
-    public GenericFileExchange<T> getExchange() {
-        return (GenericFileExchange<T>) super.getExchange();
-    }
-
-    @Override
     protected Object createBody() {
         return file != null ? file.getBody() : super.createBody();
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java?rev=790177&r1=790176&r2=790177&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java Wed
Jul  1 14:13:46 2009
@@ -28,7 +28,6 @@
 import org.apache.camel.component.file.FileConsumer;
 import org.apache.camel.component.file.FileEndpoint;
 import org.apache.camel.component.file.GenericFile;
-import org.apache.camel.component.file.GenericFileExchange;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.language.simple.FileLanguage;
 
@@ -120,7 +119,7 @@
 
         FileEndpoint endpoint = getMandatoryEndpoint(uri, FileEndpoint.class);
 
-        GenericFileExchange<File> answer = endpoint.createExchange(gf);
+        Exchange answer = endpoint.createExchange(gf);
         endpoint.configureMessage(gf, answer.getIn());
 
         Calendar cal = GregorianCalendar.getInstance();

Modified: camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/DefaultRemoteFileSorter.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/DefaultRemoteFileSorter.java?rev=790177&r1=790176&r2=790177&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/DefaultRemoteFileSorter.java
(original)
+++ camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/DefaultRemoteFileSorter.java
Wed Jul  1 14:13:46 2009
@@ -18,8 +18,8 @@
 
 import java.util.Comparator;
 
+import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
-import org.apache.camel.component.file.GenericFileExchange;
 import org.apache.camel.language.simple.FileLanguage;
 import org.apache.camel.util.ObjectHelper;
 
@@ -94,7 +94,7 @@
      * @param reverse    true to reverse order
      * @return the comparator
      */
-    public static Comparator<GenericFileExchange> sortByFileLanguage(final String expression,
final boolean reverse) {
+    public static Comparator<Exchange> sortByFileLanguage(final String expression,
final boolean reverse) {
         return sortByFileLanguage(expression, reverse, false, null);
     }
 
@@ -106,8 +106,8 @@
      * @param ignoreCase ignore case if comparing strings
      * @return the comparator
      */
-    public static Comparator<GenericFileExchange> sortByFileLanguage(final String expression,
final boolean reverse,
-                                                                    final boolean ignoreCase)
{
+    public static Comparator<Exchange> sortByFileLanguage(
+        final String expression, final boolean reverse, final boolean ignoreCase) {
         return sortByFileLanguage(expression, reverse, ignoreCase, null);
     }
 
@@ -120,12 +120,12 @@
      * @param nested     nested comparator for sub group sorting, can be null
      * @return the comparator
      */
-    public static Comparator<GenericFileExchange> sortByFileLanguage(
+    public static Comparator<Exchange> sortByFileLanguage(
         final String expression, final boolean reverse,
-        final boolean ignoreCase, final Comparator<GenericFileExchange> nested) {
+        final boolean ignoreCase, final Comparator<Exchange> nested) {
         
-        return new Comparator<GenericFileExchange>() {
-            public int compare(GenericFileExchange o1, GenericFileExchange o2) {
+        return new Comparator<Exchange>() {
+            public int compare(Exchange o1, Exchange o2) {
                 final Expression exp = FileLanguage.file(expression);
                 Object result1 = exp.evaluate(o1, Object.class);
                 Object result2 = exp.evaluate(o2, Object.class);

Modified: camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java?rev=790177&r1=790176&r2=790177&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
(original)
+++ camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
Wed Jul  1 14:13:46 2009
@@ -49,15 +49,15 @@
 
     @SuppressWarnings("unchecked")
     public void process(Exchange exchange) throws Exception {
-        GenericFileExchange remoteExchange = (GenericFileExchange) getEndpoint().createExchange(exchange);
-        processExchange(remoteExchange);
+        Exchange remoteExchange = getEndpoint().createExchange(exchange);
+        processExchange((GenericFileExchange<T>)remoteExchange);
         ExchangeHelper.copyResults(exchange, remoteExchange);
     }
 
     /**
      * The file could not be written. We need to disconnect from the remote server.
      */
-    protected void handleFailedWrite(GenericFileExchange<T> exchange, Exception exception)
throws Exception {
+    protected void handleFailedWrite(Exchange exchange, Exception exception) throws Exception
{
         loggedIn = false;
         if (isStopping() || isStopped()) {
             // if we are stopping then ignore any exception during a poll



Mime
View raw message