Skip to content

Commit

Permalink
Fix minor spacing inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
doulikecookiedough committed Jun 30, 2023
1 parent 6893e89 commit b76c82a
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ protected HashAddress putObject(InputStream object, String pid, String additiona
+ ". Object address: " + objHashAddressPath + ". Aborting request.";
logFileHashStore.warn(errMsg);
throw new PidObjectExistsException(errMsg);

}

// Generate tmp file and write to it
Expand All @@ -757,6 +758,7 @@ protected HashAddress putObject(InputStream object, String pid, String additiona
+ " checksumAlgorithm checked: " + checksumAlgorithm;
logFileHashStore.error(errMsg);
throw new NoSuchAlgorithmException(errMsg);

}

if (!checksum.equals(digestFromHexDigests)) {
Expand All @@ -767,12 +769,14 @@ protected HashAddress putObject(InputStream object, String pid, String additiona
+ tmpFile.getName();
logFileHashStore.error(errMsg);
throw new IOException(errMsg);

}
String errMsg = "FileHashStore.putObject - Checksum given is not equal to the calculated hex digest: "
+ digestFromHexDigests + ". Checksum provided: " + checksum + ". Deleting tmpFile: "
+ tmpFile.getName();
logFileHashStore.error(errMsg);
throw new IllegalArgumentException(errMsg);

}
}

Expand All @@ -787,6 +791,7 @@ protected HashAddress putObject(InputStream object, String pid, String additiona
+ " Attempted to delete tmpFile but failed: " + tmpFile.getName();
logFileHashStore.error(errMsg);
throw new IOException(errMsg);

}

objectCid = null;
Expand Down Expand Up @@ -831,6 +836,7 @@ protected boolean validateAlgorithm(String algorithm)
+ Arrays.toString(SUPPORTED_HASH_ALGORITHMS);
logFileHashStore.error(errMsg);
throw new NoSuchAlgorithmException(errMsg);

}

return true;
Expand Down Expand Up @@ -1034,11 +1040,13 @@ protected Map<String, String> writeToTmpFileAndGenerateChecksums(File tmpFile, I
checksumAlgo.update(buffer, 0, bytesRead);
}
}

} catch (IOException ioe) {
String errMsg = "FileHashStore.writeToTmpFileAndGenerateChecksums - Unexpected IOException encountered: "
+ ioe.getMessage();
logFileHashStore.error(errMsg);
throw ioe;

} finally {
os.flush();
os.close();
Expand Down Expand Up @@ -1318,6 +1326,7 @@ protected boolean isObjectNull(Object object, String argument, String method) {
+ " cannot be null.";
logFileHashStore.error(errMsg);
throw new NullPointerException(errMsg);

}
return false;
}
Expand All @@ -1335,6 +1344,7 @@ protected boolean isStringEmpty(String string, String argument, String method) {
+ " cannot be empty.";
logFileHashStore.error(errMsg);
throw new IllegalArgumentException(errMsg);

}
return false;
}
Expand Down

0 comments on commit b76c82a

Please sign in to comment.