You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by tourist604 <id...@skrypnyk.net> on 2008/08/08 20:49:59 UTC

FileEndpoing "consumer.recursive" is misleading

Hi,

I think the "consumer.recursive" parameter which can be passed to a polling
FileEndpoint is misleading. The way I read it (and perhaps others) is that
subdirectories of the passed directory are not scanned for files. Instead,
recursive=false will prevent any directory scanning at all:

(Camel 1.4.0)

in FileConsumer, line 57:

int rc = pollFileOrDirectory(endpoint.getFile(), isRecursive());

in FileConsumer, line 75:

protected int pollFileOrDirectory(File fileOrDirectory, boolean processDir)
{
     if (!fileOrDirectory.isDirectory()) {
            return pollFile(fileOrDirectory); // process the file
     } else if (processDir) {
...
} else {
         LOG.debug("Skipping directory " + fileOrDirectory); // <!-- when
uri is directory and recursive=false
        return 0;
}

I think a "recursive" parameter meaning whether to scan subdirectories is
useful. Perhaps some renaming is in order.

Cheers,
--Bill


-- 
View this message in context: http://www.nabble.com/FileEndpoing-%22consumer.recursive%22-is-misleading-tp18897261s22882p18897261.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: FileEndpoing "consumer.recursive" is misleading

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Ah I see what you say now.

If recursive=false and the URI is a directory then nothing is consumed.
If recursive=false and the URI is a file then the file is consumed.

Yes it should actually be able to scan the first dir if recursive=false.
Well create a jira about this so we can get it fixed asap.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: tourist604 [mailto:idea@skrypnyk.net] 
Sent: 9. august 2008 11:43
To: camel-user@activemq.apache.org
Subject: RE: FileEndpoing "consumer.recursive" is misleading


Hello Claus,

Thanks for the reply.

In this case, the option doesn't appear to work as it fails to scan the
first directory level. 

--Bill



Claus Ibsen wrote:
> 
> Hi
> 
> Yes it's used for scanning sub directories. Maybe the option should be
> renamed to something more intuitive (subfolder / subdir) or anyone got a
> better name?
> 
> The description is wiki is currently:
> if a directory, will look for changes in files in all the sub directories.
> Notice: Default value in Camel 1.4 or older is true. In Camel 1.5 the
> default value is changed to false.
> 
> 
> Anything we should change here?
> 
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> -----Original Message-----
> From: tourist604 [mailto:idea@skrypnyk.net] 
> Sent: 8. august 2008 20:50
> To: camel-user@activemq.apache.org
> Subject: FileEndpoing "consumer.recursive" is misleading
> 
> 
> Hi,
> 
> I think the "consumer.recursive" parameter which can be passed to a
> polling
> FileEndpoint is misleading. The way I read it (and perhaps others) is that
> subdirectories of the passed directory are not scanned for files. Instead,
> recursive=false will prevent any directory scanning at all:
> 
> (Camel 1.4.0)
> 
> in FileConsumer, line 57:
> 
> int rc = pollFileOrDirectory(endpoint.getFile(), isRecursive());
> 
> in FileConsumer, line 75:
> 
> protected int pollFileOrDirectory(File fileOrDirectory, boolean
> processDir)
> {
>      if (!fileOrDirectory.isDirectory()) {
>             return pollFile(fileOrDirectory); // process the file
>      } else if (processDir) {
> ...
> } else {
>          LOG.debug("Skipping directory " + fileOrDirectory); // <!-- when
> uri is directory and recursive=false
>         return 0;
> }
> 
> I think a "recursive" parameter meaning whether to scan subdirectories is
> useful. Perhaps some renaming is in order.
> 
> Cheers,
> --Bill
> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/FileEndpoing-%22consumer.recursive%22-is-misleading-tp18897261s22882p18897261.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/FileEndpoing-%22consumer.recursive%22-is-misleading-tp18897261s22882p18903502.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: FileEndpoing "consumer.recursive" is misleading

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Bug is reported by CAMEL-804


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: tourist604 [mailto:idea@skrypnyk.net] 
Sent: 9. august 2008 11:43
To: camel-user@activemq.apache.org
Subject: RE: FileEndpoing "consumer.recursive" is misleading


Hello Claus,

Thanks for the reply.

In this case, the option doesn't appear to work as it fails to scan the
first directory level. 

--Bill



Claus Ibsen wrote:
> 
> Hi
> 
> Yes it's used for scanning sub directories. Maybe the option should be
> renamed to something more intuitive (subfolder / subdir) or anyone got a
> better name?
> 
> The description is wiki is currently:
> if a directory, will look for changes in files in all the sub directories.
> Notice: Default value in Camel 1.4 or older is true. In Camel 1.5 the
> default value is changed to false.
> 
> 
> Anything we should change here?
> 
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> -----Original Message-----
> From: tourist604 [mailto:idea@skrypnyk.net] 
> Sent: 8. august 2008 20:50
> To: camel-user@activemq.apache.org
> Subject: FileEndpoing "consumer.recursive" is misleading
> 
> 
> Hi,
> 
> I think the "consumer.recursive" parameter which can be passed to a
> polling
> FileEndpoint is misleading. The way I read it (and perhaps others) is that
> subdirectories of the passed directory are not scanned for files. Instead,
> recursive=false will prevent any directory scanning at all:
> 
> (Camel 1.4.0)
> 
> in FileConsumer, line 57:
> 
> int rc = pollFileOrDirectory(endpoint.getFile(), isRecursive());
> 
> in FileConsumer, line 75:
> 
> protected int pollFileOrDirectory(File fileOrDirectory, boolean
> processDir)
> {
>      if (!fileOrDirectory.isDirectory()) {
>             return pollFile(fileOrDirectory); // process the file
>      } else if (processDir) {
> ...
> } else {
>          LOG.debug("Skipping directory " + fileOrDirectory); // <!-- when
> uri is directory and recursive=false
>         return 0;
> }
> 
> I think a "recursive" parameter meaning whether to scan subdirectories is
> useful. Perhaps some renaming is in order.
> 
> Cheers,
> --Bill
> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/FileEndpoing-%22consumer.recursive%22-is-misleading-tp18897261s22882p18897261.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/FileEndpoing-%22consumer.recursive%22-is-misleading-tp18897261s22882p18903502.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: FileEndpoing "consumer.recursive" is misleading

Posted by tourist604 <id...@skrypnyk.net>.
Hello Claus,

Thanks for the reply.

In this case, the option doesn't appear to work as it fails to scan the
first directory level. 

--Bill



Claus Ibsen wrote:
> 
> Hi
> 
> Yes it's used for scanning sub directories. Maybe the option should be
> renamed to something more intuitive (subfolder / subdir) or anyone got a
> better name?
> 
> The description is wiki is currently:
> if a directory, will look for changes in files in all the sub directories.
> Notice: Default value in Camel 1.4 or older is true. In Camel 1.5 the
> default value is changed to false.
> 
> 
> Anything we should change here?
> 
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> -----Original Message-----
> From: tourist604 [mailto:idea@skrypnyk.net] 
> Sent: 8. august 2008 20:50
> To: camel-user@activemq.apache.org
> Subject: FileEndpoing "consumer.recursive" is misleading
> 
> 
> Hi,
> 
> I think the "consumer.recursive" parameter which can be passed to a
> polling
> FileEndpoint is misleading. The way I read it (and perhaps others) is that
> subdirectories of the passed directory are not scanned for files. Instead,
> recursive=false will prevent any directory scanning at all:
> 
> (Camel 1.4.0)
> 
> in FileConsumer, line 57:
> 
> int rc = pollFileOrDirectory(endpoint.getFile(), isRecursive());
> 
> in FileConsumer, line 75:
> 
> protected int pollFileOrDirectory(File fileOrDirectory, boolean
> processDir)
> {
>      if (!fileOrDirectory.isDirectory()) {
>             return pollFile(fileOrDirectory); // process the file
>      } else if (processDir) {
> ...
> } else {
>          LOG.debug("Skipping directory " + fileOrDirectory); // <!-- when
> uri is directory and recursive=false
>         return 0;
> }
> 
> I think a "recursive" parameter meaning whether to scan subdirectories is
> useful. Perhaps some renaming is in order.
> 
> Cheers,
> --Bill
> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/FileEndpoing-%22consumer.recursive%22-is-misleading-tp18897261s22882p18897261.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/FileEndpoing-%22consumer.recursive%22-is-misleading-tp18897261s22882p18903502.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: FileEndpoing "consumer.recursive" is misleading

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Yes it's used for scanning sub directories. Maybe the option should be renamed to something more intuitive (subfolder / subdir) or anyone got a better name?

The description is wiki is currently:
if a directory, will look for changes in files in all the sub directories. Notice: Default value in Camel 1.4 or older is true. In Camel 1.5 the default value is changed to false.


Anything we should change here?



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: tourist604 [mailto:idea@skrypnyk.net] 
Sent: 8. august 2008 20:50
To: camel-user@activemq.apache.org
Subject: FileEndpoing "consumer.recursive" is misleading


Hi,

I think the "consumer.recursive" parameter which can be passed to a polling
FileEndpoint is misleading. The way I read it (and perhaps others) is that
subdirectories of the passed directory are not scanned for files. Instead,
recursive=false will prevent any directory scanning at all:

(Camel 1.4.0)

in FileConsumer, line 57:

int rc = pollFileOrDirectory(endpoint.getFile(), isRecursive());

in FileConsumer, line 75:

protected int pollFileOrDirectory(File fileOrDirectory, boolean processDir)
{
     if (!fileOrDirectory.isDirectory()) {
            return pollFile(fileOrDirectory); // process the file
     } else if (processDir) {
...
} else {
         LOG.debug("Skipping directory " + fileOrDirectory); // <!-- when
uri is directory and recursive=false
        return 0;
}

I think a "recursive" parameter meaning whether to scan subdirectories is
useful. Perhaps some renaming is in order.

Cheers,
--Bill


-- 
View this message in context: http://www.nabble.com/FileEndpoing-%22consumer.recursive%22-is-misleading-tp18897261s22882p18897261.html
Sent from the Camel - Users mailing list archive at Nabble.com.