I am working on digital documents and digital signatures and I came across a problem.
Input: documentX.adoc - zip file with files and folders inside.
I need to get all the contents in the input file - a list of files and files.
What should I do:
ZipFile adocFile = new ZipFile(documentXFileName);
ArrayList <String> adocFiles = new ArrayList<String>();
Enumeration <? extends ZipEntry> entries;
entries = adocFile.entries();
for (entries = adocFile.entries(); entries.hasMoreElements();)
{
adocFiles.add(entries.nextElement().getName());
}
I tried to create an ArrayList <ZipEntry> and add ZipEntries instead of names - nothing is the same. Maybe there is another way? It is strange that ZipEntry has a .isDirectory () method ...
Thanks for the help, Martin.
source
share