com.atlassian.core.util.zip
Class FileArchiver

java.lang.Object
  extended by com.atlassian.core.util.zip.FileArchiver

public class FileArchiver
extends Object

Handles adding files to zip archives. Supports appending files to existing zip output stream.

Since:
v4.6.13

Constructor Summary
FileArchiver(ZipOutputStream zipOutputStream)
           
 
Method Summary
 void addDirectoryToArchive(File file, String path, String archiveFolderName)
           
 void addToArchive(File file, String path, String archiveFolderToCreate)
          Adds file to the current archive output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileArchiver

public FileArchiver(ZipOutputStream zipOutputStream)
Method Detail

addToArchive

public void addToArchive(File file,
                         String path,
                         String archiveFolderToCreate)
                  throws IOException
Adds file to the current archive output stream

Parameters:
file - file to add to archive
archiveFolderToCreate - name of topmost folder to create inside of the archive, leave blank to not create.
Throws:
IOException - if can't read from file or can't write to output

addDirectoryToArchive

public void addDirectoryToArchive(File file,
                                  String path,
                                  String archiveFolderName)
                           throws IOException
Throws:
IOException


Copyright © 2015 Atlassian. All rights reserved.