Class AbstractUnzipper
- java.lang.Object
-
- com.atlassian.confluence.util.zip.AbstractUnzipper
-
- All Implemented Interfaces:
Unzipper
- Direct Known Subclasses:
StreamUnzipper
,UrlUnzipper
public abstract class AbstractUnzipper extends Object implements Unzipper
-
-
Constructor Summary
Constructors Constructor Description AbstractUnzipper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ZipEntry[]
entries(ZipInputStream zis)
protected File
saveEntry(InputStream is, ZipEntry entry)
save the contents of the given inputstream into a file given by the zip entry.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.util.zip.Unzipper
entries, unzip, unzipFileInArchive
-
-
-
-
Field Detail
-
destDir
protected File destDir
-
-
Method Detail
-
saveEntry
protected File saveEntry(InputStream is, ZipEntry entry) throws IOException
save the contents of the given inputstream into a file given by the zip entry. If the zip entry is a directory, it is returned without writing the input stream into it.- Parameters:
is
- inputstream to read fromentry
- an entry in the zip file to save the inputstream to- Returns:
- the file that represents the zip entry. It may be a directory.
- Throws:
IOException
- if there are problems writing the fileIllegalArgumentException
- if the zip entry attempts to perform a directory traversal with relative paths ('../') and traverses outside the {@link this#destDir}.
-
entries
protected ZipEntry[] entries(ZipInputStream zis) throws IOException
- Throws:
IOException
-
-