commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] [Commented] (IO-402) [IO] copyFileToDirectory - Over-Write File
Date Tue, 01 Jul 2014 00:39:24 GMT


BELUGA BEHR commented on IO-402:

Thank you kapil, and please vote up this ticket please :)

I think what you have put forward is a different feature, that may have merit in a different
context.  I was simply suggesting supplying a flag to over-write a file if it already exists,
not creating a separate file.

> [IO] copyFileToDirectory - Over-Write File
> ------------------------------------------
>                 Key: IO-402
>                 URL:
>             Project: Commons IO
>          Issue Type: Wish
>          Components: Utilities
>    Affects Versions: 2.4
>            Reporter: BELUGA BEHR
>            Priority: Minor
>             Fix For: 2.5
> I came across a small annoyance at work today.  I have code that takes a file and copies
it to a mounted directory on a remote server.  I am using FileUtils.copyFileToDirectory()
to do the move, but it does not have an overwrite flag.  If something goes wrong with the
file transfer over the network, and only part of the file is transferred, all subsequent attempts
are blocked by the fact that the file "already exists."  I would like to see another overloaded
copyFileToDirectory() method with a flag to overwrite the file if it already exists.  The
current behavior is to throw an IoException.
> Thanks!

This message was sent by Atlassian JIRA

View raw message