posted 15 years ago
I assume you know how to read all entries in a Zip file.
I would keep a mapping from entry names to DefaultMutableTreeNodes. Then, when you encounter a ZipEntry, you determine its parent from the name (using the / as the separator*). You retrieve the parent node from the map, creating it if necessary. Then you create a DefaultMutableTreeNode, and add it to the parent node. Finally you add the new mapping.
In pseudo code (untested):
* You can be lazy and use java.io.File for this.