public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
String archive = (String) workItem.getParameter("Archive");
List<File> files = (List<File>) workItem.getParameter("Files");
try {
Archive archiver = ArchiverFactory.getInstance("tar");
if (files != null) {
for (File file: files) {
archiver.add(file);
}
}
archiver.save(new File(archive));
manager.completeWorkItem(workItem.getId(), null);
} catch (Throwable t) {
t.printStackTrace();
manager.abortWorkItem(workItem.getId());
}