I am trying to copy a directory, and do so successfully with Apache Commons IO's FileUtils
.
I want however to be able to choose if the copy should merge the folders, with either the source or the destination taking precedence. The API-docs tells me that the source takes precedence now, but I can't find a way to undo that.
Also, all of the copyDirectory
methods seems to include all subfolders and files. I would like to be able to choose if I want them to tag along or not. I have tried to explore the FileFilter parameter option, but the API does not really provide much info about the class, and I haven't been able to find relevant uses of it, for my problem in other ways either.
EDIT: I have changed the question from "How can I" to "Can I", as it is suggested that my request is not possible with Fileutils. Confirmation on that, will be accepted as an answer, per to the new formulation of the question.