use of org.gradle.internal.fingerprint.hashing.ZipEntryContext in project gradle by gradle.
the class ZipHasher method fingerprintZipEntries.
private void fingerprintZipEntries(String parentName, String rootParentName, List<FileSystemLocationFingerprint> fingerprints, ZipInput input) throws IOException {
fingerprints.add(newZipMarker(parentName));
for (ZipEntry zipEntry : input) {
if (zipEntry.isDirectory()) {
continue;
}
String fullName = parentName.isEmpty() ? zipEntry.getName() : parentName + "/" + zipEntry.getName();
ZipEntryContext zipEntryContext = new DefaultZipEntryContext(zipEntry, fullName, rootParentName);
if (isZipFile(zipEntry.getName())) {
zipEntryContext.getEntry().withInputStream((ZipEntry.InputStreamAction<Void>) inputStream -> {
fingerprintZipEntries(fullName, rootParentName, fingerprints, new StreamZipInput(inputStream));
return null;
});
} else {
fingerprintZipEntry(zipEntryContext, fingerprints);
}
}
}
Aggregations