You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Niall Pemberton (JIRA)" <ji...@apache.org> on 2008/01/07 16:01:43 UTC

[jira] Commented: (IO-77) [io] add a convenience FileUtils.move(File src, File dest)

    [ https://issues.apache.org/jira/browse/IO-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556577#action_12556577 ] 

Niall Pemberton commented on IO-77:
-----------------------------------

Thanks for the new patch Nicolas - I've applied it with some modifications:
    http://svn.apache.org/viewvc?view=rev&revision=609622

I renamed the "move" method to "moveFile" so that its consistent with the existing copyFile/copyDirectory methods we have. I also added "moveFileToDirectory", "moveDirectoryToDirectory" and "moveToDirectory" method flavours with the same idea as their copy equivalents.

Theres are a few other minor changes (like throwing IOException instead of IllegalArgumentException) . I'll leave this open for now for feedback

Niall

> [io] add a convenience FileUtils.move(File src, File dest)
> ----------------------------------------------------------
>
>                 Key: IO-77
>                 URL: https://issues.apache.org/jira/browse/IO-77
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 1.0
>         Environment: Operating System: other
> Platform: Other
>            Reporter: nicolas de loof
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: IO-77.patch, patch_io.txt
>
>
> I'm using FileUtils as it partially solves the missing "move" method for File,
> that is so simple to do in unix shell.
> A full implementation in FileUtils may be great :
> static boolean FileUtils.move(File src, File dest)
> throws IOException
> {
>     boolean rename = src.renameTo(dest);
>     if (!rename)
>     {
>         copyFile(file, dest);
>         file.delete();
>     }
> }

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