You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/04/16 00:13:30 UTC

[GitHub] [commons-io] ferenc-csaky commented on issue #111: [IO-661] FileUtils throws inconsistent exceptions

ferenc-csaky commented on issue #111: [IO-661] FileUtils throws inconsistent exceptions
URL: https://github.com/apache/commons-io/pull/111#issuecomment-614341907
 
 
   I totally agree with that IAE reflects better what is the actual problem. But I think that involves other layers.
   
   For example, the `copyFileToDirectory(File, File, boolean)` function I modified calls the `copyFile(File, File, boolean)` function inside, which throws IOE if the expected `srcFile` is a directory. The next step in the method call chain is the private `doCopyFile(final File srcFile, final File destFile, final boolean preserveFileDate)` function, which actually does the operation and it also throws an IOE if `destFile` is a directory.
   
   My point is basically every other function in this bunch throws IOE for these kind of checks. It applies to the whole `copyDirectoryToDirectory(...)` chain and to the move operations as well. So changing only the top layer would not solve the problem IMO.
   
   Of course, I would happily go to the IAE direction, but to do that right it requires some other changes.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services