void (LayoutFileSet set) { Copy task = new Copy(); task.setTaskName("copy"); task.setProject(getProject()); String prefix = set.getPrefix(getProject()); File target = prefix.length() > 0 ? new File(destDirectory, prefix + "/") : destDirectory; target.mkdirs(); task.setTodir(target); LayoutFileSet unprefixed = (LayoutFileSet) set.clone(); unprefixed.setPrefix(""); task.addFileset(unprefixed); task.perform(); }