On 2011-08-12, Emmanouil Batsis (Manos) wrote: > On 08/12/2011 10:09 PM, Stefan Bodewig wrote: >> On 2011-08-12, Emmanouil Batsis (Manos) wrote:
>>> Consider a zip archive containing the following folder and files: >>> rootfolder >>>> file1.doc >>>> file2.pdf >>> Shouldnt the "entries" enum bellow contain an entry for the root folder? >>> ZipFile zipFile = new ZipFile(tmpZipFile); >>> Enumeration entries = zipFile.getEntries(); >> If "rootfolder" is part of the archive, yes. And I'm pretty sure it >> does (it will hav the name "rootfolder/"). > Its something about the specific zip archive, must be. If I extract > its contents and make a new zip on my machine it works just > fine. Should i open a bug or something? Maybe we can try a few other things first. ZipFile will only return entries that are really inside the archive. If the archive contains files with names that indicate they were part of a deeper directory tree, this is fine and the directories themselves need not be part of the archive themselves. If you use some ZIP tool with a UI like "Windows Compressed Folders", WinZip, 7ZIP or PKZIP they will show you the folders even if those are not part of the archive - they simply don't have any other way to visualize the entries. I suspect your archive in question simply only contains the file entries. Ant's <zip> task with filesonly="true" would create such an archive, for example. Are you sure your archive contains "rootfolder" at all? The only tool I'd know off-hand you could use to test this would be InfoZIP's command line tools. "unzip -l ARCHIVE" should show you the contents. Your JDK's jar might work as well (jar -tf ARCHIVE). When in doubt, open a JIRA ticket and we can go from there. If you can't share the archive in public but could do so privately to one of us Commons committers then we surely can arrange something as well. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
