* @param dest
* @param paths
*/
@Override
public void zip(String dest, Collection<String> paths) {
final Zip zip = new Zip();
zip.setCompress(false);
zip.setDestFile(new File(dest));
zip.setProject(new Project());
if (paths.size() != 1) {
for (String path : paths) {
final ZipFileSet set = new ZipFileSet();
final File file = new File(path);
set.setDir(file.getParentFile());
set.setIncludes(file.getName());
zip.addZipfileset(set);
}
} else {
final ZipFileSet set = new ZipFileSet();
final File toAdd = new File(paths.iterator().next());
if (toAdd.isDirectory()) {
set.setDir(toAdd);
} else {
set.setFile(toAdd);
}
zip.addZipfileset(set);
}
zip.execute();
}
@Override
public String newTempDir() {
final File bearDir = new File(FileUtils.getTempDirectory(), "bear");