Package org.eclipse.net4j.util.io

# Class ZIPUtil

java.lang.Object
org.eclipse.net4j.util.io.ZIPUtil

public final class ZIPUtil extends Object

Author:
  Eike Stepper

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final class`
`ZIPUtil.EntryContext`
`static class`
`ZIPUtil.FileSystemUnzipHandler`
`static class`
`ZIPUtil.FileSystemZipHandler`
`static interface`
`ZIPUtil.UnzipHandler`
`static interface`
`ZIPUtil.ZipEntryHandler`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`DEFALULT_BUFFER_SIZE`
Deprecated.
As of 3.4 use `DEFAULT_BUFFER_SIZE`.
`static final int`
`DEFAULT_BUFFER_SIZE`

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`isZip(byte[] bytes)`
Checks whether the given byte array represents a ZIP file by inspecting the magic number.
`static boolean`
`isZip(File file)`
Checks whether the given file represents a ZIP file by inspecting the magic number.
`static boolean`
`isZip(InputStream input)`
Checks whether the given input stream represents a ZIP file by inspecting the magic number.
`static void`
`unzip(byte[] bytes, ZIPUtil.UnzipHandler handler)`
`static void`
`unzip(File zipFile, File targetFolder)`
`static void`
`unzip(File zipFile, ZIPUtil.UnzipHandler handler)`
`static void`
`unzip(InputStream input, ZIPUtil.UnzipHandler handler)`
`static void`
`zip(File sourceFolder, boolean excludeRoot, File zipFile)`
`static void`
`zip(ZIPUtil.ZipEntryHandler handler, File zipFile)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### DEFALULT_BUFFER_SIZE

@Deprecated public static final int DEFALULT_BUFFER_SIZE
Deprecated.
As of 3.4 use `DEFAULT_BUFFER_SIZE`.

See Also:
  - Constant Field Values

### DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE

Since:
  3.4
See Also:
  - Constant Field Values

## Method Details

### isZip

public static boolean isZip(byte[] bytes)
Checks whether the given byte array represents a ZIP file by inspecting the magic number.

Since:
  3.29

### isZip

public static boolean isZip(InputStream input) throws IORuntimeException
Checks whether the given input stream represents a ZIP file by inspecting the magic number.

Throws:
  `IORuntimeException`
Since:
  3.29

### isZip

public static boolean isZip(File file) throws IORuntimeException
Checks whether the given file represents a ZIP file by inspecting the magic number.

Throws:
  `IORuntimeException`
Since:
  3.29

### zip

public static void zip(ZIPUtil.ZipEntryHandler handler, File zipFile) throws IORuntimeException

Throws:
  `IORuntimeException`

### zip

public static void zip(File sourceFolder, boolean excludeRoot, File zipFile)

### unzip

public static void unzip(InputStream input, ZIPUtil.UnzipHandler handler) throws IORuntimeException

Throws:
  `IORuntimeException`
Since:
  3.29

### unzip

public static void unzip(byte[] bytes, ZIPUtil.UnzipHandler handler) throws IORuntimeException

Throws:
  `IORuntimeException`
Since:
  3.29

### unzip

public static void unzip(File zipFile, ZIPUtil.UnzipHandler handler) throws IORuntimeException

Throws:
  `IORuntimeException`

### unzip

public static void unzip(File zipFile, File targetFolder) throws IORuntimeException

Throws:
  `IORuntimeException`