use of org.gradle.api.internal.file.archive.ZipInput 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);
}
}
}
use of org.gradle.api.internal.file.archive.ZipInput in project gradle by gradle.
the class ZipHasher method fingerprintZipEntries.
private List<FileSystemLocationFingerprint> fingerprintZipEntries(String zipFile) throws IOException {
try (ZipInput input = FileZipInput.create(new File(zipFile))) {
List<FileSystemLocationFingerprint> fingerprints = Lists.newArrayList();
fingerprintZipEntries("", zipFile, fingerprints, input);
return fingerprints;
}
}
Aggregations