1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-06 02:24:30 +00:00

Pulled strings into Bundle.

Converted if-else from short form to long form to make it cleaner to read.
This commit is contained in:
Nick Davis
2014-04-15 17:04:47 -04:00
parent b3c9b23feb
commit f6bb10f916
2 changed files with 20 additions and 7 deletions

View File

@@ -7,10 +7,16 @@ EwfVerifyIngestModule.process.noStoredHash=Image {0} does not have stored hash.
EwfVerifyIngestModule.process.startingImg=Starting {0}
EwfVerifyIngestModule.process.errGetSizeOfImg=Error getting size of {0}. Image will not be processed.
EwfVerifyIngestModule.process.errReadImgAtChunk=Error reading {0} at chunk {1}
EwfVerifyIngestModule.init.exception.failGetMd5=Failed to get MD5 algorithm
EwfVerifyIngestModule.complete.verified=\ verified
EwfVerifyIngestModule.complete.notVerified=\ not verified
EwfVerifyIngestModule.complete.verifResultsHead=<p>E01 Verification Results for {0}</p>
EwfVerifyIngestModule.complete.resultLi=<li>Result\:{0}</li>
EwfVerifyIngestModule.complete.calcHashLi=<li>Calculated hash\: {0}</li>
EwfVerifyIngestModule.complete.storedHashLi=<li>Stored hash\: {0}</li>
EwfVerifyIngestModule.startUp.exception.failGetMd5=Failed to get MD5 algorithm
EwfVerifyIngestModule.shutDown.verified=\ verified
EwfVerifyIngestModule.shutDown.notVerified=\ not verified
EwfVerifyIngestModule.shutDown.verifyResultsHeader=<p>EWF Verification Results for {0}</p>
EwfVerifyIngestModule.shutDown.resultLi=<li>Result\:{0}</li>
EwfVerifyIngestModule.shutDown.calcHashLi=<li>Calculated hash\: {0}</li>
EwfVerifyIngestModule.shutDown.storedHashLi=<li>Stored hash\: {0}</li>

View File

@@ -73,7 +73,8 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo
messageDigest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException ex) {
logger.log(Level.WARNING, "Error getting md5 algorithm", ex);
throw new RuntimeException("Failed to get MD5 algorithm");
throw new RuntimeException(
NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.startUp.exception.failGetMd5"));
}
} else {
messageDigest.reset();
@@ -175,11 +176,17 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo
public void shutDown(boolean ingestJobCancelled) {
logger.log(Level.INFO, "complete() {0}", EwfVerifierModuleFactory.getModuleName());
if (skipped == false) {
String msg = verified ? " verified" : " not verified";
String extra = "<p>EWF Verification Results for " + imgName + "</p>";
extra += "<li>Result:" + msg + "</li>";
extra += "<li>Calculated hash: " + calculatedHash + "</li>";
extra += "<li>Stored hash: " + storedHash + "</li>";
String msg = "";
if (verified) {
msg = NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.shutDown.verified");
} else {
msg = NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.shutDown.notVerified");
}
String extra = NbBundle
.getMessage(this.getClass(), "EwfVerifyIngestModule.shutDown.verifyResultsHeader", imgName);
extra += NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.shutDown.resultLi", msg);
extra += NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.shutDown.calcHashLi", calculatedHash);
extra += NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.shutDown.storedHashLi", storedHash);
services.postMessage(IngestMessage.createMessage( MessageType.INFO, EwfVerifierModuleFactory.getModuleName(), imgName + msg, extra));
logger.log(Level.INFO, "{0}{1}", new Object[]{imgName, msg});
}