use of com.android.jarutils.JavaResourceFilter in project android by JetBrains.
the class AndroidApkBuilder method collectDuplicateEntries.
@SuppressWarnings({ "IOResourceOpenedButNotSafelyClosed" })
private static void collectDuplicateEntries(@NotNull String rootFile, @NotNull Set<String> entries, @NotNull Set<String> result) throws IOException {
final JavaResourceFilter javaResourceFilter = new JavaResourceFilter();
FileInputStream fis = null;
ZipInputStream zis = null;
try {
fis = new FileInputStream(rootFile);
zis = new ZipInputStream(fis);
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
if (!entry.isDirectory()) {
String name = entry.getName();
if (javaResourceFilter.checkEntry(name) && !entries.add(name)) {
result.add(name);
}
zis.closeEntry();
}
}
} finally {
if (zis != null) {
zis.close();
}
if (fis != null) {
fis.close();
}
}
}
Aggregations