You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Maria Iracheta (Created) (JIRA)" <ji...@apache.org> on 2011/09/30 15:48:45 UTC
[jira] [Created] (CAMEL-4505) FileUtils change to make 'copy/delete
instead of renaming' feature configurable
FileUtils change to make 'copy/delete instead of renaming' feature configurable
-------------------------------------------------------------------------------
Key: CAMEL-4505
URL: https://issues.apache.org/jira/browse/CAMEL-4505
Project: Camel
Issue Type: Improvement
Reporter: Maria Iracheta
It would be nice to make the enhancement in the FileUtils 'renameFile' method configurable. Not long ago the 'renameFile' method was changed to try copy/delete after 3 tries of renaming a File. In certain cases you would want the renaming to fail as a way of knowing that the File is opened or being used, otherwise it might cause the file to be copied and not deleted (because it is opened).
Apart of this enhancement request I think there is a bug in that area:
if (!deleteFile(from)) {
LOG.warn("Renaming file from: {} to: {} failed due cannot delete from file: {} after copy succeeded", new Object[]{from, to, from});
renamed = false;
}
renamed = true;
Shouldn't this be :
if (!deleteFile(from)) {
LOG.warn("Renaming file from: {} to: {} failed due cannot delete from file: {} after copy succeeded", new Object[]{from, to, from});
renamed = false;
}
else renamed = true;
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (CAMEL-4505) FileUtils change to make
'copy/delete instead of renaming' feature configurable
Posted by "Claus Ibsen (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-4505:
----------------------------------
Assignee: Claus Ibsen
> FileUtils change to make 'copy/delete instead of renaming' feature configurable
> -------------------------------------------------------------------------------
>
> Key: CAMEL-4505
> URL: https://issues.apache.org/jira/browse/CAMEL-4505
> Project: Camel
> Issue Type: Improvement
> Reporter: Maria Iracheta
> Assignee: Claus Ibsen
>
> It would be nice to make the enhancement in the FileUtils 'renameFile' method configurable. Not long ago the 'renameFile' method was changed to try copy/delete after 3 tries of renaming a File. In certain cases you would want the renaming to fail as a way of knowing that the File is opened or being used, otherwise it might cause the file to be copied and not deleted (because it is opened).
> Apart of this enhancement request I think there is a bug in that area:
>
> if (!deleteFile(from)) {
> LOG.warn("Renaming file from: {} to: {} failed due cannot delete from file: {} after copy succeeded", new Object[]{from, to, from});
> renamed = false;
> }
> renamed = true;
> Shouldn't this be :
> if (!deleteFile(from)) {
> LOG.warn("Renaming file from: {} to: {} failed due cannot delete from file: {} after copy succeeded", new Object[]{from, to, from});
> renamed = false;
> }
> else renamed = true;
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-4505) FileUtils change to make 'copy/delete
instead of renaming' feature configurable
Posted by "Daniel Kulp (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Kulp updated CAMEL-4505:
-------------------------------
Fix Version/s: 2.8.2
> FileUtils change to make 'copy/delete instead of renaming' feature configurable
> -------------------------------------------------------------------------------
>
> Key: CAMEL-4505
> URL: https://issues.apache.org/jira/browse/CAMEL-4505
> Project: Camel
> Issue Type: Improvement
> Reporter: Maria Iracheta
> Assignee: Claus Ibsen
> Fix For: 2.8.2, 2.9.0
>
>
> It would be nice to make the enhancement in the FileUtils 'renameFile' method configurable. Not long ago the 'renameFile' method was changed to try copy/delete after 3 tries of renaming a File. In certain cases you would want the renaming to fail as a way of knowing that the File is opened or being used, otherwise it might cause the file to be copied and not deleted (because it is opened).
> Apart of this enhancement request I think there is a bug in that area:
>
> if (!deleteFile(from)) {
> LOG.warn("Renaming file from: {} to: {} failed due cannot delete from file: {} after copy succeeded", new Object[]{from, to, from});
> renamed = false;
> }
> renamed = true;
> Shouldn't this be :
> if (!deleteFile(from)) {
> LOG.warn("Renaming file from: {} to: {} failed due cannot delete from file: {} after copy succeeded", new Object[]{from, to, from});
> renamed = false;
> }
> else renamed = true;
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CAMEL-4505) FileUtils change to make
'copy/delete instead of renaming' feature configurable
Posted by "Claus Ibsen (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-4505.
--------------------------------
Resolution: Fixed
Fix Version/s: 2.9.0
There is a new option copyAndDeleteOnRenameFail you can use to control this.
> FileUtils change to make 'copy/delete instead of renaming' feature configurable
> -------------------------------------------------------------------------------
>
> Key: CAMEL-4505
> URL: https://issues.apache.org/jira/browse/CAMEL-4505
> Project: Camel
> Issue Type: Improvement
> Reporter: Maria Iracheta
> Assignee: Claus Ibsen
> Fix For: 2.9.0
>
>
> It would be nice to make the enhancement in the FileUtils 'renameFile' method configurable. Not long ago the 'renameFile' method was changed to try copy/delete after 3 tries of renaming a File. In certain cases you would want the renaming to fail as a way of knowing that the File is opened or being used, otherwise it might cause the file to be copied and not deleted (because it is opened).
> Apart of this enhancement request I think there is a bug in that area:
>
> if (!deleteFile(from)) {
> LOG.warn("Renaming file from: {} to: {} failed due cannot delete from file: {} after copy succeeded", new Object[]{from, to, from});
> renamed = false;
> }
> renamed = true;
> Shouldn't this be :
> if (!deleteFile(from)) {
> LOG.warn("Renaming file from: {} to: {} failed due cannot delete from file: {} after copy succeeded", new Object[]{from, to, from});
> renamed = false;
> }
> else renamed = true;
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira