}
} catch (JenkinsException e) {
throw new OpsException("Error communicating with Jenkins", e);
}
FingerprintInfo found = null;
List<FingerprintInfo> fingerprints = buildInfo.getFingerprints();
for (FingerprintInfo fingerprint : fingerprints) {
if (fileName.equals(fingerprint.getFileName())) {
found = fingerprint;
}
}
if (found == null) {
for (FingerprintInfo fingerprint : fingerprints) {
String fingerprintFileName = fingerprint.getFileName();
if (fingerprintFileName.contains(":")) {
// Strip the maven prefix
fingerprintFileName = fingerprintFileName.substring(fingerprintFileName.indexOf(':') + 1);
}
if (fileName.equals(fingerprintFileName)) {
found = fingerprint;
}
}
}
if (found == null) {
log.warn("Could not find fingerprinted file with name: " + fileName + " in " + buildInfo);
return null;
}
String hash = found.getHash();
if (hash == null) {
throw new IllegalStateException();
}
// We return the hash in the hope that we've already copied the artifact!