You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2012/09/03 09:08:07 UTC

[jira] [Created] (CAMEL-5558) Add fileExist option to write file with a new name in case file already exists

Claus Ibsen created CAMEL-5558:
----------------------------------

             Summary: Add fileExist option to write file with a new name in case file already exists
                 Key: CAMEL-5558
                 URL: https://issues.apache.org/jira/browse/CAMEL-5558
             Project: Camel
          Issue Type: New Feature
          Components: camel-core, camel-ftp
    Affects Versions: 2.10.0
            Reporter: Claus Ibsen
             Fix For: Future


See nabble
http://camel.465427.n5.nabble.com/Camel-FTP-component-Append-a-sequence-number-if-the-filename-already-exists-tp5718469.html

We should allow to configure fileExists=RenameAndRetry option, which allows you to rename the file and retry writing the file again, in case there already exists a file. 

The trick is to find a optimal solution if  you append a sequence number to a file. And when there is a lot of files. You kinda want to know what is the highest filename, (some way of listing and sorting). 

Maybe a way to get a list of existing files based on a file name pattern, and a sort configuration. Then people can check in the list, to find a free sequence number to use etc.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-5558) Add fileExist option to write file with a new name in case file already exists

Posted by "Jaco van Tonder (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450565#comment-13450565 ] 

Jaco van Tonder commented on CAMEL-5558:
----------------------------------------

Hello guys,

Yes, it would be awesome if this could be configurable in such a way that you could place the sequence as an expression in the destination file name and also specify the format of the sequence, example 01, 0001 or 000001.

Use case:
Files get transfered from multiple sources into a single location. These files all have names generated by the sources, eg:
{code}
File1.dat
File6.dat
File17.dat
Data1.dat
20120904-001.dat
{code}

These files now have to be re-sequenced with a specific naming convention when they are consumed and produced to the upstream system:
{code}
CUST.FILE.20120904.000001.DAT
CUST.FILE.20120904.000002.DAT
CUST.FILE.20120904.000003.DAT
CUST.FILE.20120904.000004.DAT
CUST.FILE.20120904.000005.DAT
{code}

It would be nice if you could pick up the last sequence from the destination that the producer is writing to.
                
> Add fileExist option to write file with a new name in case file already exists
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-5558
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5558
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core, camel-ftp
>    Affects Versions: 2.10.0
>            Reporter: Claus Ibsen
>             Fix For: Future
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Camel-FTP-component-Append-a-sequence-number-if-the-filename-already-exists-tp5718469.html
> We should allow to configure fileExists=RenameAndRetry option, which allows you to rename the file and retry writing the file again, in case there already exists a file. 
> The trick is to find a optimal solution if  you append a sequence number to a file. And when there is a lot of files. You kinda want to know what is the highest filename, (some way of listing and sorting). 
> Maybe a way to get a list of existing files based on a file name pattern, and a sort configuration. Then people can check in the list, to find a free sequence number to use etc.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira