Using java, I want to copy whole directory excluding some sub-directories (and all files inside those sub-directories) down file path. How can I do that? I’ve seen several such questions on SO but using Perl/ANT etc but not using Java.
Using java, I want to copy whole directory excluding some sub-directories (and all files
Share
Try FileUtils.html#copyDirectory from Apache Commons IO. One of the overloaded versions take FileFilter instance with single straightforward method to be implemented by you:
Also look at the list of existing convenient
FileFilterimplementations in Commons IO: