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:
[email protected]


With regards,
Apache Git Services

Reply via email to