use of org.gradle.api.internal.file.archive.ZipEntry 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.ZipEntry in project gradle by gradle.
the class AbiExtractingClasspathResourceHasher method hash.
@Override
public HashCode hash(ZipEntryContext zipEntryContext) throws IOException {
ZipEntry zipEntry = zipEntryContext.getEntry();
if (!isClassFile(zipEntry.getName())) {
return null;
}
byte[] content = zipEntry.getContent();
return hashClassBytes(content);
}
Aggregations