| 573 | } |
| 574 | |
| 575 | private Map<String, ZipEntry> readZipContents(InputStream is, URL url) throws IOException { |
| 576 | HashMap<String, ZipEntry> fileNames = new HashMap<String, ZipEntry>(); |
| 577 | if (doCacheZipContents) |
| 578 | htZipContents.put(url.toString(), fileNames); |
| 579 | ZipInputStream input = new ZipInputStream(is); |
| 580 | ZipEntry zipEntry = null; |
| 581 | int n = 0; |
| 582 | while ((zipEntry = input.getNextEntry()) != null) { |
| 583 | if (zipEntry.isDirectory() || zipEntry.getSize() == 0) |
| 584 | continue; |
| 585 | n++; |
| 586 | String fileName = zipEntry.getName(); |
| 587 | fileNames.put(fileName, zipEntry); // Java has no use for the ZipEntry, but JavaScript can read it. |
| 588 | } |
| 589 | input.close(); |
| 590 | System.out.println("Assets: " + n + " zip entries found in " + url); //$NON-NLS-1$ |
| 591 | return fileNames; |
| 592 | } |
| 593 | |
| 594 | private void resort() { |
| 595 | sortedList = new String[assetsByPath.size()]; |