src/main/java/org/edgegallery/appstore/domain/model/releases/BasicInfo.java
public static List<String> unzip(String zipFileName, String extPlace) throws IOException {
        List<String> unzipFileNams = new ArrayList<>();
        try (ZipFile zipFile = new ZipFile(zipFileName)) {
            Enumeration<ZipArchiveEntry> fileEn = zipFile.getEntries();
            byte[] buffer = new byte[BUFFER_SIZE];
            while (fileEn.hasMoreElements()) {
                ZipArchiveEntry entry = fileEn.nextElement();
                if (entry.isDirectory()) {
                    createDirectory(new File(extPlace, entry.getName()).getCanonicalPath());
                    continue;
                }
                File file = new File(extPlace, entry.getName());
                if (!file.getParentFile().exists()) {
                    createDirectory(file.getParentFile().getCanonicalPath());
                }
                try (InputStream input = zipFile.getInputStream(entry);
                     FileOutputStream out = FileUtils.openOutputStream(file);
                     BufferedOutputStream bos = new BufferedOutputStream(out)) {
                    int length = 0;
                    while ((length = input.read(buffer)) != -1) {
                        bos.write(buffer, 0, length);
                    }
                    unzipFileNams.add(file.getCanonicalPath());
                }
            }
        }
        return unzipFileNams;
    }
/**
     * unzip zip file.
     *
     * @param zipFileName file name to zip
     * @param extPlace extPlace
     * @return unzip file name
     * @throws IOException e1
     */
unzip zip file.
@param zipFileName file name to zip
@param extPlace extPlace
@return unzip file name
@throws IOException e1
unzip zip file . @param zipFileName file name to zip @param extPlace extPlace @return unzip file name @throws IOException e1
public static List<String> unzip(String zipFileName, String extPlace) throws IOException {
        List<String> unzipFileNams = new ArrayList<>();
        try (ZipFile zipFile = new ZipFile(zipFileName)) {
            Enumeration<ZipArchiveEntry> fileEn = zipFile.getEntries();
            byte[] buffer = new byte[BUFFER_SIZE];
            while (fileEn.hasMoreElements()) {
                ZipArchiveEntry entry = fileEn.nextElement();
                if (entry.isDirectory()) {
                    createDirectory(new File(extPlace, entry.getName()).getCanonicalPath());
                    continue;
                }
                File file = new File(extPlace, entry.getName());
                if (!file.getParentFile().exists()) {
                    createDirectory(file.getParentFile().getCanonicalPath());
                }
                try (InputStream input = zipFile.getInputStream(entry);
                     FileOutputStream out = FileUtils.openOutputStream(file);
                     BufferedOutputStream bos = new BufferedOutputStream(out)) {
                    int length = 0;
                    while ((length = input.read(buffer)) != -1) {
                        bos.write(buffer, 0, length);
                    }
                    unzipFileNams.add(file.getCanonicalPath());
                }
            }
        }
        return unzipFileNams;
    }
public static List < String > unzip ( String zipFileName , String extPlace ) throws IOException { List < String > unzipFileNams = new ArrayList < > ( ) ; try ( ZipFile zipFile = new ZipFile ( zipFileName ) ) { Enumeration < ZipArchiveEntry > fileEn = zipFile . getEntries ( ) ; byte [ ] buffer = new byte [ BUFFER_SIZE ] ; while ( fileEn . hasMoreElements ( ) ) { ZipArchiveEntry entry = fileEn . nextElement ( ) ; if ( entry . isDirectory ( ) ) { createDirectory ( new File ( extPlace , entry . getName ( ) ) . getCanonicalPath ( ) ) ; continue ; } File file = new File ( extPlace , entry . getName ( ) ) ; if ( ! file . getParentFile ( ) . exists ( ) ) { createDirectory ( file . getParentFile ( ) . getCanonicalPath ( ) ) ; } try ( InputStream input = zipFile . getInputStream ( entry ) ; FileOutputStream out = FileUtils . openOutputStream ( file ) ; BufferedOutputStream bos = new BufferedOutputStream ( out ) ) { int length = 0 ; while ( ( length = input . read ( buffer ) ) != - 1 ) { bos . write ( buffer , 0 , length ) ; } unzipFileNams . add ( file . getCanonicalPath ( ) ) ; } } } return unzipFileNams ; }
unzip zip file.
unzip zip file .