// 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;
        }
        return zipEntry;
    }

    @Override
    public ArchiveOutputStream createArchiveOutputStream(BufferedOutputStream bufferedOutputStream) {
        return new ZipArchiveOutputStream(bufferedOutputStream);
    }

    // for some internal optimizations should use the constructor that accepts a File argument
    public ArchiveOutputStream createArchiveOutputStream(Path path) throws IOException {
        return new ZipArchiveOutputStream(path.toFile());
    }

    @Override
    public ArchiveInputStream createArchiveInputStream(BufferedInputStream bufferedInputStream) throws IOException {
        return new ZipArchiveInputStream(bufferedInputStream);
    }

    @Override
    public Target compress(Target... targets) throws IOException {
        Target compressTarget = null;
        Path compressFile = null;

        ArchiveOutputStream archiveOutputStream = null;

        try {

            for (Target target : targets) {
                // get target volume
// 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;

        }
        return zipEntry;
    }

    @Override
    public ArchiveOutputStream createArchiveOutputStream(BufferedOutputStream bufferedOutputStream) {
        return new ZipArchiveOutputStream(bufferedOutputStream);
    }

    // for some internal optimizations should use the constructor that accepts a File argument
    public ArchiveOutputStream createArchiveOutputStream(Path path) throws IOException {
        return new ZipArchiveOutputStream(path.toFile());
    }

    @Override
    public ArchiveInputStream createArchiveInputStream(BufferedInputStream bufferedInputStream) throws IOException {
        return new ZipArchiveInputStream(bufferedInputStream);
    }

    @Override
    public Target compress(Target... targets) throws IOException {
        Target compressTarget = null;
        Path compressFile = null;

        ArchiveOutputStream archiveOutputStream = null;

        try {

            for (Target target : targets) {
                // get target volume
                final Volume targetVolume = target.getVolume();