public class ZipUtility extends ObjectUtility class for some ZIP compression related issues.
Constructors Constructor Description
All Methods Static Methods Concrete Methods Modifier and Type Method Description
toFileNameFromZip(String aZipFileName)Truncates the ".zip" suffix from the filename and returns the result.
public static InputStream toInputStream(File aFile) throws ZipException, IOException, FileNotFoundExceptionReturns an
InputStreamfrom the provided
File. In case the file points to a ZIP compressed file, then the uncompressed data is provided by the
Filefor which to get the
InputStream, in case of a ZIP compressed
File, an uncompressed
ZipException- in case there were problems when accessing the ZIP compressed
IOException- in case there were problems working with the
FileNotFoundException- in case there was none such
toFileNameFromZipTruncates the ".zip" suffix from the filename and returns the result. For example a file with name "log-2023-07-12.txt.zip" results in "log-2023-07-12.txt".
aZipFileName- The file name of the ZIP file for which to get the "inner" file name.
- The "inner" file name if the file suffix was ".zip", else null.