Source:
private void populateSimple(Model model, Resource primaryResource, String alabel, String filename, String mimetype) { File contentFile = new File(this.getDataDirectory(), filename); if (!contentFile.exists()) { failJob("Failed to find upload file for simple deposit: " + filename, contentFile.getAbsolutePath()); } String checksum = null; String fullPath = contentFile.toString(); try { checksum = DigestUtils.md5Hex(new FileInputStream(fullPath)); PremisLogger premisDepositLogger = getPremisLogger(getDepositPID()); Resource premisDepositEvent = premisDepositLogger.buildEvent(Premis.MessageDigestCalculation) .addEventDetail("Checksum for file is {0}", checksum) .addSoftwareAgent(SoftwareAgent.depositService.getFullname()) .create(); premisDepositLogger.writeEvent(premisDepositEvent); } catch (IOException e) { failJob(e, "Unable to compute checksum. File not found at {}", fullPath); } Property md5sumProp = dprop(model, md5sum); model.add(primaryResource, md5sumProp, checksum); if(alabel == null) alabel = contentFile.getName(); model.add(primaryResource, dprop(model, label), alabel); model.add(primaryResource, dprop(model, size), Long.toString(contentFile.length())); if (mimetype != null) { model.add(primaryResource, dprop(model, DepositRelationship.mimetype), mimetype); } try { model.add(primaryResource, dprop(model, stagingLocation), DepositConstants.DATA_DIR + "/" + UriUtils.encodePathSegment(contentFile.getName(), "UTF-8")); } catch (UnsupportedEncodingException e) { failJob(e, "Failed to add staging location for due to encoding issues", contentFile.getName()); } }

Target:
private void populateSimple(Model model, Resource primaryResource, String alabel, String filename, String mimetype) { File contentFile = new File(this.getDataDirectory(), filename); if (!contentFile.exists()) { failJob("Failed to find upload file for simple deposit: " + filename, contentFile.getAbsolutePath()); } String checksum = null; String fullPath = contentFile.toString(); try { checksum = DigestUtils.md5Hex(new FileInputStream(fullPath)); PremisLogger premisDepositLogger = getPremisLogger(new PID(primaryResource.toString())); Resource premisDepositEvent = premisDepositLogger.buildEvent(Premis.MessageDigestCalculation) .addEventDetail("Checksum for file is {0}", checksum) .addSoftwareAgent(SoftwareAgent.depositService.getFullname()) .create(); premisDepositLogger.writeEvent(premisDepositEvent); } catch (IOException e) { failJob(e, "Unable to compute checksum. File not found at {}", fullPath); } Property md5sumProp = dprop(model, md5sum); model.add(primaryResource, md5sumProp, checksum); if(alabel == null) alabel = contentFile.getName(); model.add(primaryResource, dprop(model, label), alabel); model.add(primaryResource, dprop(model, size), Long.toString(contentFile.length())); if (mimetype != null) { model.add(primaryResource, dprop(model, DepositRelationship.mimetype), mimetype); } try { model.add(primaryResource, dprop(model, stagingLocation), DepositConstants.DATA_DIR + "/" + UriUtils.encodePathSegment(contentFile.getName(), "UTF-8")); } catch (UnsupportedEncodingException e) { failJob(e, "Failed to add staging location for due to encoding issues", contentFile.getName()); } }