[
https://issues.apache.org/jira/browse/IO-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556610#action_12556610
]
Holger Hoffstätte commented on IO-77:
-------------------------------------
(armchair lurker alert! ;-)
Niall, I don't know if it is too late to change this but throwing NPE is just
really, really evil; it's bad enough that Sun made this egregious mistake in
the JDK and started this "trend". IllegalArgumentException exists for a reason
and throwing NPEs manually makes them indistinguishable from real NPEs - with
the result that people start catching NPE, inadvertently swallowing the real
ones.. :(
Taking this further one could make the (of course absurd) point that any
Exception subclasses are redundant and "throw new Exception" is sufficient
everywhere..
So please reconsider IAE - it has actual meaning. Thanks.
> [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.