Package org.apache.commons.compress

Examples of org.apache.commons.compress.Archive


  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());
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.compress.Archive

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.