camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r899559 - in /camel/trunk/components/camel-ftp/src: main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
Date Fri, 15 Jan 2010 08:25:04 GMT
Author: davsclaus
Date: Fri Jan 15 08:25:04 2010
New Revision: 899559

URL: http://svn.apache.org/viewvc?rev=899559&view=rev
Log:
CAMEL-2362: camel-ftp now allows starting directory with dot in the name.

Modified:
    camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
    camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java

Modified: camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java?rev=899559&r1=899558&r2=899559&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
(original)
+++ camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
Fri Jan 15 08:25:04 2010
@@ -63,12 +63,6 @@
         afterPropertiesSet();
         RemoteFileConsumer<T> consumer = buildConsumer(processor);
 
-        // we assume its a file if the name has a dot in it (eg foo.txt)
-        if (configuration.getDirectory().contains(".")) {
-            throw new IllegalArgumentException("Only directory is supported. Endpoint must
be configured with a valid directory: "
-                    + configuration.getDirectory());
-        }
-
         if (isDelete() && getMove() != null) {
             throw new IllegalArgumentException("You cannot both set delete=true and move
options");
         }

Modified: camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java?rev=899559&r1=899558&r2=899559&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
(original)
+++ camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
Fri Jan 15 08:25:04 2010
@@ -185,21 +185,16 @@
     }
 
     @Test
-    public void testInvalidStartingDirectory() throws Exception {
+    public void testStartingDirectoryWithDot() throws Exception {
         Endpoint endpoint = context.getEndpoint("ftp://user@hostname?password=secret");
         FtpEndpoint ftpEndpoint = assertIsInstanceOf(FtpEndpoint.class, endpoint);
         FtpConfiguration config = (FtpConfiguration) ftpEndpoint.getConfiguration();
         config.setHost("somewhere");
-        config.setDirectory("some/file.txt");
-        try {
-            ftpEndpoint.createConsumer(new Processor() {
-                public void process(Exchange exchange) throws Exception {
-                    // do nothing
-                }
-            });
-            fail("Should have thrown exception");
-        } catch (IllegalArgumentException e) {
-            assertEquals("Only directory is supported. Endpoint must be configured with a
valid directory: some/file.txt", e.getMessage());
-        }
+        config.setDirectory("temp.dir");
+        ftpEndpoint.createConsumer(new Processor() {
+            public void process(Exchange exchange) throws Exception {
+                // do nothing
+            }
+        });
     }
 }
\ No newline at end of file



Mime
View raw message