/** * Adds an entry to the Jar file, normalizing the name. * * @param entryName the name of the entry in the Jar file * @param fileName the name of the input file for the entry */ private void addEntry(String entryName, ExtendedArchiveEntry entry, ArchiveOutputStream aos) throws IOException { if (entryName.startsWith("/")) { entryName = entryName.substring(1); } else if (entryName.startsWith("./")) { entryName = entryName.substring(2); } if (normalize) { entry.setTime(newEntryTimeMillis(entryName)); entries.put(entryName, entry); } else { writeEntry(entry, aos); } }
for (Map.Entry<String, ExtendedArchiveEntry> entry : entries.entrySet()) { ExtendedArchiveEntry archiveEntry = entry.getValue(); writeEntry(archiveEntry, aos);