I want to get the top level folder of a zip file using ZipInputStream.
Say, I have a zip file test.zip
that contains the following entries:
topFolder/sub/sample.jpg
When I use ZipInputStream, the first entry that it gets is topFolder/sub/
Is there a way that we can get the top folder topFolder
?
while ((entry = zipInputStream.getNextEntry()) != null) {
}