private static void checkFileCopy ( final File srcFile , final File destFile ) throws IOException { checkExists ( srcFile ) ; checkIsFile ( srcFile ) ; if ( equals ( srcFile , destFile ) ) { throw new IOException ( "Files '" + srcFile + "' and '" + destFile + "' are equal" ) ; } File destParent = destFile . getParentFile ( ) ; if ( destParent != null && ! destParent . exists ( ) ) { checkCreateDirectory ( destParent ) ; } }
Checks that file copy can occur .