// Path: src/main/java/br/com/trustsystems/elfinder/core/Target.java
// public interface Target {
// 
//     Volume getVolume();
// 
// }
// 
// Path: src/main/java/br/com/trustsystems/elfinder/core/Volume.java
// public interface Volume {
// 
//     void createFile(Target target) throws IOException;
// 
//     void createFolder(Target target) throws IOException;
// 
//     void deleteFile(Target target) throws IOException;
// 
//     void deleteFolder(Target target) throws IOException;
// 
//     boolean exists(Target target);
// 
//     Target fromPath(String path);
// 
//     long getLastModified(Target target) throws IOException;
// 
//     String getMimeType(Target target) throws IOException;
// 
//     String getAlias();
// 
//     String getName(Target target);
// 
//     Target getParent(Target target);
// 
//     String getPath(Target target) throws IOException;
// 
//     Target getRoot();
// 
//     long getSize(Target target) throws IOException;
// 
//     boolean hasChildFolder(Target target) throws IOException;
// 
//     boolean isFolder(Target target);
// 
//     boolean isRoot(Target target) throws IOException;
// 
//     Target[] listChildren(Target target) throws IOException;
// 
//     InputStream openInputStream(Target target) throws IOException;
// 
//     OutputStream openOutputStream(Target target) throws IOException;
// 
//     void rename(Target origin, Target destination) throws IOException;
// 
//     List<Target> search(String target) throws IOException;
// }


import br.com.trustsystems.elfinder.core.Target;
import br.com.trustsystems.elfinder.core.Volume;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.ArchiveInputStream;
import org.apache.commons.compress.archivers.ArchiveOutputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.commons.compress.utils.IOUtils;
import java.io.*;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Enumeration;
import java.util.zip.CRC32;
import java.util.zip.ZipEntry;
                    compressTarget = targetVolume.fromPath(compressFile.toString());

                    // open streams to write the compress target contents and auto close it
                    archiveOutputStream = createArchiveOutputStream(compressFile);
                }

                if (isTargetFolder) {
                    // compress target directory
                    compressDirectory(target, archiveOutputStream);
                } else {
                    // compress target file
                    compressFile(target, archiveOutputStream);
                }
            }

        } finally {
            // close streams
            if (archiveOutputStream != null) {
                archiveOutputStream.finish();
                archiveOutputStream.close();
            }
        }

        return compressTarget;
    }

    @Override
    public Target decompress(Target targetCompress) throws IOException {
        Target decompressTarget;

// Path: src/main/java/br/com/trustsystems/elfinder/core/Target.java
// public interface Target {
// 
//     Volume getVolume();
// 
// }
// 
// Path: src/main/java/br/com/trustsystems/elfinder/core/Volume.java
// public interface Volume {
// 
//     void createFile(Target target) throws IOException;
// 
//     void createFolder(Target target) throws IOException;
// 
//     void deleteFile(Target target) throws IOException;
// 
//     void deleteFolder(Target target) throws IOException;
// 
//     boolean exists(Target target);
// 
//     Target fromPath(String path);
// 
//     long getLastModified(Target target) throws IOException;
// 
//     String getMimeType(Target target) throws IOException;
// 
//     String getAlias();
// 
//     String getName(Target target);
// 
//     Target getParent(Target target);
// 
//     String getPath(Target target) throws IOException;
// 
//     Target getRoot();
// 
//     long getSize(Target target) throws IOException;
// 
//     boolean hasChildFolder(Target target) throws IOException;
// 
//     boolean isFolder(Target target);
// 
//     boolean isRoot(Target target) throws IOException;
// 
//     Target[] listChildren(Target target) throws IOException;
// 
//     InputStream openInputStream(Target target) throws IOException;
// 
//     OutputStream openOutputStream(Target target) throws IOException;
// 
//     void rename(Target origin, Target destination) throws IOException;
// 
//     List<Target> search(String target) throws IOException;
// }


// Path: src/main/java/br/com/trustsystems/elfinder/support/archiver/ZipArchiver.java
import br.com.trustsystems.elfinder.core.Target;
import br.com.trustsystems.elfinder.core.Volume;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.ArchiveInputStream;
import org.apache.commons.compress.archivers.ArchiveOutputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.commons.compress.utils.IOUtils;
import java.io.*;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Enumeration;
import java.util.zip.CRC32;
import java.util.zip.ZipEntry;

                    compressTarget = targetVolume.fromPath(compressFile.toString());

                    // open streams to write the compress target contents and auto close it
                    archiveOutputStream = createArchiveOutputStream(compressFile);
                }

                if (isTargetFolder) {
                    // compress target directory
                    compressDirectory(target, archiveOutputStream);
                } else {
                    // compress target file
                    compressFile(target, archiveOutputStream);
                }
            }

        } finally {
            // close streams
            if (archiveOutputStream != null) {
                archiveOutputStream.finish();
                archiveOutputStream.close();
            }
        }

        return compressTarget;
    }

    @Override
    public Target decompress(Target targetCompress) throws IOException {
        Target decompressTarget;

        final Volume volume = targetCompress.getVolume();