if (destFo.getType().equals(FileType.FOLDER)) {
log.debug("vfs FILE into FOLDER");
// get a handle on the new file to create at the destination.
FileObject nestedDestFo = destFo.resolveFile(srcFo.getName().getBaseName());
// copyFileToFile(srcFo, nestedDestFo, false); //append false here
nestedDestFo.copyFrom(srcFo, new AllFileSelector());
} else {
log.debug("vfs FILE to FILE");
// copyFileToFile(srcFo, destFo, false); //append false here
destFo.copyFrom(srcFo, new AllFileSelector());
}
} else if (srcFo.getType().equals(FileType.FOLDER)) {
// copying the children of a folder into another folder
if (destFo.getType().equals(FileType.FOLDER)) {
log.debug("vfs FOLDER children into FOLDER");
destFo.copyFrom(srcFo, new AllFileSelector());
} else {
throw new IOException("Cannot copy a folder to a destination that is not a folder");
}
} else {