Merge pull request #663 from mrtizmo/report

Report - Added NON-NLS tags
This commit is contained in:
Richard Cordovano 2014-04-22 12:57:24 -04:00
commit aed56f9807
18 changed files with 361 additions and 361 deletions

View File

@ -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
}
}

View File

@ -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);

View File

@ -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 "";
}

View File

@ -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

View File

@ -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<FsContent> 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;
}

View File

@ -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);
}

View File

@ -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

View File

@ -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));

View File

@ -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<TableReportModule, Boolean> tableModuleStates, Map<GeneralReportModule, Boolean> generalModuleStates, Map<FileReportModule, Boolean> fileListModuleStates) {
// Create the root reports directory path of the form: <CASE DIRECTORY>/Reports/<Case fileName> <Timestamp>/
@ -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<AbstractFile> 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<String> columnHeaders = new ArrayList<>(Arrays.asList("File", "Tag", "Comment"));
ArrayList<String> 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<String> 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<String> 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<String> 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<String> 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.<String>emptyList();
}
}

View File

@ -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("<html>\n<head>\n\t<title>").append(name).append("</title>\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"index.css\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n</head>\n<body>\n");
page.append("<div id=\"header\">").append(name).append("</div>\n<div id=\"content\">\n");
page.append("<html>\n<head>\n\t<title>").append(name).append("</title>\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"index.css\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n</head>\n<body>\n"); //NON-NLS
page.append("<div id=\"header\">").append(name).append("</div>\n<div id=\"content\">\n"); //NON-NLS
if (!description.isEmpty()) {
page.append("<p><strong>");
page.append("<p><strong>"); //NON-NLS
page.append(description);
page.append("</string></p>\n");
page.append("</string></p>\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("</div>\n</body>\n</html>\n");
out.write("</div>\n</body>\n</html>\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("<h1><a name=\"").append(setName).append("\">").append(setName).append("</a></h1>\n");
set.append("<div class=\"keyword_list\">\n");
set.append("<h1><a name=\"").append(setName).append("\">").append(setName).append("</a></h1>\n"); //NON-NLS
set.append("<div class=\"keyword_list\">\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("</div>\n");
out.write("</div>\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<String> sets) {
StringBuilder index = new StringBuilder();
index.append("<ul>\n");
index.append("<ul>\n"); //NON-NLS
for (String set : sets) {
index.append("\t<li><a href=\"#").append(set).append("\">").append(set).append("</a></li>\n");
index.append("\t<li><a href=\"#").append(set).append("\">").append(set).append("</a></li>\n"); //NON-NLS
}
index.append("</ul>\n");
index.append("</ul>\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("<h4>" + elementName + "</h4>\n");
out.write("<h4>" + elementName + "</h4>\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<String> titles) {
StringBuilder ele = new StringBuilder();
ele.append("<table>\n<thead>\n\t<tr>\n");
ele.append("<table>\n<thead>\n\t<tr>\n"); //NON-NLS
for(String title : titles) {
ele.append("\t\t<th>").append(title).append("</th>\n");
ele.append("\t\t<th>").append(title).append("</th>\n"); //NON-NLS
}
ele.append("\t</tr>\n</thead>\n");
ele.append("\t</tr>\n</thead>\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<String> columnHeaders) {
StringBuilder htmlOutput = new StringBuilder();
htmlOutput.append("<table>\n<thead>\n\t<tr>\n");
htmlOutput.append("<table>\n<thead>\n\t<tr>\n"); //NON-NLS
// Add the specified columns.
for(String columnHeader : columnHeaders) {
htmlOutput.append("\t\t<th>").append(columnHeader).append("</th>\n");
htmlOutput.append("\t\t<th>").append(columnHeader).append("</th>\n"); //NON-NLS
}
// Add a column for a hyperlink to a local copy of the tagged content.
htmlOutput.append("\t\t<th></th>\n");
htmlOutput.append("\t\t<th></th>\n"); //NON-NLS
htmlOutput.append("\t</tr>\n</thead>\n");
htmlOutput.append("\t</tr>\n</thead>\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("</table>\n");
out.write("</table>\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<String> row) {
StringBuilder builder = new StringBuilder();
builder.append("\t<tr>\n");
builder.append("\t<tr>\n"); //NON-NLS
for (String cell : row) {
builder.append("\t\t<td>").append(cell).append("</td>\n");
builder.append("\t\t<td>").append(cell).append("</td>\n"); //NON-NLS
}
builder.append("\t</tr>\n");
builder.append("\t</tr>\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("<a href=\"");
localFileLink.append("<a href=\""); //NON-NLS
localFileLink.append(localFilePath);
localFileLink.append("\">").append(NbBundle.getMessage(this.getClass(), "ReportHTML.link.viewFile")).append("</a>");
localFileLink.append("\">").append(NbBundle.getMessage(this.getClass(), "ReportHTML.link.viewFile")).append("</a>"); //NON-NLS
row.add(localFileLink.toString());
StringBuilder builder = new StringBuilder();
builder.append("\t<tr>\n");
builder.append("\t<tr>\n"); //NON-NLS
for (String cell : row) {
builder.append("\t\t<td>").append(cell).append("</td>\n");
builder.append("\t\t<td>").append(cell).append("</td>\n"); //NON-NLS
}
builder.append("\t</tr>\n");
builder.append("\t</tr>\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("<a href=\"");
linkToThumbnail.append("<a href=\""); //NON-NLS
linkToThumbnail.append(contentPath);
linkToThumbnail.append("\">");
linkToThumbnail.append("<img src=\"").append(thumbnailPath).append("\" title=\"").append(nameInImage).append("\"/>");
linkToThumbnail.append("</a><br>");
linkToThumbnail.append(file.getName()).append("<br>");
linkToThumbnail.append("<img src=\"").append(thumbnailPath).append("\" title=\"").append(nameInImage).append("\"/>"); //NON-NLS
linkToThumbnail.append("</a><br>"); //NON-NLS
linkToThumbnail.append(file.getName()).append("<br>"); //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("<head>\n<title>").append(
index.append("<head>\n<title>").append( //NON-NLS
NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.title", currentCase.getName())).append(
"</title>\n");
index.append("<link rel=\"icon\" type=\"image/ico\" href=\"favicon.ico\" />\n");
index.append("</head>\n");
index.append("<frameset cols=\"350px,*\">\n");
index.append("<frame src=\"nav.html\" name=\"nav\">\n");
index.append("<frame src=\"summary.html\" name=\"content\">\n");
index.append("<noframes>").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("</noframes>\n");
index.append("</frameset>\n");
index.append("</html>");
"</title>\n"); //NON-NLS
index.append("<link rel=\"icon\" type=\"image/ico\" href=\"favicon.ico\" />\n"); //NON-NLS
index.append("</head>\n"); //NON-NLS
index.append("<frameset cols=\"350px,*\">\n"); //NON-NLS
index.append("<frame src=\"nav.html\" name=\"nav\">\n"); //NON-NLS
index.append("<frame src=\"summary.html\" name=\"content\">\n"); //NON-NLS
index.append("<noframes>").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("</noframes>\n"); //NON-NLS
index.append("</frameset>\n"); //NON-NLS
index.append("</html>"); //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("<html>\n<head>\n\t<title>").append(
nav.append("<html>\n<head>\n\t<title>").append( //NON-NLS
NbBundle.getMessage(this.getClass(), "ReportHTML.writeNav.title"))
.append("</title>\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"index.css\" />\n</head>\n<body>\n");
nav.append("<div id=\"content\">\n<h1>").append(
NbBundle.getMessage(this.getClass(), "ReportHTML.writeNav.h1")).append("</h1>\n");
nav.append("<ul class=\"nav\">\n");
nav.append("<li style=\"background: url(summary.png) left center no-repeat;\"><a href=\"summary.html\" target=\"content\">")
.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeNav.summary")).append("</a></li>\n");
.append("</title>\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"index.css\" />\n</head>\n<body>\n"); //NON-NLS
nav.append("<div id=\"content\">\n<h1>").append( //NON-NLS
NbBundle.getMessage(this.getClass(), "ReportHTML.writeNav.h1")).append("</h1>\n"); //NON-NLS
nav.append("<ul class=\"nav\">\n"); //NON-NLS
nav.append("<li style=\"background: url(summary.png) left center no-repeat;\"><a href=\"summary.html\" target=\"content\">") //NON-NLS
.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeNav.summary")).append("</a></li>\n"); //NON-NLS
for (String dataType : dataTypes.keySet()) {
String dataTypeEsc = dataTypeToFileName(dataType);
String iconFileName = useDataTypeIcon(dataType);
nav.append("<li style=\"background: url('").append(iconFileName)
.append("') left center no-repeat;\"><a href=\"")
.append(dataTypeEsc).append(".html\" target=\"content\">")
nav.append("<li style=\"background: url('").append(iconFileName) //NON-NLS
.append("') left center no-repeat;\"><a href=\"") //NON-NLS
.append(dataTypeEsc).append(".html\" target=\"content\">") //NON-NLS
.append(dataType).append(" (").append(dataTypes.get(dataType))
.append(")</a></li>\n");
.append(")</a></li>\n"); //NON-NLS
}
nav.append("</ul>\n");
nav.append("</div>\n</body>\n</html>");
nav.append("</ul>\n"); //NON-NLS
nav.append("</div>\n</body>\n</html>"); //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("<html>\n<head>\n<title>").append(
NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.title")).append("</title>\n");
head.append("<style type=\"text/css\">\n");
head.append("body { padding: 0px; margin: 0px; font: 13px/20px Arial, Helvetica, sans-serif; color: #535353; }\n");
head.append("#wrapper { width: 90%; margin: 0px auto; margin-top: 35px; }\n");
head.append("h1 { color: #07A; font-size: 36px; line-height: 42px; font-weight: normal; margin: 0px; border-bottom: 1px solid #81B9DB; }\n");
head.append("h1 span { color: #F00; display: block; font-size: 16px; font-weight: bold; line-height: 22px;}\n");
head.append("h2 { padding: 0 0 3px 0; margin: 0px; color: #07A; font-weight: normal; border-bottom: 1px dotted #81B9DB; }\n");
head.append("table td { padding-right: 25px; }\n");
head.append("p.subheadding { padding: 0px; margin: 0px; font-size: 11px; color: #B5B5B5; }\n");
head.append(".title { width: 660px; margin-bottom: 50px; }\n");
head.append(".left { float: left; width: 250px; margin-top: 20px; text-align: center; }\n");
head.append(".left img { max-width: 250px; max-height: 250px; min-width: 200px; min-height: 200px; }\n");
head.append(".right { float: right; width: 385px; margin-top: 25px; font-size: 14px; }\n");
head.append(".clear { clear: both; }\n");
head.append(".info p { padding: 3px 10px; background: #e5e5e5; color: #777; font-size: 12px; font-weight: bold; text-shadow: #e9f9fd 0 1px 0; border-top: 1px solid #dedede; border-bottom: 2px solid #dedede; }\n");
head.append(".info table { margin: 0 25px 20px 25px; }\n");
head.append("</style>\n");
head.append("</head>\n<body>\n");
head.append("<html>\n<head>\n<title>").append( //NON-NLS
NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.title")).append("</title>\n"); //NON-NLS
head.append("<style type=\"text/css\">\n"); //NON-NLS
head.append("body { padding: 0px; margin: 0px; font: 13px/20px Arial, Helvetica, sans-serif; color: #535353; }\n"); //NON-NLS
head.append("#wrapper { width: 90%; margin: 0px auto; margin-top: 35px; }\n"); //NON-NLS
head.append("h1 { color: #07A; font-size: 36px; line-height: 42px; font-weight: normal; margin: 0px; border-bottom: 1px solid #81B9DB; }\n"); //NON-NLS
head.append("h1 span { color: #F00; display: block; font-size: 16px; font-weight: bold; line-height: 22px;}\n"); //NON-NLS
head.append("h2 { padding: 0 0 3px 0; margin: 0px; color: #07A; font-weight: normal; border-bottom: 1px dotted #81B9DB; }\n"); //NON-NLS
head.append("table td { padding-right: 25px; }\n"); //NON-NLS
head.append("p.subheadding { padding: 0px; margin: 0px; font-size: 11px; color: #B5B5B5; }\n"); //NON-NLS
head.append(".title { width: 660px; margin-bottom: 50px; }\n"); //NON-NLS
head.append(".left { float: left; width: 250px; margin-top: 20px; text-align: center; }\n"); //NON-NLS
head.append(".left img { max-width: 250px; max-height: 250px; min-width: 200px; min-height: 200px; }\n"); //NON-NLS
head.append(".right { float: right; width: 385px; margin-top: 25px; font-size: 14px; }\n"); //NON-NLS
head.append(".clear { clear: both; }\n"); //NON-NLS
head.append(".info p { padding: 3px 10px; background: #e5e5e5; color: #777; font-size: 12px; font-weight: bold; text-shadow: #e9f9fd 0 1px 0; border-top: 1px solid #dedede; border-bottom: 2px solid #dedede; }\n"); //NON-NLS
head.append(".info table { margin: 0 25px 20px 25px; }\n"); //NON-NLS
head.append("</style>\n"); //NON-NLS
head.append("</head>\n<body>\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("<div id=\"wrapper\">\n");
summary.append("<h1>").append(reportTitle)
summary.append("<div id=\"wrapper\">\n"); //NON-NLS
summary.append("<h1>").append(reportTitle) //NON-NLS
.append(running ? NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.warningMsg") : "")
.append("</h1>\n");
summary.append("<p class=\"subheadding\">").append(
NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.reportGenOn.text", datetime)).append("</p>\n");
summary.append("<div class=\"title\">\n");
.append("</h1>\n"); //NON-NLS
summary.append("<p class=\"subheadding\">").append( //NON-NLS
NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.reportGenOn.text", datetime)).append("</p>\n"); //NON-NLS
summary.append("<div class=\"title\">\n"); //NON-NLS
if (agencyLogoSet) {
summary.append("<div class=\"left\">\n");
summary.append("<img src=\"agency_logo.png\" />\n");
summary.append("</div>\n");
summary.append("<div class=\"left\">\n"); //NON-NLS
summary.append("<img src=\"agency_logo.png\" />\n"); //NON-NLS
summary.append("</div>\n"); //NON-NLS
}
final String align = agencyLogoSet?"right":"left";
summary.append("<div class=\"").append(align).append("\">\n");
summary.append("<table>\n");
summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseName"))
.append("</td><td>").append(caseName).append("</td></tr>\n");
summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseNum"))
.append("</td><td>").append(!caseNumber.isEmpty() ? caseNumber : NbBundle
.getMessage(this.getClass(), "ReportHTML.writeSum.noCaseNum")).append("</td></tr>\n");
summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.examiner")).append("</td><td>")
final String align = agencyLogoSet?"right":"left"; //NON-NLS NON-NLS
summary.append("<div class=\"").append(align).append("\">\n"); //NON-NLS
summary.append("<table>\n"); //NON-NLS
summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseName")) //NON-NLS
.append("</td><td>").append(caseName).append("</td></tr>\n"); //NON-NLS NON-NLS
summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseNum")) //NON-NLS
.append("</td><td>").append(!caseNumber.isEmpty() ? caseNumber : NbBundle //NON-NLS
.getMessage(this.getClass(), "ReportHTML.writeSum.noCaseNum")).append("</td></tr>\n"); //NON-NLS
summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.examiner")).append("</td><td>") //NON-NLS
.append(!examiner.isEmpty() ? examiner : NbBundle
.getMessage(this.getClass(), "ReportHTML.writeSum.noExaminer"))
.append("</td></tr>\n");
summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.numImages"))
.append("</td><td>").append(imagecount).append("</td></tr>\n");
summary.append("</table>\n");
summary.append("</div>\n");
summary.append("<div class=\"clear\"></div>\n");
summary.append("</div>\n");
.append("</td></tr>\n"); //NON-NLS
summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.numImages")) //NON-NLS
.append("</td><td>").append(imagecount).append("</td></tr>\n"); //NON-NLS
summary.append("</table>\n"); //NON-NLS
summary.append("</div>\n"); //NON-NLS
summary.append("<div class=\"clear\"></div>\n"); //NON-NLS
summary.append("</div>\n"); //NON-NLS
summary.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.imageInfoHeading"));
summary.append("<div class=\"info\">\n");
summary.append("<div class=\"info\">\n"); //NON-NLS
try {
Image[] images = new Image[imagecount];
for(int i=0; i<imagecount; i++) {
images[i] = skCase.getImageById(currentCase.getImageIDs()[i]);
}
for(Image img : images) {
summary.append("<p>").append(img.getName()).append("</p>\n");
summary.append("<table>\n");
summary.append("<tr><td>").append(
summary.append("<p>").append(img.getName()).append("</p>\n"); //NON-NLS
summary.append("<table>\n"); //NON-NLS
summary.append("<tr><td>").append( //NON-NLS
NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.timezone"))
.append("</td><td>").append(img.getTimeZone()).append("</td></tr>\n");
.append("</td><td>").append(img.getTimeZone()).append("</td></tr>\n"); //NON-NLS
for(String imgPath : img.getPaths()) {
summary.append("<tr><td>").append(
summary.append("<tr><td>").append( //NON-NLS
NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.path"))
.append("</td><td>").append(imgPath).append("</td></tr>\n");
.append("</td><td>").append(imgPath).append("</td></tr>\n"); //NON-NLS
}
summary.append("</table>\n");
summary.append("</table>\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("</div>\n");
summary.append("</div>\n"); //NON-NLS
if (generatorLogoSet) {
summary.append("<div class=\"left\">\n");
summary.append("<img src=\"generator_logo.png\" />\n");
summary.append("</div>\n");
summary.append("<div class=\"left\">\n"); //NON-NLS
summary.append("<img src=\"generator_logo.png\" />\n"); //NON-NLS
summary.append("</div>\n"); //NON-NLS
}
summary.append("<div class=\"clear\"></div>\n");
summary.append("<div class=\"clear\"></div>\n"); //NON-NLS
if (reportFooter != null) {
summary.append("<p class=\"subheadding\">").append(reportFooter).append("</p>\n");
summary.append("<p class=\"subheadding\">").append(reportFooter).append("</p>\n"); //NON-NLS
}
summary.append("</div>\n");
summary.append("</body></html>");
summary.append("</div>\n"); //NON-NLS
summary.append("</body></html>"); //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();

View File

@ -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 = "<![CDATA[ \n" + " <img src='file:///" + lineParts[2].trim() + "' width='400' /><br/&gt; \n";
Element pmDescription = new Element("description", ns); //NON-NLS
String xml = "<![CDATA[ \n" + " <img src='file:///" + lineParts[2].trim() + "' width='400' /><br/&gt; \n"; //NON-NLS
StringEscapeUtils.unescapeXml(xml);
pmDescription.setText(xml);
placemark.addContent(pmDescription);
// styleUrl
Element pmStyleUrl = new Element("styleUrl", ns);
pmStyleUrl.setText("#redIcon");
Element pmStyleUrl = new Element("styleUrl", ns); //NON-NLS
pmStyleUrl.setText("#redIcon"); //NON-NLS
placemark.addContent(pmStyleUrl);
// Point
Element pmPoint = new Element("Point", ns);
Element pmPoint = new Element("Point", ns); //NON-NLS
placemark.addContent(pmPoint);
// coordinates
Element pmCoordinates = new Element("coordinates", ns);
Element pmCoordinates = new Element("coordinates", ns); //NON-NLS
pmCoordinates.setText(coordinates);
pmPoint.addContent(pmCoordinates);
@ -257,16 +257,16 @@ class ReportKML implements GeneralReportModule {
outputter.output(kmlDocument, writer);
writer.close();
} catch (IOException ex) {
logger.log(Level.WARNING, "Could not write the KML file.", ex);
logger.log(Level.WARNING, "Could not write the KML file.", ex); //NON-NLS
}
} catch (IOException ex) {
logger.log(Level.WARNING, "Could not write the KML report.", ex);
logger.log(Level.WARNING, "Could not write the KML report.", 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
}
progressPanel.increment();
progressPanel.complete();
@ -301,7 +301,7 @@ class ReportKML implements GeneralReportModule {
@Override
public String getExtension() {
String ext = ".txt";
String ext = ".txt"; //NON-NLS
return ext;
}

View File

@ -58,7 +58,7 @@ public class ReportProgressPanel extends javax.swing.JPanel {
STATUS = ReportStatus.QUEUING;
if (reportPath != null) {
pathLabel.setText("<html><u>" + shortenPath(reportPath) + "</u></html>");
pathLabel.setText("<html><u>" + shortenPath(reportPath) + "</u></html>"); //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

View File

@ -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
}
}

View File

@ -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<TableReportModule, Boolean>)wiz.getProperty("tableModuleStates"),
(Map<GeneralReportModule, Boolean>)wiz.getProperty("generalModuleStates"),
(Map<FileReportModule, Boolean>)wiz.getProperty("fileModuleStates"));
generator.generateTableReports((Map<ARTIFACT_TYPE, Boolean>)wiz.getProperty("artifactStates"), (Map<String, Boolean>)wiz.getProperty("tagStates"));
generator.generateFileListReports((Map<FileReportDataTypes, Boolean>)wiz.getProperty("fileReportOptions"));
ReportGenerator generator = new ReportGenerator((Map<TableReportModule, Boolean>)wiz.getProperty("tableModuleStates"), //NON-NLS
(Map<GeneralReportModule, Boolean>)wiz.getProperty("generalModuleStates"), //NON-NLS
(Map<FileReportModule, Boolean>)wiz.getProperty("fileModuleStates")); //NON-NLS
generator.generateTableReports((Map<ARTIFACT_TYPE, Boolean>)wiz.getProperty("artifactStates"), (Map<String, Boolean>)wiz.getProperty("tagStates")); //NON-NLS
generator.generateFileListReports((Map<FileReportDataTypes, Boolean>)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;

View File

@ -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

View File

@ -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);
}

View File

@ -109,15 +109,15 @@ import org.openide.util.NbPreferences;
public void storeSettings(WizardDescriptor wiz) {
Map<TableReportModule, Boolean> tables = getComponent().getTableModuleStates();
Map<GeneralReportModule, Boolean> 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
}
/**

View File

@ -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
}
}