org.sonar.api.utils
Class ZipUtils

java.lang.Object
  extended by org.sonar.api.utils.ZipUtils

public final class ZipUtils
extends Object

Since:
1.10

Nested Class Summary
static interface ZipUtils.ZipEntryFilter
           
 
Method Summary
static File unzip(File zip, File toDir)
          Unzip a file into a directory.
static File unzip(File zip, File toDir, ZipUtils.ZipEntryFilter filter)
           
static File unzipToTempDir(File zip)
          Unzip a file into a new temporary directory.
static void zipDir(File dir, File zip)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

unzipToTempDir

public static File unzipToTempDir(File zip)
                           throws IOException
Unzip a file into a new temporary directory. The directory is not deleted on JVM exit, so it must be explicitely deleted.

Returns:
the temporary directory
Throws:
IOException
Since:
2.2

unzip

public static File unzip(File zip,
                         File toDir)
                  throws IOException
Unzip a file into a directory. The directory is created if it does not exist.

Returns:
the target directory
Throws:
IOException

unzip

public static File unzip(File zip,
                         File toDir,
                         ZipUtils.ZipEntryFilter filter)
                  throws IOException
Throws:
IOException

zipDir

public static void zipDir(File dir,
                          File zip)
                   throws IOException
Throws:
IOException


Copyright © 2009-2012 SonarSource. All Rights Reserved.