Package com.vaadin.flow.server.frontend
Class CompressUtil
java.lang.Object
com.vaadin.flow.server.frontend.CompressUtil
Utility class for compression and decompression of folders and files.
- Since:
- 24.3
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcompressDirectory(File targetDirectory, File outfile) Compress target directory and children into given target outfile.static StringreadFileContentFromZip(File zip, String filename) Read a file content from the given zip file.static voiduncompressFile(File zip, File targetDirectory) Uncompress given zip file content to the target directory.
-
Method Details
-
compressDirectory
Compress target directory and children into given target outfile. All files will be zipped and the targetDirectory will not be in the package.- Parameters:
targetDirectory- directory content to compressoutfile- file to compress directory content to
-
uncompressFile
Uncompress given zip file content to the target directory.- Parameters:
zip- file to uncompresstargetDirectory- target directory to uncompress files to
-
readFileContentFromZip
Read a file content from the given zip file.- Parameters:
zip- Target zip filefilename- Target file name- Returns:
- File content or
nullif not found - Throws:
IOException- if an I/O error occurs
-