camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon (JIRA)" <>
Subject [jira] Created: (CAMEL-2362) FTP assumes that directory name do not have dot
Date Thu, 14 Jan 2010 11:54:43 GMT
FTP assumes that directory name do not have dot 

                 Key: CAMEL-2362
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-ftp
    Affects Versions: 2.1.0
            Reporter: Simon

(COpy paste)
> I have the following error:
> Caused by: java.lang.IllegalArgumentException: Only directory is supported.
> Endpoint must be configured with a valid directory: ftp.test
>        at
> org.apache.camel.component.file.remote.RemoteFileEndpoint.createConsumer(
>        at
> org.apache.camel.component.file.remote.RemoteFileEndpoint.createConsumer(
>        at
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(
>        at
> org.apache.camel.impl.DefaultRoute.onStartingServices(
>        at org.apache.camel.impl.RouteService.doStart(
>        at org.apache.camel.impl.ServiceSupport.start(
>        at
> org.apache.camel.impl.DefaultCamelContext.start(
>        ... 1 more
> By looking at the source code I saw the following :
>        // 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());
>        }
> I remove that code and my code is working!! :-)
> I think the above code should not assume that.....
> What do you think ?
... [show rest of quote]

Its really a bad habit having a dot in a directory name.
On windows will that not often be considered a file?.

And since its a remote path we cannot on startup determine if its a
path or file.

The check was made in the transition from 1.x to 2.x where in 1.x you
could define a starting file or directory.
In 2.x you must specify a directory only.

We could relax the check but then people may still enter a filename
and think Camel will pickup that file.

Windows directory can contains a dot... a good example is in your eclipse installation...
Directory name=org.eclipse.emf.teneo.jpox_1.0.1.v200902271808

Also I think that check is useless because you can still enter something without a dot and
it is in fact a file... so the endpoint should verify that after the connection.


Yeah good call

Do you mind creating a ticket in JIRA about this?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message