com.atlassian.confluence.util.zip
Class AbstractUnzipper

java.lang.Object
  extended by com.atlassian.confluence.util.zip.AbstractUnzipper
All Implemented Interfaces:
Unzipper
Direct Known Subclasses:
StreamUnzipper, UrlUnzipper

public abstract class AbstractUnzipper
extends java.lang.Object
implements Unzipper


Field Summary
protected  java.io.File destDir
           
 
Constructor Summary
AbstractUnzipper()
           
 
Method Summary
protected  java.util.zip.ZipEntry[] entries(java.util.zip.ZipInputStream zis)
           
 boolean isChildOf(java.io.File destDir, java.io.File target)
          Deprecated. since 5.2.5. Use ConfluenceFileUtils.isChildOf(java.io.File, java.io.File) instead
protected  java.io.File saveEntry(java.io.InputStream is, java.util.zip.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 java.io.File destDir
Constructor Detail

AbstractUnzipper

public AbstractUnzipper()
Method Detail

saveEntry

protected java.io.File saveEntry(java.io.InputStream is,
                                 java.util.zip.ZipEntry entry)
                          throws java.io.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 from
entry - 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:
java.io.IOException - if there are problems writing the file
java.lang.IllegalArgumentException - if the zip entry attempts to perform a directory traversal with relative paths ('../') and traverses outside the this#destDir.

isChildOf

@Deprecated
public boolean isChildOf(java.io.File destDir,
                                    java.io.File target)
                  throws java.io.IOException
Deprecated. since 5.2.5. Use ConfluenceFileUtils.isChildOf(java.io.File, java.io.File) instead

Public access for test purposes

Throws:
java.io.IOException

entries

protected java.util.zip.ZipEntry[] entries(java.util.zip.ZipInputStream zis)
                                    throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2003-2013 Atlassian. All Rights Reserved.