public void unarchive(File archive, File outputDirectory, UnarchivingEntryProcessor entryProcessor) throws IOException { // // These are the contributions that unpacking this archive is providing // if (outputDirectory.exists() == false) { outputDirectory.mkdirs(); } Source source = ArchiverHelper.getArchiveHandler(archive, posixLongFileMode).getArchiveSource(); for (Entry archiveEntry : source.entries()) { String entryName = archiveEntry.getName(); if (useRoot == false) { entryName = entryName.substring(entryName.indexOf('/') + 1); } if (!selector.include(entryName)) { continue; } // // Process the entry name before any output is created on disk // entryName = entryProcessor.processName(entryName); // // So with an entry we may want to take a set of entry in a set of directories and flatten them // into one directory, or we may want to preserve the directory structure. // if (flatten) { entryName = entryName.substring(entryName.lastIndexOf("/") + 1); } else { if (archiveEntry.isDirectory()) { createDir(new File(outputDirectory, entryName)); continue;