diff --git a/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java b/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java index 3ba14c7577..ae12c42e73 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java +++ b/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java @@ -84,7 +84,7 @@ public class ArtifactSelectionDialog extends javax.swing.JDialog { artifactStates.put(type, Boolean.TRUE); } } catch (TskCoreException ex) { - Logger.getLogger(ArtifactSelectionDialog.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage()); + Logger.getLogger(ArtifactSelectionDialog.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage()); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java b/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java index b05b2628e4..17dec869a7 100644 --- a/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java @@ -41,7 +41,7 @@ public class DefaultReportConfigurationPanel extends javax.swing.JPanel { infoLabel = new javax.swing.JLabel(); - infoLabel.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N + infoLabel.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(infoLabel, org.openide.util.NbBundle.getMessage(DefaultReportConfigurationPanel.class, "DefaultReportConfigurationPanel.infoLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); diff --git a/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java b/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java index a118ef23f2..9d4e6cfa57 100755 --- a/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java +++ b/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java @@ -56,7 +56,7 @@ import org.sleuthkit.datamodel.TskData; @Override public String getValue(AbstractFile file) { if (file.getMetaFlagsAsString().equals(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC.toString())) { - return "yes"; + return "yes"; //NON-NLS } return ""; } diff --git a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java index 68268cf4d5..330ad7515f 100755 --- a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java +++ b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java @@ -41,7 +41,7 @@ import org.sleuthkit.datamodel.AbstractFile; private static final Logger logger = Logger.getLogger(FileReportText.class.getName()); private String reportPath; private Writer out; - private static final String FILE_NAME = "file-report.txt"; + private static final String FILE_NAME = "file-report.txt"; //NON-NLS private static FileReportText instance; @@ -59,7 +59,7 @@ import org.sleuthkit.datamodel.AbstractFile; try { out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.reportPath))); } catch (IOException ex) { - logger.log(Level.WARNING, "Failed to create report text file", ex); + logger.log(Level.WARNING, "Failed to create report text file", ex); //NON-NLS } } @@ -69,7 +69,7 @@ import org.sleuthkit.datamodel.AbstractFile; try { out.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not close output writer when ending report.", ex); + logger.log(Level.WARNING, "Could not close output writer when ending report.", ex); //NON-NLS } } } @@ -92,7 +92,7 @@ import org.sleuthkit.datamodel.AbstractFile; try { out.write(getTabDelimitedList(titles)); } catch (IOException ex) { - logger.log(Level.WARNING, "Error when writing headers to report file: {0}", ex); + logger.log(Level.WARNING, "Error when writing headers to report file: {0}", ex); //NON-NLS } } @@ -105,7 +105,7 @@ import org.sleuthkit.datamodel.AbstractFile; try { out.write(getTabDelimitedList(cells)); } catch (IOException ex) { - logger.log(Level.WARNING, "Error when writing row to report file: {0}", ex); + logger.log(Level.WARNING, "Error when writing row to report file: {0}", ex); //NON-NLS } } @@ -114,7 +114,7 @@ import org.sleuthkit.datamodel.AbstractFile; try { out.write(System.lineSeparator()); } catch (IOException ex) { - logger.log(Level.WARNING, "Error when closing table: {0}", ex); + logger.log(Level.WARNING, "Error when closing table: {0}", ex); //NON-NLS } } @@ -130,7 +130,7 @@ import org.sleuthkit.datamodel.AbstractFile; @Override public String getExtension() { - return ".txt"; + return ".txt"; //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java b/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java index ef7772fa3e..83f1a9a7bf 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java @@ -75,7 +75,7 @@ import org.sleuthkit.datamodel.*; progressPanel.setIndeterminate(false); progressPanel.start(); progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportBodyFile.progress.querying")); - reportPath = path + "BodyFile.txt"; + reportPath = path + "BodyFile.txt"; //NON-NLS currentCase = Case.getCurrentCase(); skCase = currentCase.getSleuthkitCase(); @@ -83,8 +83,8 @@ import org.sleuthkit.datamodel.*; try { // exclude non-fs files/dirs and . and .. files - final String query = "type = " + TskData.TSK_DB_FILES_TYPE_ENUM.FS.getFileType() - + " AND name != '.' AND name != '..'"; + final String query = "type = " + TskData.TSK_DB_FILES_TYPE_ENUM.FS.getFileType() //NON-NLS + + " AND name != '.' AND name != '..'"; //NON-NLS progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportBodyFile.progress.loading")); List fs = skCase.findFilesWhere(query); @@ -148,18 +148,18 @@ import org.sleuthkit.datamodel.*; out.write("\n"); } } catch (IOException ex) { - logger.log(Level.WARNING, "Could not write the temp body file report.", ex); + logger.log(Level.WARNING, "Could not write the temp body file report.", ex); //NON-NLS } finally { try { out.flush(); out.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not flush and close the BufferedWriter.", ex); + logger.log(Level.WARNING, "Could not flush and close the BufferedWriter.", ex); //NON-NLS } } progressPanel.complete(); } catch(TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get the unique path.", ex); + logger.log(Level.WARNING, "Failed to get the unique path.", ex); //NON-NLS } } @@ -176,7 +176,7 @@ import org.sleuthkit.datamodel.*; @Override public String getExtension() { - String ext = ".txt"; + String ext = ".txt"; //NON-NLS return ext; } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java b/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java index f71e047f6e..63fd7fe337 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java @@ -41,12 +41,12 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil; public final class ReportBranding implements ReportBrandingProviderI { //property names - 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"; + private static final String GENERATOR_LOGO_PATH_PROP = "GeneratorLogoPath"; //NON-NLS + private static final String AGENCY_LOGO_PATH_PROP = "AgencyLogoPath"; //NON-NLS + private static final String REPORT_TITLE_PROP = "ReportTitle"; //NON-NLS + private static final String REPORT_FOOTER_PROP = "ReportFooter"; //NON-NLS //default settings - private static final String DEFAULT_GENERATOR_LOGO = "/org/sleuthkit/autopsy/report/images/default_generator_logo.png"; + private static final String DEFAULT_GENERATOR_LOGO = "/org/sleuthkit/autopsy/report/images/default_generator_logo.png"; //NON-NLS private static final String DEFAULT_REPORT_TITLE = NbBundle .getMessage(ReportBranding.class, "ReportBranding.defaultReportTitle.text"); private static final String DEFAULT_REPORT_FOOTER = NbBundle @@ -61,11 +61,11 @@ public final class ReportBranding implements ReportBrandingProviderI { synchronized (ReportBranding.class) { reportsBrandingDir = PlatformUtil.getUserConfigDirectory() + File.separator + ReportGenerator.REPORTS_DIR + File.separator - + "branding"; + + "branding"; //NON-NLS File brandingDir = new File(reportsBrandingDir); if (!brandingDir.exists()) { if (!brandingDir.mkdirs()) { - logger.log(Level.SEVERE, "Error creating report branding dir for the case, will use defaults"); + logger.log(Level.SEVERE, "Error creating report branding dir for the case, will use defaults"); //NON-NLS //TODO use defaults } } @@ -86,15 +86,15 @@ public final class ReportBranding implements ReportBrandingProviderI { curPath = ModuleSettings.getConfigSetting(MODULE_NAME, GENERATOR_LOGO_PATH_PROP); if (curPath == null || (!curPath.isEmpty() && !new File(curPath).canRead() ) ) { //use default - logger.log(Level.INFO, "Using default report branding for generator logo"); - curPath = reportsBrandingDir + File.separator + "logo.png"; + logger.log(Level.INFO, "Using default report branding for generator logo"); //NON-NLS + curPath = reportsBrandingDir + File.separator + "logo.png"; //NON-NLS InputStream in = getClass().getResourceAsStream(DEFAULT_GENERATOR_LOGO); OutputStream output = new FileOutputStream(new File(curPath)); FileUtil.copy(in, output); ModuleSettings.setConfigSetting(MODULE_NAME, GENERATOR_LOGO_PATH_PROP, curPath); } } catch (IOException e) { - logger.log(Level.SEVERE, "Error extracting report branding resources for generator logo", e); + logger.log(Level.SEVERE, "Error extracting report branding resources for generator logo", e); //NON-NLS } return curPath; @@ -113,7 +113,7 @@ public final class ReportBranding implements ReportBrandingProviderI { //if has been set, validate it's correct, if not set, return null if (curPath != null && new File(curPath).canRead() == false) { //use default - logger.log(Level.INFO, "Custom report branding for agency logo is not valid: " + curPath); + logger.log(Level.INFO, "Custom report branding for agency logo is not valid: " + curPath); //NON-NLS curPath = null; } @@ -132,7 +132,7 @@ public final class ReportBranding implements ReportBrandingProviderI { curTitle = ModuleSettings.getConfigSetting(MODULE_NAME, REPORT_TITLE_PROP); if (curTitle == null || curTitle.isEmpty()) { //use default - logger.log(Level.INFO, "Using default report branding for report title"); + logger.log(Level.INFO, "Using default report branding for report title"); //NON-NLS curTitle = DEFAULT_REPORT_TITLE; ModuleSettings.setConfigSetting(MODULE_NAME, REPORT_TITLE_PROP, curTitle); } @@ -152,7 +152,7 @@ public final class ReportBranding implements ReportBrandingProviderI { curFooter = ModuleSettings.getConfigSetting(MODULE_NAME, REPORT_FOOTER_PROP); if (curFooter == null) { //use default - logger.log(Level.INFO, "Using default report branding for report footer"); + logger.log(Level.INFO, "Using default report branding for report footer"); //NON-NLS curFooter = DEFAULT_REPORT_FOOTER; ModuleSettings.setConfigSetting(MODULE_NAME, REPORT_FOOTER_PROP, curFooter); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java index 2b9c9c18f7..94116f324d 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java @@ -111,7 +111,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; out = new FileOutputStream(reportPath); wb.write(out); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write Excel report.", ex); + logger.log(Level.SEVERE, "Failed to write Excel report.", ex); //NON-NLS } finally { if (out != null) { try { @@ -288,7 +288,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; @Override public String getExtension() { - return ".xlsx"; + return ".xlsx"; //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java index f79a9b02f7..bf0d869460 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java @@ -171,7 +171,7 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus; reportScrollPane.setViewportView(reportPanel); - titleLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + titleLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(titleLabel, org.openide.util.NbBundle.getMessage(ReportGenerationPanel.class, "ReportGenerationPanel.titleLabel.text")); // NOI18N titleSeparator.setForeground(new java.awt.Color(0, 0, 0)); diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index 1e92c0d439..2400f38c88 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -85,7 +85,7 @@ import org.sleuthkit.datamodel.TskData; private String reportPath; private ReportGenerationPanel panel = new ReportGenerationPanel(); - static final String REPORTS_DIR = "Reports"; + static final String REPORTS_DIR = "Reports"; //NON-NLS ReportGenerator(Map tableModuleStates, Map generalModuleStates, Map fileListModuleStates) { // Create the root reports directory path of the form: /Reports/ / @@ -98,7 +98,7 @@ import org.sleuthkit.datamodel.TskData; try { FileUtil.createFolder(new File(this.reportPath)); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to make report folder, may be unable to generate reports.", ex); + logger.log(Level.SEVERE, "Failed to make report folder, may be unable to generate reports.", ex); //NON-NLS } // Initialize the progress panels @@ -260,7 +260,7 @@ import org.sleuthkit.datamodel.TskData; NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorTitle"), NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(), MessageNotifyUtil.MessageType.ERROR); - logger.log(Level.SEVERE, "failed to generate reports", ex); + logger.log(Level.SEVERE, "failed to generate reports", ex); //NON-NLS } // catch and ignore if we were cancelled catch (java.util.concurrent.CancellationException ex ) { } @@ -347,7 +347,7 @@ import org.sleuthkit.datamodel.TskData; List absFiles; try { SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); - absFiles = skCase.findAllFilesWhere("NOT meta_type = 2"); + absFiles = skCase.findAllFilesWhere("NOT meta_type = 2"); //NON-NLS return absFiles; } catch (TskCoreException ex) { // TODO @@ -364,7 +364,7 @@ import org.sleuthkit.datamodel.TskData; NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorTitle"), NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(), MessageNotifyUtil.MessageType.ERROR); - logger.log(Level.SEVERE, "failed to generate reports", ex); + logger.log(Level.SEVERE, "failed to generate reports", ex); //NON-NLS } // catch and ignore if we were cancelled catch (java.util.concurrent.CancellationException ex ) { } @@ -552,7 +552,7 @@ import org.sleuthkit.datamodel.TskData; tags = Case.getCurrentCase().getServices().getTagsManager().getAllContentTags(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "failed to get content tags", ex); + logger.log(Level.SEVERE, "failed to get content tags", ex); //NON-NLS return; } @@ -563,7 +563,7 @@ import org.sleuthkit.datamodel.TskData; tableProgress.get(module).updateStatusLabel( NbBundle.getMessage(this.getClass(), "ReportGenerator.progress.processing", ARTIFACT_TYPE.TSK_TAG_FILE.getDisplayName())); - ArrayList columnHeaders = new ArrayList<>(Arrays.asList("File", "Tag", "Comment")); + ArrayList columnHeaders = new ArrayList<>(Arrays.asList("File", "Tag", "Comment")); //NON-NLS StringBuilder comment = new StringBuilder(); if (!tagNamesFilter.isEmpty()) { comment.append( @@ -628,7 +628,7 @@ import org.sleuthkit.datamodel.TskData; NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorTitle"), NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(), MessageNotifyUtil.MessageType.ERROR); - logger.log(Level.SEVERE, "failed to generate reports", ex); + logger.log(Level.SEVERE, "failed to generate reports", ex); //NON-NLS } // catch and ignore if we were cancelled catch (java.util.concurrent.CancellationException ex ) { } @@ -649,7 +649,7 @@ import org.sleuthkit.datamodel.TskData; tags = Case.getCurrentCase().getServices().getTagsManager().getAllBlackboardArtifactTags(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "failed to get blackboard artifact tags", ex); + logger.log(Level.SEVERE, "failed to get blackboard artifact tags", ex); //NON-NLS return; } @@ -754,7 +754,7 @@ import org.sleuthkit.datamodel.TskData; try { file = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(artifactTag.getArtifact().getObjectID()); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Error while getting content from a blackboard artifact to report on.", ex); + logger.log(Level.WARNING, "Error while getting content from a blackboard artifact to report on.", ex); //NON-NLS return; } checkIfFileIsImage(file); @@ -826,12 +826,12 @@ import org.sleuthkit.datamodel.TskData; try { artifacts.add(new ArtifactData(artifact, skCase.getBlackboardAttributes(artifact), uniqueTagNames)); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Failed to get Blackboard Attributes when generating report.", ex); + logger.log(Level.SEVERE, "Failed to get Blackboard Attributes when generating report.", ex); //NON-NLS } } } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Failed to get Blackboard Artifacts when generating report.", ex); + logger.log(Level.SEVERE, "Failed to get Blackboard Artifacts when generating report.", ex); //NON-NLS } return artifacts; } @@ -845,12 +845,12 @@ import org.sleuthkit.datamodel.TskData; ResultSet listsRs = null; try { // Query for keyword lists - listsRs = skCase.runQuery("SELECT att.value_text AS list " + - "FROM blackboard_attributes AS att, blackboard_artifacts AS art " + - "WHERE att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + " " + - "AND art.artifact_type_id = " + ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() + " " + - "AND att.artifact_id = art.artifact_id " + - "GROUP BY list"); + listsRs = skCase.runQuery("SELECT att.value_text AS list " + //NON-NLS + "FROM blackboard_attributes AS att, blackboard_artifacts AS art " + //NON-NLS + "WHERE att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + " " + //NON-NLS + "AND art.artifact_type_id = " + ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() + " " + //NON-NLS + "AND att.artifact_id = art.artifact_id " + //NON-NLS + "GROUP BY list"); //NON-NLS List lists = new ArrayList<>(); while(listsRs.next()) { String list = listsRs.getString("list"); @@ -870,7 +870,7 @@ import org.sleuthkit.datamodel.TskData; } } catch (SQLException ex) { - logger.log(Level.SEVERE, "Failed to query keyword lists.", ex); + logger.log(Level.SEVERE, "Failed to query keyword lists.", ex); //NON-NLS } finally { if (listsRs != null) { try { @@ -883,17 +883,17 @@ import org.sleuthkit.datamodel.TskData; ResultSet rs = null; try { // Query for keywords - rs = skCase.runQuery("SELECT art.artifact_id, art.obj_id, att1.value_text AS keyword, att2.value_text AS preview, att3.value_text AS list, f.name AS name " + - "FROM blackboard_artifacts AS art, blackboard_attributes AS att1, blackboard_attributes AS att2, blackboard_attributes AS att3, tsk_files AS f " + - "WHERE (att1.artifact_id = art.artifact_id) " + - "AND (att2.artifact_id = art.artifact_id) " + - "AND (att3.artifact_id = art.artifact_id) " + - "AND (f.obj_id = art.obj_id) " + - "AND (att1.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID() + ") " + - "AND (att2.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID() + ") " + - "AND (att3.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + ") " + - "AND (art.artifact_type_id = " + ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() + ") " + - "ORDER BY list, keyword, name"); + rs = skCase.runQuery("SELECT art.artifact_id, art.obj_id, att1.value_text AS keyword, att2.value_text AS preview, att3.value_text AS list, f.name AS name " + //NON-NLS + "FROM blackboard_artifacts AS art, blackboard_attributes AS att1, blackboard_attributes AS att2, blackboard_attributes AS att3, tsk_files AS f " + //NON-NLS + "WHERE (att1.artifact_id = art.artifact_id) " + //NON-NLS + "AND (att2.artifact_id = art.artifact_id) " + //NON-NLS + "AND (att3.artifact_id = art.artifact_id) " + //NON-NLS + "AND (f.obj_id = art.obj_id) " + //NON-NLS + "AND (att1.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID() + ") " + //NON-NLS + "AND (att2.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID() + ") " + //NON-NLS + "AND (att3.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + ") " + //NON-NLS + "AND (art.artifact_type_id = " + ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() + ") " + //NON-NLS + "ORDER BY list, keyword, name"); //NON-NLS String currentKeyword = ""; String currentList = ""; while (rs.next()) { @@ -911,25 +911,25 @@ import org.sleuthkit.datamodel.TskData; // Get any tags that associated with this artifact and apply the tag filter. HashSet uniqueTagNames = new HashSet<>(); - ResultSet tagNameRows = skCase.runQuery("SELECT display_name FROM tag_names WHERE artifact_id = " + rs.getLong("artifact_id")); + ResultSet tagNameRows = skCase.runQuery("SELECT display_name FROM tag_names WHERE artifact_id = " + rs.getLong("artifact_id")); //NON-NLS while (tagNameRows.next()) { - uniqueTagNames.add(tagNameRows.getString("display_name")); + uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS } if(failsTagFilter(uniqueTagNames, tagNamesFilter)) { continue; } String tagsList = makeCommaSeparatedList(uniqueTagNames); - Long objId = rs.getLong("obj_id"); - String keyword = rs.getString("keyword"); - String preview = rs.getString("preview"); - String list = rs.getString("list"); + Long objId = rs.getLong("obj_id"); //NON-NLS + String keyword = rs.getString("keyword"); //NON-NLS + String preview = rs.getString("preview"); //NON-NLS + String list = rs.getString("list"); //NON-NLS String uniquePath = ""; try { uniquePath = skCase.getAbstractFileById(objId).getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get Abstract File by ID.", ex); + logger.log(Level.WARNING, "Failed to get Abstract File by ID.", ex); //NON-NLS } // If the lists aren't the same, we've started a new list @@ -976,7 +976,7 @@ import org.sleuthkit.datamodel.TskData; module.endDataType(); } } catch (SQLException ex) { - logger.log(Level.SEVERE, "Failed to query keywords.", ex); + logger.log(Level.SEVERE, "Failed to query keywords.", ex); //NON-NLS } finally { if (rs != null) { try { @@ -996,12 +996,12 @@ import org.sleuthkit.datamodel.TskData; ResultSet listsRs = null; try { // Query for hashsets - listsRs = skCase.runQuery("SELECT att.value_text AS list " + - "FROM blackboard_attributes AS att, blackboard_artifacts AS art " + - "WHERE att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + " " + - "AND art.artifact_type_id = " + ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() + " " + - "AND att.artifact_id = art.artifact_id " + - "GROUP BY list"); + listsRs = skCase.runQuery("SELECT att.value_text AS list " + //NON-NLS + "FROM blackboard_attributes AS att, blackboard_artifacts AS art " + //NON-NLS + "WHERE att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + " " + //NON-NLS + "AND art.artifact_type_id = " + ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() + " " + //NON-NLS + "AND att.artifact_id = art.artifact_id " + //NON-NLS + "GROUP BY list"); //NON-NLS List lists = new ArrayList<>(); while(listsRs.next()) { lists.add(listsRs.getString("list")); @@ -1015,7 +1015,7 @@ import org.sleuthkit.datamodel.TskData; ARTIFACT_TYPE.TSK_HASHSET_HIT.getDisplayName())); } } catch (SQLException ex) { - logger.log(Level.SEVERE, "Failed to query hashset lists.", ex); + logger.log(Level.SEVERE, "Failed to query hashset lists.", ex); //NON-NLS } finally { if (listsRs != null) { try { @@ -1028,13 +1028,13 @@ import org.sleuthkit.datamodel.TskData; ResultSet rs = null; try { // Query for hashset hits - rs = skCase.runQuery("SELECT art.artifact_id, art.obj_id, att.value_text AS setname, f.name AS name, f.size AS size " + - "FROM blackboard_artifacts AS art, blackboard_attributes AS att, tsk_files AS f " + - "WHERE (att.artifact_id = art.artifact_id) " + - "AND (f.obj_id = art.obj_id) " + - "AND (att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + ") " + - "AND (art.artifact_type_id = " + ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() + ") " + - "ORDER BY setname, name, size"); + rs = skCase.runQuery("SELECT art.artifact_id, art.obj_id, att.value_text AS setname, f.name AS name, f.size AS size " + //NON-NLS + "FROM blackboard_artifacts AS art, blackboard_attributes AS att, tsk_files AS f " + //NON-NLS + "WHERE (att.artifact_id = art.artifact_id) " + //NON-NLS + "AND (f.obj_id = art.obj_id) " + //NON-NLS + "AND (att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + ") " + //NON-NLS + "AND (art.artifact_type_id = " + ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() + ") " + //NON-NLS + "ORDER BY setname, name, size"); //NON-NLS String currentSet = ""; while (rs.next()) { // Check to see if all the TableReportModules have been canceled @@ -1051,24 +1051,24 @@ import org.sleuthkit.datamodel.TskData; // Get any tags that associated with this artifact and apply the tag filter. HashSet uniqueTagNames = new HashSet<>(); - ResultSet tagNameRows = skCase.runQuery("SELECT display_name FROM tag_names WHERE artifact_id = " + rs.getLong("artifact_id")); + ResultSet tagNameRows = skCase.runQuery("SELECT display_name FROM tag_names WHERE artifact_id = " + rs.getLong("artifact_id")); //NON-NLS while (tagNameRows.next()) { - uniqueTagNames.add(tagNameRows.getString("display_name")); + uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS } if(failsTagFilter(uniqueTagNames, tagNamesFilter)) { continue; } String tagsList = makeCommaSeparatedList(uniqueTagNames); - Long objId = rs.getLong("obj_id"); - String set = rs.getString("setname"); - String size = rs.getString("size"); + Long objId = rs.getLong("obj_id"); //NON-NLS + String set = rs.getString("setname"); //NON-NLS + String size = rs.getString("size"); //NON-NLS String uniquePath = ""; try { uniquePath = skCase.getAbstractFileById(objId).getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get Abstract File from ID.", ex); + logger.log(Level.WARNING, "Failed to get Abstract File from ID.", ex); //NON-NLS } // If the sets aren't the same, we've started a new set @@ -1101,7 +1101,7 @@ import org.sleuthkit.datamodel.TskData; module.endDataType(); } } catch (SQLException ex) { - logger.log(Level.SEVERE, "Failed to query hashsets hits.", ex); + logger.log(Level.SEVERE, "Failed to query hashsets hits.", ex); //NON-NLS } finally { if (rs != null) { try { @@ -1402,7 +1402,7 @@ import org.sleuthkit.datamodel.TskData; try { return skCase.getAbstractFileById(objId).getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get Abstract File by ID.", ex); + logger.log(Level.WARNING, "Failed to get Abstract File by ID.", ex); //NON-NLS } return ""; } @@ -1464,7 +1464,7 @@ import org.sleuthkit.datamodel.TskData; try { rowData = getOrderedRowDataAsStrings(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Core exception while generating row data for artifact report.", ex); + logger.log(Level.WARNING, "Core exception while generating row data for artifact report.", ex); //NON-NLS rowData = Collections.emptyList(); } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java index 9111fe3e7b..0b0dfd0507 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java @@ -63,7 +63,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; class ReportHTML implements TableReportModule { private static final Logger logger = Logger.getLogger(ReportHTML.class.getName()); - private static final String THUMBS_REL_PATH = "thumbs" + File.separator; + private static final String THUMBS_REL_PATH = "thumbs" + File.separator; //NON-NLS private static ReportHTML instance; private static final int MAX_THUMBS_PER_PAGE = 1000; private Case currentCase; @@ -140,7 +140,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; InputStream in; OutputStream output = null; - logger.log(Level.INFO, "useDataTypeIcon: dataType = {0}", dataType); + logger.log(Level.INFO, "useDataTypeIcon: dataType = {0}", dataType); //NON-NLS // find the artifact with matching display name BlackboardArtifact.ARTIFACT_TYPE artifactType = null; @@ -153,93 +153,93 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; if (null != artifactType) { // set the icon file name - iconFileName = dataTypeToFileName(artifactType.getDisplayName()) + ".png"; + iconFileName = dataTypeToFileName(artifactType.getDisplayName()) + ".png"; //NON-NLS iconFilePath = path + File.separator + iconFileName; // determine the source image to use switch (artifactType) { case TSK_WEB_BOOKMARK: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/bookmarks.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/bookmarks.png"); //NON-NLS break; case TSK_WEB_COOKIE: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/cookies.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/cookies.png"); //NON-NLS break; case TSK_WEB_HISTORY: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/history.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/history.png"); //NON-NLS break; case TSK_WEB_DOWNLOAD: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/downloads.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/downloads.png"); //NON-NLS break; case TSK_RECENT_OBJECT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/recent.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/recent.png"); //NON-NLS break; case TSK_INSTALLED_PROG: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/installed.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/installed.png"); //NON-NLS break; case TSK_KEYWORD_HIT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/keywords.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/keywords.png"); //NON-NLS break; case TSK_HASHSET_HIT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/hash.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/hash.png"); //NON-NLS break; case TSK_DEVICE_ATTACHED: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/devices.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/devices.png"); //NON-NLS break; case TSK_WEB_SEARCH_QUERY: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/search.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/search.png"); //NON-NLS break; case TSK_METADATA_EXIF: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/exif.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/exif.png"); //NON-NLS break; case TSK_TAG_FILE: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/userbookmarks.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/userbookmarks.png"); //NON-NLS break; case TSK_TAG_ARTIFACT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/userbookmarks.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/userbookmarks.png"); //NON-NLS break; case TSK_SERVICE_ACCOUNT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/account-icon-16.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/account-icon-16.png"); //NON-NLS break; case TSK_CONTACT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/contact.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/contact.png"); //NON-NLS break; case TSK_MESSAGE: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/message.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/message.png"); //NON-NLS break; case TSK_CALLLOG: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/calllog.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/calllog.png"); //NON-NLS break; case TSK_CALENDAR_ENTRY: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/calendar.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/calendar.png"); //NON-NLS break; case TSK_SPEED_DIAL_ENTRY: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/speeddialentry.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/speeddialentry.png"); //NON-NLS break; case TSK_BLUETOOTH_PAIRING: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/bluetooth.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/bluetooth.png"); //NON-NLS break; case TSK_GPS_BOOKMARK: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gpsfav.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gpsfav.png"); //NON-NLS break; case TSK_GPS_LAST_KNOWN_LOCATION: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gps-lastlocation.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gps-lastlocation.png"); //NON-NLS break; case TSK_GPS_SEARCH: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gps-search.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gps-search.png"); //NON-NLS break; default: - logger.log(Level.WARNING, "useDataTypeIcon: unhandled artifact type = " + dataType); - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/star.png"); - iconFileName = "star.png"; + logger.log(Level.WARNING, "useDataTypeIcon: unhandled artifact type = " + dataType); //NON-NLS + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/star.png"); //NON-NLS + iconFileName = "star.png"; //NON-NLS iconFilePath = path + File.separator + iconFileName; break; } } else { // no defined artifact found for this dataType - logger.log(Level.WARNING, "useDataTypeIcon: no artifact found for data type = " + dataType); - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/star.png"); - iconFileName = "star.png"; + logger.log(Level.WARNING, "useDataTypeIcon: no artifact found for data type = " + dataType); //NON-NLS + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/star.png"); //NON-NLS + iconFileName = "star.png"; //NON-NLS iconFilePath = path + File.separator + iconFileName; } @@ -249,7 +249,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; in.close(); output.close(); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to extract images for HTML report.", ex); + logger.log(Level.SEVERE, "Failed to extract images for HTML report.", ex); //NON-NLS } finally { if (output != null) { try { @@ -277,13 +277,13 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; // Refresh the HTML report refresh(); // Setup the path for the HTML report - this.path = path + "HTML Report" + File.separator; - this.thumbsPath = this.path + "thumbs" + File.separator; + this.path = path + "HTML Report" + File.separator; //NON-NLS + this.thumbsPath = this.path + "thumbs" + File.separator; //NON-NLS try { FileUtil.createFolder(new File(this.path)); FileUtil.createFolder(new File(this.thumbsPath)); } catch (IOException ex) { - logger.log(Level.SEVERE, "Unable to make HTML report folder."); + logger.log(Level.SEVERE, "Unable to make HTML report folder."); //NON-NLS } // Write the basic files writeCss(); @@ -302,7 +302,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; try { out.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not close the output writer when ending report.", ex); + logger.log(Level.WARNING, "Could not close the output writer when ending report.", ex); //NON-NLS } } } @@ -319,27 +319,27 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; public void startDataType(String name, String description) { String title = dataTypeToFileName(name); try { - out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + title + getExtension()), "UTF-8")); + out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + title + getExtension()), "UTF-8")); //NON-NLS } catch (FileNotFoundException ex) { - logger.log(Level.SEVERE, "File not found: {0}", ex); + logger.log(Level.SEVERE, "File not found: {0}", ex); //NON-NLS } catch (UnsupportedEncodingException ex) { - logger.log(Level.SEVERE, "Unrecognized encoding"); + logger.log(Level.SEVERE, "Unrecognized encoding"); //NON-NLS } try { StringBuilder page = new StringBuilder(); - page.append("\n\n\t").append(name).append("\n\t\n\n\n\n"); - page.append("
").append(name).append("
\n
\n"); + page.append("\n\n\t").append(name).append("\n\t\n\n\n\n"); //NON-NLS + page.append("
").append(name).append("
\n
\n"); //NON-NLS if (!description.isEmpty()) { - page.append("

"); + page.append("

"); //NON-NLS page.append(description); - page.append("

\n"); + page.append("

\n"); //NON-NLS } out.write(page.toString()); currentDataType = name; rowCount = 0; } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write page head: {0}", ex); + logger.log(Level.SEVERE, "Failed to write page head: {0}", ex); //NON-NLS } } @@ -351,7 +351,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; public void endDataType() { dataTypes.put(currentDataType, rowCount); try { - out.write("
\n\n\n"); + out.write("
\n\n\n"); //NON-NLS } catch (IOException ex) { Exceptions.printStackTrace(ex); } finally { @@ -360,7 +360,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; out.flush(); out.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not close the output writer when ending data type.", ex); + logger.log(Level.WARNING, "Could not close the output writer when ending data type.", ex); //NON-NLS } out = null; } @@ -374,13 +374,13 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void startSet(String setName) { StringBuilder set = new StringBuilder(); - set.append("

").append(setName).append("

\n"); - set.append("
\n"); + set.append("

").append(setName).append("

\n"); //NON-NLS + set.append("
\n"); //NON-NLS try { out.write(set.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write set: {0}", ex); + logger.log(Level.SEVERE, "Failed to write set: {0}", ex); //NON-NLS } } @@ -390,9 +390,9 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void endSet() { try { - out.write("
\n"); + out.write("
\n"); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write end of set: {0}", ex); + logger.log(Level.SEVERE, "Failed to write end of set: {0}", ex); //NON-NLS } } @@ -403,15 +403,15 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void addSetIndex(List sets) { StringBuilder index = new StringBuilder(); - index.append("\n"); //NON-NLS try { out.write(index.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to add set index: {0}", ex); + logger.log(Level.SEVERE, "Failed to add set index: {0}", ex); //NON-NLS } } @@ -422,9 +422,9 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void addSetElement(String elementName) { try { - out.write("

" + elementName + "

\n"); + out.write("

" + elementName + "

\n"); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write set element: {0}", ex); + logger.log(Level.SEVERE, "Failed to write set element: {0}", ex); //NON-NLS } } @@ -435,16 +435,16 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void startTable(List titles) { StringBuilder ele = new StringBuilder(); - ele.append("\n\n\t\n"); + ele.append("
\n\n\t\n"); //NON-NLS for(String title : titles) { - ele.append("\t\t\n"); + ele.append("\t\t\n"); //NON-NLS } - ele.append("\t\n\n"); + ele.append("\t\n\n"); //NON-NLS try { out.write(ele.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write table start: {0}", ex); + logger.log(Level.SEVERE, "Failed to write table start: {0}", ex); //NON-NLS } } @@ -457,22 +457,22 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; */ public void startContentTagsTable(List columnHeaders) { StringBuilder htmlOutput = new StringBuilder(); - htmlOutput.append("
").append(title).append("").append(title).append("
\n\n\t\n"); + htmlOutput.append("
\n\n\t\n"); //NON-NLS // Add the specified columns. for(String columnHeader : columnHeaders) { - htmlOutput.append("\t\t\n"); + htmlOutput.append("\t\t\n"); //NON-NLS } // Add a column for a hyperlink to a local copy of the tagged content. - htmlOutput.append("\t\t\n"); + htmlOutput.append("\t\t\n"); //NON-NLS - htmlOutput.append("\t\n\n"); + htmlOutput.append("\t\n\n"); //NON-NLS try { out.write(htmlOutput.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write table start: {0}", ex); + logger.log(Level.SEVERE, "Failed to write table start: {0}", ex); //NON-NLS } } @@ -482,9 +482,9 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void endTable() { try { - out.write("
").append(columnHeader).append("").append(columnHeader).append("
\n"); + out.write("\n"); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write end of table: {0}", ex); + logger.log(Level.SEVERE, "Failed to write end of table: {0}", ex); //NON-NLS } } @@ -495,19 +495,19 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void addRow(List row) { StringBuilder builder = new StringBuilder(); - builder.append("\t\n"); + builder.append("\t\n"); //NON-NLS for (String cell : row) { - builder.append("\t\t").append(cell).append("\n"); + builder.append("\t\t").append(cell).append("\n"); //NON-NLS } - builder.append("\t\n"); + builder.append("\t\n"); //NON-NLS rowCount++; try { out.write(builder.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write row to out.", ex); + logger.log(Level.SEVERE, "Failed to write row to out.", ex); //NON-NLS } catch (NullPointerException ex) { - logger.log(Level.SEVERE, "Output writer is null. Page was not initialized before writing.", ex); + logger.log(Level.SEVERE, "Output writer is null. Page was not initialized before writing.", ex); //NON-NLS } } @@ -541,27 +541,27 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; // Add the hyperlink to the row. A column header for it was created in startTable(). StringBuilder localFileLink = new StringBuilder(); - localFileLink.append("").append(NbBundle.getMessage(this.getClass(), "ReportHTML.link.viewFile")).append(""); + localFileLink.append("\">").append(NbBundle.getMessage(this.getClass(), "ReportHTML.link.viewFile")).append(""); //NON-NLS row.add(localFileLink.toString()); StringBuilder builder = new StringBuilder(); - builder.append("\t\n"); + builder.append("\t\n"); //NON-NLS for (String cell : row) { - builder.append("\t\t").append(cell).append("\n"); + builder.append("\t\t").append(cell).append("\n"); //NON-NLS } - builder.append("\t\n"); + builder.append("\t\n"); //NON-NLS rowCount++; try { out.write(builder.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write row to out.", ex); + logger.log(Level.SEVERE, "Failed to write row to out.", ex); //NON-NLS } catch (NullPointerException ex) { - logger.log(Level.SEVERE, "Output writer is null. Page was not initialized before writing.", ex); + logger.log(Level.SEVERE, "Output writer is null. Page was not initialized before writing.", ex); //NON-NLS } } @@ -608,7 +608,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; if (thumbnailPath == null) { continue; } - String contentPath = saveContent(file, "thumbs_fullsize"); + String contentPath = saveContent(file, "thumbs_fullsize"); //NON-NLS String nameInImage; try { nameInImage = file.getUniquePath(); @@ -617,12 +617,12 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; } StringBuilder linkToThumbnail = new StringBuilder(); - linkToThumbnail.append(""); - linkToThumbnail.append(""); - linkToThumbnail.append("
"); - linkToThumbnail.append(file.getName()).append("
"); + linkToThumbnail.append(""); //NON-NLS + linkToThumbnail.append("
"); //NON-NLS + linkToThumbnail.append(file.getName()).append("
"); //NON-NLS Services services = currentCase.getServices(); TagsManager tagsManager = services.getTagsManager(); @@ -639,7 +639,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; } } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Could not find get tags for file.", ex); + logger.log(Level.WARNING, "Could not find get tags for file.", ex); //NON-NLS } currentRow.add(linkToThumbnail.toString()); @@ -735,7 +735,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public String getFilePath() { - return "HTML Report" + File.separator + "index.html"; + return "HTML Report" + File.separator + "index.html"; //NON-NLS } @@ -752,7 +752,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public String getExtension() { - return ".html"; + return ".html"; //NON-NLS } /** @@ -761,30 +761,30 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; private void writeCss() { Writer cssOut = null; try { - cssOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "index.css"), "UTF-8")); - String css = "body {margin: 0px; padding: 0px; background: #FFFFFF; font: 13px/20px Arial, Helvetica, sans-serif; color: #535353;}\n" + - "#content {padding: 30px;}\n" + - "#header {width:100%; padding: 10px; line-height: 25px; background: #07A; color: #FFF; font-size: 20px;}\n" + - "h1 {font-size: 20px; font-weight: normal; color: #07A; padding: 0 0 7px 0; margin-top: 25px; border-bottom: 1px solid #D6D6D6;}\n" + - "h2 {font-size: 20px; font-weight: bolder; color: #07A;}\n" + - "h3 {font-size: 16px; color: #07A;}\n" + - "h4 {background: #07A; color: #FFF; font-size: 16px; margin: 0 0 0 25px; padding: 0; padding-left: 15px;}\n" + - "ul.nav {list-style-type: none; line-height: 35px; padding: 0px; margin-left: 15px;}\n" + - "ul li a {font-size: 14px; color: #444; text-decoration: none; padding-left: 25px;}\n" + - "ul li a:hover {text-decoration: underline;}\n" + - "p {margin: 0 0 20px 0;}\n" + - "table {max-width: 100%; min-width: 700px; padding: 0; margin: 0; border-collapse: collapse; border-bottom: 2px solid #e5e5e5;}\n" + - ".keyword_list table {width: 100%; margin: 0 0 25px 25px; border-bottom: 2px solid #dedede;}\n" + - "table th {display: table-cell; text-align: left; padding: 8px 16px; background: #e5e5e5; color: #777; font-size: 11px; text-shadow: #e9f9fd 0 1px 0; border-top: 1px solid #dedede; border-bottom: 2px solid #e5e5e5;}\n" + - "table td {display: table-cell; padding: 8px 16px; font: 13px/20px Arial, Helvetica, sans-serif; max-width: 500px; min-width: 125px; word-break: break-all; overflow: auto;}\n" + - "table tr:nth-child(even) td {background: #f3f3f3;}"; + cssOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "index.css"), "UTF-8")); //NON-NLS NON-NLS + String css = "body {margin: 0px; padding: 0px; background: #FFFFFF; font: 13px/20px Arial, Helvetica, sans-serif; color: #535353;}\n" + //NON-NLS + "#content {padding: 30px;}\n" + //NON-NLS + "#header {width:100%; padding: 10px; line-height: 25px; background: #07A; color: #FFF; font-size: 20px;}\n" + //NON-NLS + "h1 {font-size: 20px; font-weight: normal; color: #07A; padding: 0 0 7px 0; margin-top: 25px; border-bottom: 1px solid #D6D6D6;}\n" + //NON-NLS + "h2 {font-size: 20px; font-weight: bolder; color: #07A;}\n" + //NON-NLS + "h3 {font-size: 16px; color: #07A;}\n" + //NON-NLS + "h4 {background: #07A; color: #FFF; font-size: 16px; margin: 0 0 0 25px; padding: 0; padding-left: 15px;}\n" + //NON-NLS + "ul.nav {list-style-type: none; line-height: 35px; padding: 0px; margin-left: 15px;}\n" + //NON-NLS + "ul li a {font-size: 14px; color: #444; text-decoration: none; padding-left: 25px;}\n" + //NON-NLS + "ul li a:hover {text-decoration: underline;}\n" + //NON-NLS + "p {margin: 0 0 20px 0;}\n" + //NON-NLS + "table {max-width: 100%; min-width: 700px; padding: 0; margin: 0; border-collapse: collapse; border-bottom: 2px solid #e5e5e5;}\n" + //NON-NLS + ".keyword_list table {width: 100%; margin: 0 0 25px 25px; border-bottom: 2px solid #dedede;}\n" + //NON-NLS + "table th {display: table-cell; text-align: left; padding: 8px 16px; background: #e5e5e5; color: #777; font-size: 11px; text-shadow: #e9f9fd 0 1px 0; border-top: 1px solid #dedede; border-bottom: 2px solid #e5e5e5;}\n" + //NON-NLS + "table td {display: table-cell; padding: 8px 16px; font: 13px/20px Arial, Helvetica, sans-serif; max-width: 500px; min-width: 125px; word-break: break-all; overflow: auto;}\n" + //NON-NLS + "table tr:nth-child(even) td {background: #f3f3f3;}"; //NON-NLS cssOut.write(css); } catch (FileNotFoundException ex) { - logger.log(Level.SEVERE, "Could not find index.css file to write to.", ex); + logger.log(Level.SEVERE, "Could not find index.css file to write to.", ex); //NON-NLS } catch (UnsupportedEncodingException ex) { - logger.log(Level.SEVERE, "Did not recognize encoding when writing index.css.", ex); + logger.log(Level.SEVERE, "Did not recognize encoding when writing index.css.", ex); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Error creating Writer for index.css.", ex); + logger.log(Level.SEVERE, "Error creating Writer for index.css.", ex); //NON-NLS } finally { try { if(cssOut != null) { @@ -802,24 +802,24 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; private void writeIndex() { Writer indexOut = null; try { - indexOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "index.html"), "UTF-8")); + indexOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "index.html"), "UTF-8")); //NON-NLS StringBuilder index = new StringBuilder(); - index.append("\n").append( + index.append("<head>\n<title>").append( //NON-NLS NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.title", currentCase.getName())).append( - "\n"); - index.append("\n"); - index.append("\n"); - index.append("\n"); - index.append("\n"); - index.append("\n"); - index.append("").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.noFrames.msg")).append("<br />\n"); - index.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.noFrames.seeNav")).append("<br />\n"); - index.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.seeSum")).append("\n"); - index.append("\n"); - index.append(""); + "\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append("").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.noFrames.msg")).append("<br />\n"); //NON-NLS + index.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.noFrames.seeNav")).append("<br />\n"); //NON-NLS + index.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.seeSum")).append("\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append(""); //NON-NLS indexOut.write(index.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Error creating Writer for index.html: {0}", ex); + logger.log(Level.SEVERE, "Error creating Writer for index.html: {0}", ex); //NON-NLS } finally { try { if(indexOut != null) { @@ -837,38 +837,38 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; private void writeNav() { Writer navOut = null; try { - navOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "nav.html"), "UTF-8")); + navOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "nav.html"), "UTF-8")); //NON-NLS StringBuilder nav = new StringBuilder(); - nav.append("\n\n\t").append( + nav.append("<html>\n<head>\n\t<title>").append( //NON-NLS NbBundle.getMessage(this.getClass(), "ReportHTML.writeNav.title")) - .append("\n\t\n\n\n"); - nav.append("
\n

").append( - NbBundle.getMessage(this.getClass(), "ReportHTML.writeNav.h1")).append("

\n"); - nav.append("\n"); //NON-NLS + nav.append("
\n\n"); //NON-NLS navOut.write(nav.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write end of report navigation menu: {0}", ex); + logger.log(Level.SEVERE, "Failed to write end of report navigation menu: {0}", ex); //NON-NLS } finally { if (navOut != null) { try { navOut.flush(); navOut.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not close navigation out writer."); + logger.log(Level.WARNING, "Could not close navigation out writer."); //NON-NLS } } } @@ -882,23 +882,23 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; if (generatorLogoPath != null && ! generatorLogoPath.isEmpty()) { File from = new File(generatorLogoPath); File to = new File(path); - FileUtil.copyFile(FileUtil.toFileObject(from), FileUtil.toFileObject(to), "generator_logo"); + FileUtil.copyFile(FileUtil.toFileObject(from), FileUtil.toFileObject(to), "generator_logo"); //NON-NLS } String agencyLogoPath = reportBranding.getAgencyLogoPath(); if (agencyLogoPath != null && ! agencyLogoPath.isEmpty() ) { File from = new File(agencyLogoPath); File to = new File(path); - FileUtil.copyFile(FileUtil.toFileObject(from), FileUtil.toFileObject(to), "agency_logo"); + FileUtil.copyFile(FileUtil.toFileObject(from), FileUtil.toFileObject(to), "agency_logo"); //NON-NLS } - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/favicon.ico"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/favicon.ico"); //NON-NLS output = new FileOutputStream(new File(path + File.separator + "favicon.ico")); FileUtil.copy(in, output); in.close(); output.close(); - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/summary.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/summary.png"); //NON-NLS output = new FileOutputStream(new File(path + File.separator + "summary.png")); FileUtil.copy(in, output); in.close(); @@ -906,7 +906,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to extract images for HTML report.", ex); + logger.log(Level.SEVERE, "Failed to extract images for HTML report.", ex); //NON-NLS } finally { if (output != null) { try { @@ -929,27 +929,27 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; private void writeSummary() { Writer out = null; try { - out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "summary.html"), "UTF-8")); + out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "summary.html"), "UTF-8")); //NON-NLS StringBuilder head = new StringBuilder(); - head.append("\n\n").append( - NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.title")).append("\n"); - head.append("\n"); - head.append("\n\n"); + head.append("\n\n").append( //NON-NLS + NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.title")).append("\n"); //NON-NLS + head.append("\n"); //NON-NLS + head.append("\n\n"); //NON-NLS out.write(head.toString()); DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); @@ -972,78 +972,78 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; final boolean agencyLogoSet = reportBranding.getAgencyLogoPath() != null && !reportBranding.getAgencyLogoPath().isEmpty(); final boolean generatorLogoSet = reportBranding.getGeneratorLogoPath() != null && !reportBranding.getGeneratorLogoPath().isEmpty(); - summary.append("
\n"); - summary.append("

").append(reportTitle) + summary.append("
\n"); //NON-NLS + summary.append("

").append(reportTitle) //NON-NLS .append(running ? NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.warningMsg") : "") - .append("

\n"); - summary.append("

").append( - NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.reportGenOn.text", datetime)).append("

\n"); - summary.append("
\n"); + .append("

\n"); //NON-NLS + summary.append("

").append( //NON-NLS + NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.reportGenOn.text", datetime)).append("

\n"); //NON-NLS + summary.append("
\n"); //NON-NLS if (agencyLogoSet) { - summary.append("
\n"); - summary.append("\n"); - summary.append("
\n"); + summary.append("
\n"); //NON-NLS + summary.append("\n"); //NON-NLS + summary.append("
\n"); //NON-NLS } - final String align = agencyLogoSet?"right":"left"; - summary.append("
\n"); - summary.append("\n"); - summary.append("\n"); - summary.append("\n"); - summary.append("\n"); //NON-NLS + summary.append("\n"); //NON-NLS + summary.append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseName")) - .append("").append(caseName).append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseNum")) - .append("").append(!caseNumber.isEmpty() ? caseNumber : NbBundle - .getMessage(this.getClass(), "ReportHTML.writeSum.noCaseNum")).append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.examiner")).append("") + final String align = agencyLogoSet?"right":"left"; //NON-NLS NON-NLS + summary.append("
\n"); //NON-NLS + summary.append("\n"); //NON-NLS + summary.append("\n"); //NON-NLS NON-NLS + summary.append("\n"); //NON-NLS + summary.append("\n"); - summary.append("\n"); - summary.append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseName")) //NON-NLS + .append("").append(caseName).append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseNum")) //NON-NLS + .append("").append(!caseNumber.isEmpty() ? caseNumber : NbBundle //NON-NLS + .getMessage(this.getClass(), "ReportHTML.writeSum.noCaseNum")).append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.examiner")).append("") //NON-NLS .append(!examiner.isEmpty() ? examiner : NbBundle .getMessage(this.getClass(), "ReportHTML.writeSum.noExaminer")) - .append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.numImages")) - .append("").append(imagecount).append("
\n"); - summary.append("
\n"); - summary.append("
\n"); - summary.append("\n"); + .append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.numImages")) //NON-NLS + .append("").append(imagecount).append("
\n"); //NON-NLS + summary.append("
\n"); //NON-NLS + summary.append("
\n"); //NON-NLS + summary.append("
\n"); //NON-NLS summary.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.imageInfoHeading")); - summary.append("
\n"); + summary.append("
\n"); //NON-NLS try { Image[] images = new Image[imagecount]; for(int i=0; i").append(img.getName()).append("

\n"); - summary.append("\n"); - summary.append("
").append( + summary.append("

").append(img.getName()).append("

\n"); //NON-NLS + summary.append("\n"); //NON-NLS + summary.append("\n"); + .append("\n"); //NON-NLS for(String imgPath : img.getPaths()) { - summary.append("\n"); + .append("\n"); //NON-NLS } - summary.append("
").append( //NON-NLS NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.timezone")) - .append("").append(img.getTimeZone()).append("
").append(img.getTimeZone()).append("
").append( + summary.append("
").append( //NON-NLS NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.path")) - .append("").append(imgPath).append("
").append(imgPath).append("
\n"); + summary.append("
\n"); //NON-NLS } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Unable to get image information for the HTML report."); + logger.log(Level.WARNING, "Unable to get image information for the HTML report."); //NON-NLS } - summary.append("
\n"); + summary.append("
\n"); //NON-NLS if (generatorLogoSet) { - summary.append("
\n"); - summary.append("\n"); - summary.append("
\n"); + summary.append("
\n"); //NON-NLS + summary.append("\n"); //NON-NLS + summary.append("
\n"); //NON-NLS } - summary.append("
\n"); + summary.append("
\n"); //NON-NLS if (reportFooter != null) { - summary.append("

").append(reportFooter).append("

\n"); + summary.append("

").append(reportFooter).append("

\n"); //NON-NLS } - summary.append("
\n"); - summary.append(""); + summary.append("\n"); //NON-NLS + summary.append(""); //NON-NLS out.write(summary.toString()); } catch (FileNotFoundException ex) { - logger.log(Level.SEVERE, "Could not find summary.html file to write to."); + logger.log(Level.SEVERE, "Could not find summary.html file to write to."); //NON-NLS } catch (UnsupportedEncodingException ex) { - logger.log(Level.SEVERE, "Did not recognize encoding when writing summary.hmtl."); + logger.log(Level.SEVERE, "Did not recognize encoding when writing summary.hmtl."); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Error creating Writer for summary.html."); + logger.log(Level.SEVERE, "Error creating Writer for summary.html."); //NON-NLS } finally { try { if(out != null) { @@ -1066,7 +1066,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; FileObject dest = FileUtil.toFileObject(to); FileUtil.copyFile(from, dest, thumbFile.getName(), ""); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write thumb file to report directory.", ex); + logger.log(Level.SEVERE, "Failed to write thumb file to report directory.", ex); //NON-NLS } return THUMBS_REL_PATH + thumbFile.getName(); diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java index 05cbb3b6a7..b466d9bd0d 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java @@ -80,8 +80,8 @@ class ReportKML implements GeneralReportModule { progressPanel.setIndeterminate(false); progressPanel.start(); progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportKML.progress.querying")); - reportPath = path + "ReportKML.kml"; - String reportPath2 = path + "ReportKML.txt"; + reportPath = path + "ReportKML.kml"; //NON-NLS + String reportPath2 = path + "ReportKML.txt"; //NON-NLS currentCase = Case.getCurrentCase(); skCase = currentCase.getSleuthkitCase(); @@ -151,18 +151,18 @@ class ReportKML implements GeneralReportModule { /* * Step 1: generate XML stub */ - Namespace ns = Namespace.getNamespace("", "http://earth.google.com/kml/2.2"); + Namespace ns = Namespace.getNamespace("", "http://earth.google.com/kml/2.2"); //NON-NLS // kml - Element kml = new Element("kml", ns); + Element kml = new Element("kml", ns); //NON-NLS Document kmlDocument = new Document(kml); // Document - Element document = new Element("Document", ns); + Element document = new Element("Document", ns); //NON-NLS kml.addContent(document); // name - Element name = new Element("name", ns); - name.setText("Java Generated KML Document"); + Element name = new Element("name", ns); //NON-NLS + name.setText("Java Generated KML Document"); //NON-NLS document.addContent(name); /* @@ -170,26 +170,26 @@ class ReportKML implements GeneralReportModule { */ // Style - Element style = new Element("Style", ns); - style.setAttribute("id", "redIcon"); + Element style = new Element("Style", ns); //NON-NLS + style.setAttribute("id", "redIcon"); //NON-NLS document.addContent(style); // IconStyle - Element iconStyle = new Element("IconStyle", ns); + Element iconStyle = new Element("IconStyle", ns); //NON-NLS style.addContent(iconStyle); // color - Element color = new Element("color", ns); - color.setText("990000ff"); + Element color = new Element("color", ns); //NON-NLS + color.setText("990000ff"); //NON-NLS iconStyle.addContent(color); // Icon - Element icon = new Element("Icon", ns); + Element icon = new Element("Icon", ns); //NON-NLS iconStyle.addContent(icon); // href - Element href = new Element("href", ns); - href.setText("http://www.cs.mun.ca/~hoeber/teaching/cs4767/notes/02.1-kml/circle.png"); + Element href = new Element("href", ns); //NON-NLS + href.setText("http://www.cs.mun.ca/~hoeber/teaching/cs4767/notes/02.1-kml/circle.png"); //NON-NLS icon.addContent(href); progressPanel.increment(); /* @@ -208,37 +208,37 @@ class ReportKML implements GeneralReportModule { if (lineParts.length == 4) { String coordinates = lineParts[1].trim() + "," + lineParts[0].trim(); //lat,lon // Placemark - Element placemark = new Element("Placemark", ns); + Element placemark = new Element("Placemark", ns); //NON-NLS document.addContent(placemark); // name - Element pmName = new Element("name", ns); + Element pmName = new Element("name", ns); //NON-NLS pmName.setText(lineParts[3].trim()); placemark.addContent(pmName); // Path - Element pmPath = new Element("Path", ns); + Element pmPath = new Element("Path", ns); //NON-NLS pmPath.setText(lineParts[2].trim()); placemark.addContent(pmPath); // description - Element pmDescription = new Element("description", ns); - String xml = "

" + shortenPath(reportPath) + ""); + pathLabel.setText("" + shortenPath(reportPath) + ""); //NON-NLS pathLabel.setToolTipText(reportPath); // Add the "link" effect to the pathLabel @@ -137,7 +137,7 @@ public class ReportProgressPanel extends javax.swing.JPanel { EventQueue.invokeLater(new Runnable() { @Override public void run() { - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel.png"))); + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel.png"))); //NON-NLS cancelButton.setToolTipText( NbBundle.getMessage(this.getClass(), "ReportProgressPanel.start.cancelButton.text")); processingLabel.setText(NbBundle.getMessage(this.getClass(), "ReportProgressPanel.start.progress.text")); @@ -241,7 +241,7 @@ public class ReportProgressPanel extends javax.swing.JPanel { processingLabel.setText( NbBundle.getMessage(this.getClass(), "ReportProgressPanel.complete.processLbl.text")); reportProgressBar.setValue(reportProgressBar.getMaximum()); - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_complete.png"))); + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_complete.png"))); //NON-NLS cancelButton.setToolTipText( NbBundle.getMessage(this.getClass(), "ReportProgressPanel.complete.cancelButton.text")); } @@ -268,7 +268,7 @@ public class ReportProgressPanel extends javax.swing.JPanel { setMinimumSize(new java.awt.Dimension(486, 68)); - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_loading.png"))); // NOI18N + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_loading.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.cancelButton.text")); // NOI18N cancelButton.setToolTipText(org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.cancelButton.toolTipText")); // NOI18N cancelButton.setBorder(null); @@ -289,12 +289,12 @@ public class ReportProgressPanel extends javax.swing.JPanel { } }); - reportLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + reportLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(reportLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.reportLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(pathLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.pathLabel.text")); // NOI18N - processingLabel.setFont(new java.awt.Font("Tahoma", 2, 10)); // NOI18N + processingLabel.setFont(new java.awt.Font("Tahoma", 2, 10)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(processingLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.processingLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(separationLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.separationLabel.text")); // NOI18N @@ -374,7 +374,7 @@ public class ReportProgressPanel extends javax.swing.JPanel { break; default: setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel_hover.png"))); + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel_hover.png"))); //NON-NLS break; } }//GEN-LAST:event_cancelButtonMouseEntered @@ -387,11 +387,11 @@ public class ReportProgressPanel extends javax.swing.JPanel { break; case QUEUING: setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_loading.png"))); + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_loading.png"))); //NON-NLS break; case RUNNING: setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel.png"))); + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel.png"))); //NON-NLS break; } }//GEN-LAST:event_cancelButtonMouseExited diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java index 587dd1ff27..bf7524e408 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java @@ -76,7 +76,7 @@ final class ReportVisualPanel2 extends JPanel { try { tagNamesInUse = Case.getCurrentCase().getServices().getTagsManager().getTagNamesInUse(); } catch (TskCoreException ex) { - Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); + Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS return; } @@ -123,7 +123,7 @@ final class ReportVisualPanel2 extends JPanel { artifactStates.put(type, Boolean.TRUE); } } catch (TskCoreException ex) { - Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage(), ex); + Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage(), ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java index af9aeea288..fcabfca3f2 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java @@ -71,11 +71,11 @@ public final class ReportWizardAction extends CallableSystemAction implements P wiz.setTitle(NbBundle.getMessage(ReportWizardAction.class, "ReportWizardAction.reportWiz.title")); if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) { @SuppressWarnings("unchecked") - ReportGenerator generator = new ReportGenerator((Map)wiz.getProperty("tableModuleStates"), - (Map)wiz.getProperty("generalModuleStates"), - (Map)wiz.getProperty("fileModuleStates")); - generator.generateTableReports((Map)wiz.getProperty("artifactStates"), (Map)wiz.getProperty("tagStates")); - generator.generateFileListReports((Map)wiz.getProperty("fileReportOptions")); + ReportGenerator generator = new ReportGenerator((Map)wiz.getProperty("tableModuleStates"), //NON-NLS + (Map)wiz.getProperty("generalModuleStates"), //NON-NLS + (Map)wiz.getProperty("fileModuleStates")); //NON-NLS + generator.generateTableReports((Map)wiz.getProperty("artifactStates"), (Map)wiz.getProperty("tagStates")); //NON-NLS + generator.generateFileListReports((Map)wiz.getProperty("fileReportOptions")); //NON-NLS generator.generateGeneralReports(); generator.displayProgressPanels(); } @@ -96,7 +96,7 @@ public final class ReportWizardAction extends CallableSystemAction implements P if (!exists) { boolean reportCreate = (new File(newCase.getCaseDirectory() + File.separator + "Reports")).mkdirs(); if (!reportCreate) { - logger.log(Level.WARNING, "Could not create Reports directory for case. It does not exist."); + logger.log(Level.WARNING, "Could not create Reports directory for case. It does not exist."); //NON-NLS } } } @@ -140,7 +140,7 @@ public final class ReportWizardAction extends CallableSystemAction implements P */ @Override public Component getToolbarPresenter() { - ImageIcon icon = new ImageIcon(getClass().getResource("images/btn_icon_generate_report.png")); + ImageIcon icon = new ImageIcon(getClass().getResource("images/btn_icon_generate_report.png")); //NON-NLS toolbarButton.setIcon(icon); toolbarButton.setText(NbBundle.getMessage(this.getClass(), "ReportWizardAction.toolBarButton.text")); return toolbarButton; diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java index ffa7b56796..b428e3cad2 100755 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java @@ -79,7 +79,7 @@ import org.openide.util.NbBundle; @Override public void storeSettings(WizardDescriptor data) { - data.putProperty("fileReportOptions", getComponent().getFileReportOptions()); + data.putProperty("fileReportOptions", getComponent().getFileReportOptions()); //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java index 29df382148..830e7bccef 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java @@ -134,8 +134,8 @@ import org.openide.util.NbPreferences; // Update path through configuration panels boolean generalModule, tableModule; // These preferences are set in ReportWizardPanel1.storeSettings() - generalModule = NbPreferences.forModule(ReportWizardPanel1.class).getBoolean("generalModule", true); - tableModule = NbPreferences.forModule(ReportWizardPanel1.class).getBoolean("tableModule", true); + generalModule = NbPreferences.forModule(ReportWizardPanel1.class).getBoolean("generalModule", true); //NON-NLS + tableModule = NbPreferences.forModule(ReportWizardPanel1.class).getBoolean("tableModule", true); //NON-NLS enableConfigPanels(generalModule, tableModule); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java index abac0b9969..1f961e6fe8 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java @@ -109,15 +109,15 @@ import org.openide.util.NbPreferences; public void storeSettings(WizardDescriptor wiz) { Map tables = getComponent().getTableModuleStates(); Map generals = getComponent().getGeneralModuleStates(); - wiz.putProperty("tableModuleStates", tables); - wiz.putProperty("generalModuleStates", generals); - wiz.putProperty("fileModuleStates", getComponent().getFileModuleStates()); + wiz.putProperty("tableModuleStates", tables); //NON-NLS + wiz.putProperty("generalModuleStates", generals); //NON-NLS + wiz.putProperty("fileModuleStates", getComponent().getFileModuleStates()); //NON-NLS // Store preferences that WizardIterator will use to determine what // panels need to be shown Preferences prefs = NbPreferences.forModule(ReportWizardPanel1.class); - prefs.putBoolean("tableModule", any(tables.values())); - prefs.putBoolean("generalModule", any(generals.values())); + prefs.putBoolean("tableModule", any(tables.values())); //NON-NLS + prefs.putBoolean("generalModule", any(generals.values())); //NON-NLS } /** diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java index 767b9266bd..4cf694cd0c 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java @@ -95,8 +95,8 @@ import org.openide.util.NbPreferences; @Override public void storeSettings(WizardDescriptor wiz) { - wiz.putProperty("tagStates", getComponent().getTagStates()); - wiz.putProperty("artifactStates", getComponent().getArtifactStates()); - wiz.putProperty("isTagsSelected", getComponent().isTaggedResultsRadioButtonSelected()); + wiz.putProperty("tagStates", getComponent().getTagStates()); //NON-NLS + wiz.putProperty("artifactStates", getComponent().getArtifactStates()); //NON-NLS + wiz.putProperty("isTagsSelected", getComponent().isTaggedResultsRadioButtonSelected()); //NON-NLS } }