diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java b/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java index 211b3c0863..a13e25525d 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java @@ -43,9 +43,11 @@ public final class ReportBranding implements ReportBrandingProviderI { private static final String GENERATOR_LOGO_PATH_PROP = "GeneratorLogoPath"; private static final String AGENCY_LOGO_PATH_PROP = "AgencyLogoPath"; private static final String REPORT_TITLE_PROP = "ReportTitle"; + private static final String REPORT_FOOTER_PROP = "ReportFooter"; //default settings private static final String DEFAULT_GENERATOR_LOGO = "/org/sleuthkit/autopsy/report/images/default_generator_logo.png"; private static final String DEFAULT_REPORT_TITLE = "Autopsy Forensic Report"; + private static final String DEFAULT_REPORT_FOOTER = "Powered by Autopsy Open Source Digital Forensics Platform - www.sleuthkit.org"; private String reportsBrandingDir; //dir with extracted reports branding resources private static final String MODULE_NAME = ReportBranding.class.getSimpleName(); private static final Logger logger = Logger.getLogger(ReportBranding.class.getName()); @@ -54,8 +56,8 @@ public final class ReportBranding implements ReportBrandingProviderI { //initialize with extracting of resource files if needed, ensure 1 writer at a time synchronized (ReportBranding.class) { - - reportsBrandingDir = PlatformUtil.getUserConfigDirectory() + File.separator + ReportGenerator.REPORTS_DIR + File.separator + + reportsBrandingDir = PlatformUtil.getUserConfigDirectory() + File.separator + ReportGenerator.REPORTS_DIR + File.separator + "branding"; File brandingDir = new File(reportsBrandingDir); if (!brandingDir.exists()) { @@ -134,4 +136,24 @@ public final class ReportBranding implements ReportBrandingProviderI { public void setReportTitle(String title) { ModuleSettings.setConfigSetting(MODULE_NAME, REPORT_TITLE_PROP, title); } + + @Override + public String getReportFooter() { + String curFooter = null; + + curFooter = ModuleSettings.getConfigSetting(MODULE_NAME, REPORT_FOOTER_PROP); + if (curFooter == null) { + //use default + logger.log(Level.INFO, "Using default report branding for report footer"); + curFooter = DEFAULT_REPORT_FOOTER; + ModuleSettings.setConfigSetting(MODULE_NAME, REPORT_FOOTER_PROP, curFooter); + } + + return curFooter; + } + + @Override + public void setReportFooter(String footer) { + ModuleSettings.setConfigSetting(MODULE_NAME, REPORT_FOOTER_PROP, footer); + } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportBrandingProviderI.java b/Core/src/org/sleuthkit/autopsy/report/ReportBrandingProviderI.java index 6cc736fe0c..e12d57187a 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportBrandingProviderI.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportBrandingProviderI.java @@ -24,29 +24,34 @@ package org.sleuthkit.autopsy.report; public interface ReportBrandingProviderI { /** - * Get the generator logo path on the local disk (previously set or default). - * The file pointed by the path should exist. + * Get the generator logo path on the local disk (previously set or + * default). The file pointed by the path should exist. * - * @return the generator logo path, or null if error occurred and path is not valid + * @return the generator logo path, or null if error occurred and path is + * not valid */ public String getGeneratorLogoPath(); /** * Sets custom generator logo path + * * @param path path to set */ public void setGeneratorLogoPath(String path); /** - * Get the agency logo path on the local disk (previously set or default), or NULL if unused - * (Note, this is optional, as opposed to the generator logo path) + * Get the agency logo path on the local disk (previously set or default), + * or NULL if unused (Note, this is optional, as opposed to the generator + * logo path) * - * @return the agency logo path, or null if not provided or error occurred and path is not valid + * @return the agency logo path, or null if not provided or error occurred + * and path is not valid */ public String getAgencyLogoPath(); /** * Sets custom agency logo path + * * @param path path to set */ public void setAgencyLogoPath(String path); @@ -60,7 +65,22 @@ public interface ReportBrandingProviderI { /** * Sets custom report title + * * @param title title to set */ public void setReportTitle(String title); + + /** + * Get the report footer (previously set or default) + * + * @return the report footer + */ + public String getReportFooter(); + + /** + * Sets custom report footer + * + * @param footer footer to set + */ + public void setReportFooter(String footer); }