src/main/java/org/edgegallery/appstore/infrastructure/util/AppUtil.java
public String compressAndDeleteFile(String destinationFile, String fileName, String fileExtension) {
        String zipFileName = fileName.concat(fileExtension);
        try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName))) {
            createCompressedFile(out, new File(destinationFile), "");
        } catch (IOException e) {
            throw new AppException(ZIP_PACKAGE_ERR_MESSAGES, ResponseConst.RET_COMPRESS_FAILED);
        }
        try {
            FileUtils.deleteDirectory(new File(destinationFile));
        } catch (IOException e) {
            throw new AppException(ZIP_PACKAGE_ERR_MESSAGES, ResponseConst.RET_COMPRESS_FAILED);
        }
        return zipFileName;
    }
/**
     * compress and delete ZIP application package.
     *
     * @param destinationFile destinationFile.
     * @param fileName compress file name.
     */
compress and delete ZIP application package.
@param destinationFile destinationFile.
@param fileName compress file name.
compress and delete ZIP application package . @param destinationFile destinationFile . @param fileName compress file name .
public String compressAndDeleteFile(String destinationFile, String fileName, String fileExtension) {
        String zipFileName = fileName.concat(fileExtension);
        try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName))) {
            createCompressedFile(out, new File(destinationFile), "");
        } catch (IOException e) {
            throw new AppException(ZIP_PACKAGE_ERR_MESSAGES, ResponseConst.RET_COMPRESS_FAILED);
        }
        try {
            FileUtils.deleteDirectory(new File(destinationFile));
        } catch (IOException e) {
            throw new AppException(ZIP_PACKAGE_ERR_MESSAGES, ResponseConst.RET_COMPRESS_FAILED);
        }
        return zipFileName;
    }
public String compressAndDeleteFile ( String destinationFile , String fileName , String fileExtension ) { String zipFileName = fileName . concat ( fileExtension ) ; try ( ZipOutputStream out = new ZipOutputStream ( new FileOutputStream ( zipFileName ) ) ) { createCompressedFile ( out , new File ( destinationFile ) , "" ) ; } catch ( IOException e ) { throw new AppException ( ZIP_PACKAGE_ERR_MESSAGES , ResponseConst . RET_COMPRESS_FAILED ) ; } try { FileUtils . deleteDirectory ( new File ( destinationFile ) ) ; } catch ( IOException e ) { throw new AppException ( ZIP_PACKAGE_ERR_MESSAGES , ResponseConst . RET_COMPRESS_FAILED ) ; } return zipFileName ; }
compress and delete ZIP application package.
compress and delete ZIP application package .