Source:
private static TextSummary getDefaultSummary(AbstractFile file) { Image image = null; int countOfImages = 0; try { Content largestChild = null; for (Content child : file.getChildren()) { if (child instanceof AbstractFile && ImageUtils.isImageThumbnailSupported((AbstractFile) child)) { countOfImages++; if (largestChild == null || child.getSize() > largestChild.getSize()) { largestChild = child; } } } if (largestChild != null) { image = ImageUtils.getThumbnail(largestChild, ImageUtils.ICON_SIZE_LARGE); } } catch (TskCoreException ex) { logger.log(Level.WARNING, "Error getting children for file: " + file.getId(), ex); } image = image == null ? image : image.getScaledInstance(ImageUtils.ICON_SIZE_MEDIUM, ImageUtils.ICON_SIZE_MEDIUM, Image.SCALE_SMOOTH); String summaryText = null; if (file.getMd5Hash() != null) { try { summaryText = getSavedSummary(Paths.get(Case.getCurrentCaseThrows().getCacheDirectory(), "summaries", file.getMd5Hash() + "-default-" + PREVIEW_SIZE + "-translated.txt").toString()); } catch (NoCurrentCaseException ex) { logger.log(Level.WARNING, "Unable to retrieve saved summary case not open", ex); } } if (StringUtils.isBlank(summaryText)) { String firstLines = getFirstLines(file); String translatedFirstLines = getTranslatedVersion(firstLines); if (!StringUtils.isBlank(translatedFirstLines)) { summaryText = translatedFirstLines; if (file.getMd5Hash() != null) { try { saveSummary(summaryText, Paths.get(Case.getCurrentCaseThrows().getCacheDirectory(), "summaries", file.getMd5Hash() + "-default-" + PREVIEW_SIZE + "-translated.txt").toString()); } catch (NoCurrentCaseException ex) { logger.log(Level.WARNING, "Unable to save translated summary case not open", ex); } } } else { summaryText = firstLines; } } return new TextSummary(summaryText, image, countOfImages); }

Target:
private static TextSummary getDefaultSummary(AbstractFile file) { Image image = null; int countOfImages = 0; try { Content largestChild = null; for (Content child : file.getChildren()) { if (child instanceof AbstractFile && ImageUtils.isImageThumbnailSupported((AbstractFile) child)) { countOfImages++; if (largestChild == null || child.getSize() > largestChild.getSize()) { largestChild = child; } } } if (largestChild != null) { image = ImageUtils.getThumbnail(largestChild, ImageUtils.ICON_SIZE_LARGE); } } catch (TskCoreException ex) { logger.log(Level.WARNING, "Error getting children for file: " + file.getId(), ex); } image = image == null ? image : image.getScaledInstance(ImageUtils.ICON_SIZE_MEDIUM, ImageUtils.ICON_SIZE_MEDIUM, Image.SCALE_SMOOTH); String summaryText = null; if (file.getMd5Hash() != null) { try { summaryText = getSavedSummary(Paths.get(Case.getCurrentCaseThrows().getCacheDirectory(), "summaries", file.getMd5Hash() + "-default-" + PREVIEW_SIZE + "-translated.txt").toString()); } catch (NoCurrentCaseException ex) { logger.log(Level.WARNING, "Unable to retrieve saved summary. No case is open.", ex); } } if (StringUtils.isBlank(summaryText)) { String firstLines = getFirstLines(file); String translatedFirstLines = getTranslatedVersion(firstLines); if (!StringUtils.isBlank(translatedFirstLines)) { summaryText = translatedFirstLines; if (file.getMd5Hash() != null) { try { saveSummary(summaryText, Paths.get(Case.getCurrentCaseThrows().getCacheDirectory(), "summaries", file.getMd5Hash() + "-default-" + PREVIEW_SIZE + "-translated.txt").toString()); } catch (NoCurrentCaseException ex) { logger.log(Level.WARNING, "Unable to save translated summary. No case is open.", ex); } } } else { summaryText = firstLines; } } return new TextSummary(summaryText, image, countOfImages); }