public final static int copyDir(File originalDir, File copyDir, FileFilter filter,
			TaskMonitor monitor) throws IOException, CancelledException {

		if (monitor == null) {
			monitor = TaskMonitor.DUMMY;
		}

		if (!originalDir.exists()) {
			return 0;// nothing to do
		}

		File[] originalDirFiles = originalDir.listFiles(filter);
		if (originalDirFiles == null || originalDirFiles.length == 0) {
			return 0;// nothing to do
		}

		int copiedFilesCount = 0;
		monitor.initialize(originalDirFiles.length);

		for (File file : originalDirFiles) {
			monitor.checkCancelled();
			monitor.setMessage("Copying " + file.getAbsolutePath());
			File destinationFile = new File(copyDir, file.getName());
			if (file.isDirectory()) {
				copiedFilesCount += doCopyDir(file, destinationFile, filter, monitor);
			}
			else {
				destinationFile.getParentFile().mkdirs();

				// use a dummy monitor as not to ruin the progress
				copyFile(file, destinationFile, false, TaskMonitor.DUMMY);
				copiedFilesCount++;
			}
			monitor.incrementProgress(1);
		}

		return copiedFilesCount;
	}
Copies the contents of <code>originalDir</code> to <code>copyDir</code>.  If the <code>originalDir</code>
does not exist, then this method will do nothing.  If <code>copyDir</code> does not exist, then
it will be created as necessary.

@param originalDir The directory from which to extract contents
@param copyDir The directory in which the extracted contents will be placed
@param filter a filter to apply against the directory's contents
@param monitor the task monitor
@return the number of filed copied
@throws IOException if there was a problem accessing the files
@throws CancelledException if the copy is cancelled
Ghidra/Framework/Utility/src/main/java/utilities/util/FileUtilities.java