src/main/java/org/edgegallery/appstore/infrastructure/util/AppUtil.java
public void zipFiles(List<File> srcfile, File zipfile) {
        List<String> entryPaths = new ArrayList<>();
        try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipfile));) {
            for (File file : srcfile) {
                if (file.isFile()) {
                    addFileToZip(out, file, entryPaths);
                } else if (file.isDirectory()) {
                    entryPaths.add(file.getName());
                    addFolderToZip(out, file, entryPaths);
                    entryPaths.remove(entryPaths.size() - 1);
                }
            }
        } catch (IOException e) {
            throw new AppException(ZIP_PACKAGE_ERR_MESSAGES, ResponseConst.RET_COMPRESS_FAILED);
        }
    }
/**
     * zip files.
     * @param srcfile source file list
     * @param zipfile to be zipped file
     */
zip files.
@param srcfile source file list
@param zipfile to be zipped file
zip files . @param srcfile source file list @param zipfile to be zipped file
public void zipFiles(List<File> srcfile, File zipfile) {
        List<String> entryPaths = new ArrayList<>();
        try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipfile));) {
            for (File file : srcfile) {
                if (file.isFile()) {
                    addFileToZip(out, file, entryPaths);
                } else if (file.isDirectory()) {
                    entryPaths.add(file.getName());
                    addFolderToZip(out, file, entryPaths);
                    entryPaths.remove(entryPaths.size() - 1);
                }
            }
        } catch (IOException e) {
            throw new AppException(ZIP_PACKAGE_ERR_MESSAGES, ResponseConst.RET_COMPRESS_FAILED);
        }
    }
public void zipFiles ( List < File > srcfile , File zipfile ) { List < String > entryPaths = new ArrayList < > ( ) ; try ( ZipOutputStream out = new ZipOutputStream ( new FileOutputStream ( zipfile ) ) ; ) { for ( File file : srcfile ) { if ( file . isFile ( ) ) { addFileToZip ( out , file , entryPaths ) ; } else if ( file . isDirectory ( ) ) { entryPaths . add ( file . getName ( ) ) ; addFolderToZip ( out , file , entryPaths ) ; entryPaths . remove ( entryPaths . size ( ) - 1 ) ; } } } catch ( IOException e ) { throw new AppException ( ZIP_PACKAGE_ERR_MESSAGES , ResponseConst . RET_COMPRESS_FAILED ) ; } }
zip files.
zip files .