From 900269d62c4b4114ab1ec6c61ccfc8ab38ba04ca Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Wed, 27 Jan 2016 17:01:16 -0500 Subject: [PATCH 01/48] Fixed mis-spelling of NON-NLS tags. --- .../org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java index 2e170c023b..2d394b62f8 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java @@ -383,9 +383,9 @@ class ExtractRegistry extends Extract { String value = artnode.getTextContent().trim(); String name = artnode.getAttribute("name"); //NON-NLS - if (name.equals("ProductName")) { // NON_NLS + if (name.equals("ProductName")) { // NON-NLS version = value; - } else if (name.equals("CSDVersion")) { // NON_NLS + } else if (name.equals("CSDVersion")) { // NON-NLS // This is dependant on the fact that ProductName shows up first in the module output version = version + " " + value; } else if (name.equals("SystemRoot")) { //NON-NLS From c34ae8ce9b8e3f48aaf81c6b5a8013632d4ab455 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Wed, 27 Jan 2016 17:39:02 -0500 Subject: [PATCH 02/48] Tagged several strings with NON-NLS. Extracted a hard coded string. --- .../org/sleuthkit/autopsy/keywordsearch/Bundle.properties | 1 + .../autopsy/keywordsearch/DropdownListSearchPanel.java | 2 +- .../keywordsearch/DropdownSingleTermSearchPanel.java | 4 ++-- .../autopsy/keywordsearch/GlobalEditListPanel.java | 8 ++++---- .../sleuthkit/autopsy/keywordsearch/KeywordSearch.java | 6 +++--- .../src/org/sleuthkit/autopsy/keywordsearch/RawText.java | 2 +- .../src/org/sleuthkit/autopsy/keywordsearch/Server.java | 4 ++-- .../autopsy/keywordsearch/SolrSearchService.java | 4 ++-- 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties index 44e1664d25..39ce8b000a 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties @@ -294,3 +294,4 @@ SolrConnectionCheck.HostnameOrPort=Invalid hostname and/or port number. SolrConnectionCheck.Hostname=Invalid hostname. SolrConnectionCheck.Port=Invalid port number. SolrConnectionCheck.MissingHostname=Missing hostname. +RawText.getText.error.msg=Error getting text diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownListSearchPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownListSearchPanel.java index 1d91a78dd3..e3d7d6cc85 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownListSearchPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownListSearchPanel.java @@ -119,7 +119,7 @@ class DropdownListSearchPanel extends KeywordSearchPanel { @Override public void propertyChange(PropertyChangeEvent evt) { Object source = evt.getSource(); - if (source instanceof String && ((String) source).equals("LOCAL")) { + if (source instanceof String && ((String) source).equals("LOCAL")) { //NON-NLS EventQueue.invokeLater(new Runnable() { @Override public void run() { diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleTermSearchPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleTermSearchPanel.java index e1f2f1540b..4f5ffe545b 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleTermSearchPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/DropdownSingleTermSearchPanel.java @@ -154,7 +154,7 @@ public class DropdownSingleTermSearchPanel extends KeywordSearchPanel { org.openide.awt.Mnemonics.setLocalizedText(selectAllMenuItem, org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.selectAllMenuItem.text")); // NOI18N rightClickMenu.add(selectAllMenuItem); - keywordTextField.setFont(new java.awt.Font("Monospaced", 0, 14)); // NOI18N + keywordTextField.setFont(new java.awt.Font("Monospaced", 0, 14)); // NOI18N NON-NLS keywordTextField.setText(org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.keywordTextField.text")); // NOI18N keywordTextField.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(192, 192, 192), 1, true)); keywordTextField.setMinimumSize(new java.awt.Dimension(2, 25)); @@ -170,7 +170,7 @@ public class DropdownSingleTermSearchPanel extends KeywordSearchPanel { } }); - searchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/search-icon.png"))); // NOI18N + searchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/search-icon.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(searchButton, org.openide.util.NbBundle.getMessage(DropdownSingleTermSearchPanel.class, "DropdownSearchPanel.searchButton.text")); // NOI18N searchButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GlobalEditListPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GlobalEditListPanel.java index 87dc6b6f52..f4f2596956 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GlobalEditListPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GlobalEditListPanel.java @@ -129,7 +129,7 @@ class GlobalEditListPanel extends javax.swing.JPanel implements ListSelectionLis @Override public void propertyChange(PropertyChangeEvent evt) { Object source = evt.getSource(); - if (source instanceof String && ((String) source).equals("LOCAL")) { + if (source instanceof String && ((String) source).equals("LOCAL")) { //NON-NLS EventQueue.invokeLater(new Runnable() { @Override public void run() { @@ -294,13 +294,13 @@ class GlobalEditListPanel extends javax.swing.JPanel implements ListSelectionLis listOptionsLabel.setText(org.openide.util.NbBundle.getMessage(GlobalEditListPanel.class, "KeywordSearchEditListPanel.listOptionsLabel.text")); // NOI18N - deleteListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/delete16.png"))); // NOI18N + deleteListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/delete16.png"))); // NOI18N NON-NLS deleteListButton.setText(org.openide.util.NbBundle.getMessage(GlobalEditListPanel.class, "KeywordSearchEditListPanel.deleteListButton.text")); // NOI18N - saveListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/save16.png"))); // NOI18N + saveListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/save16.png"))); // NOI18N NON-NLS saveListButton.setText(org.openide.util.NbBundle.getMessage(GlobalEditListPanel.class, "KeywordSearchEditListPanel.saveListButton.text")); // NOI18N - exportButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/export16.png"))); // NOI18N + exportButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/export16.png"))); // NOI18N NON-NLS exportButton.setText(org.openide.util.NbBundle.getMessage(GlobalEditListPanel.class, "KeywordSearchEditListPanel.exportButton.text")); // NOI18N exportButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java index 9c276115ce..0433f99e7e 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java @@ -75,7 +75,7 @@ public class KeywordSearch { //do not forward to the parent autopsy logger TIKA_LOGGER.setUseParentHandlers(false); } catch (IOException | SecurityException ex) { - logger.log(Level.SEVERE, "Error setting up tika logging", ex); + logger.log(Level.SEVERE, "Error setting up tika logging", ex); //NON-NLS } } @@ -125,7 +125,7 @@ public class KeywordSearch { server.closeCore(); } catch (Exception ex) { String caseName = closedCase.getName(); - logger.log(Level.SEVERE, String.format("Failed to close core for %s", caseName), ex); + logger.log(Level.SEVERE, String.format("Failed to close core for %s", caseName), ex); //NON-NLS MessageNotifyUtil.Notify.error(NbBundle.getMessage(KeywordSearch.class, "KeywordSearch.closeCore.notification.msg"), ex.getMessage()); } } @@ -135,7 +135,7 @@ public class KeywordSearch { server.openCoreForCase(openedCase); } catch (Exception ex) { String caseName = openedCase.getName(); - logger.log(Level.SEVERE, String.format("Failed to open or create core for %s", caseName), ex); + logger.log(Level.SEVERE, String.format("Failed to open or create core for %s", caseName), ex); //NON-NLS MessageNotifyUtil.Notify.error(NbBundle.getMessage(KeywordSearch.class, "KeywordSearch.openCore.notification.msg"), ex.getMessage()); } } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java index 540c3c0e21..ed4347fe4f 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java @@ -156,7 +156,7 @@ class RawText implements IndexedText { } catch (SolrServerException | NoOpenCoreException ex) { logger.log(Level.WARNING, "Couldn't get extracted content.", ex); //NON-NLS } - return "Error getting text"; + return NbBundle.getMessage(this.getClass(), "RawText.getText.error.msg"); } @Override diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java index 290c6f9c09..74c75b0aab 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java @@ -405,10 +405,10 @@ public class Server { solrProcessBuilder.directory(solrFolder); // Redirect stdout and stderr to files to prevent blocking. - Path solrStdoutPath = Paths.get(Places.getUserDirectory().getAbsolutePath(), "var", "log", "solr.log.stdout"); + Path solrStdoutPath = Paths.get(Places.getUserDirectory().getAbsolutePath(), "var", "log", "solr.log.stdout"); //NON-NLS solrProcessBuilder.redirectOutput(solrStdoutPath.toFile()); - Path solrStderrPath = Paths.get(Places.getUserDirectory().getAbsolutePath(), "var", "log", "solr.log.stderr"); + Path solrStderrPath = Paths.get(Places.getUserDirectory().getAbsolutePath(), "var", "log", "solr.log.stderr"); //NON-NLS solrProcessBuilder.redirectError(solrStderrPath.toFile()); logger.log(Level.INFO, "Starting Solr using: {0}", solrProcessBuilder.command()); //NON-NLS diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java index 7c28a15aff..e86ef70c52 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java @@ -46,8 +46,8 @@ import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchServiceException; @ServiceProvider(service = KeywordSearchService.class) public class SolrSearchService implements KeywordSearchService { - private static final String BAD_IP_ADDRESS_FORMAT = "ioexception occurred when talking to server"; - private static final String SERVER_REFUSED_CONNECTION = "server refused connection"; + private static final String BAD_IP_ADDRESS_FORMAT = "ioexception occurred when talking to server"; //NON-NLS + private static final String SERVER_REFUSED_CONNECTION = "server refused connection"; //NON-NLS private static final int IS_REACHABLE_TIMEOUT_MS = 1000; @Override From f7ec38cb5f0716124abe77cbd422242a75b23ef1 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Wed, 27 Jan 2016 21:10:44 -0500 Subject: [PATCH 03/48] Tagged several strings with NON-NLS. Extracted hard coded strings. --- .../autopsy/imagegallery/Bundle.properties | 17 ++ .../autopsy/imagegallery/Bundle_ja.properties | 0 .../autopsy/imagegallery/FXMLConstructor.java | 6 +- .../imagegallery/FileIDSelectionModel.java | 4 +- .../autopsy/imagegallery/FileTypeUtils.java | 48 ++-- .../imagegallery/ImageGalleryController.java | 93 +++---- .../imagegallery/ImageGalleryModule.java | 4 +- .../ImageGalleryOptionsPanel.java | 7 +- .../imagegallery/ImageGalleryPreferences.java | 2 +- .../ImageGalleryTopComponent.java | 41 ++- .../imagegallery/PerCaseProperties.java | 6 +- .../autopsy/imagegallery/ThumbnailCache.java | 12 +- .../actions/AddDrawableTagAction.java | 20 +- .../imagegallery/actions/AddTagAction.java | 10 +- .../autopsy/imagegallery/actions/Back.java | 5 +- .../imagegallery/actions/Bundle.properties | 22 ++ .../imagegallery/actions/Bundle_ja.properties | 0 .../actions/CategorizeAction.java | 12 +- .../actions/DeleteFollowUpTagAction.java | 5 +- .../autopsy/imagegallery/actions/Forward.java | 5 +- .../imagegallery/actions/NextUnseenGroup.java | 9 +- .../imagegallery/actions/OpenAction.java | 12 +- .../actions/OpenExternalViewerAction.java | 6 +- .../imagegallery/actions/OpenHelpAction.java | 6 +- .../imagegallery/actions/RedoAction.java | 5 +- .../imagegallery/actions/UndoAction.java | 5 +- .../imagegallery/datamodel/Bundle.properties | 22 ++ .../datamodel/Bundle_ja.properties | 0 .../imagegallery/datamodel/Category.java | 15 +- .../datamodel/CategoryManager.java | 14 +- .../datamodel/DrawableAttribute.java | 31 ++- .../imagegallery/datamodel/DrawableDB.java | 258 +++++++++--------- .../imagegallery/datamodel/DrawableFile.java | 14 +- .../datamodel/DrawableTagsManager.java | 11 +- .../datamodel/HashSetManager.java | 2 +- .../imagegallery/datamodel/ImageFile.java | 2 +- .../imagegallery/datamodel/VideoFile.java | 7 +- .../datamodel/grouping/Bundle.properties | 7 + .../datamodel/grouping/Bundle_ja.properties | 0 .../datamodel/grouping/DrawableGroup.java | 6 +- .../datamodel/grouping/GroupKey.java | 2 +- .../datamodel/grouping/GroupManager.java | 25 +- .../datamodel/grouping/GroupSortBy.java | 11 +- .../imagegallery/gui/Bundle.properties | 3 + .../imagegallery/gui/Bundle_ja.properties | 0 .../imagegallery/gui/NoGroupsDialog.java | 2 +- .../autopsy/imagegallery/gui/StatusBar.java | 9 +- .../imagegallery/gui/SummaryTablePane.java | 2 +- .../autopsy/imagegallery/gui/Toolbar.java | 4 +- .../autopsy/imagegallery/gui/VideoPlayer.java | 24 +- .../gui/drawableviews/Bundle.properties | 5 + .../gui/drawableviews/Bundle_ja.properties | 0 .../gui/drawableviews/DrawableTile.java | 4 +- .../gui/drawableviews/DrawableTileBase.java | 18 +- .../gui/drawableviews/DrawableUIBase.java | 4 +- .../gui/drawableviews/DrawableView.java | 2 +- .../gui/drawableviews/GroupPane.java | 14 +- .../gui/drawableviews/MetaDataPane.java | 5 +- .../gui/drawableviews/SlideShowView.java | 8 +- .../gui/navpanel/Bundle.properties | 7 + .../gui/navpanel/Bundle_ja.properties | 0 .../gui/navpanel/GroupComparators.java | 12 +- .../gui/navpanel/GroupListCell.java | 8 +- .../imagegallery/gui/navpanel/GroupTree.java | 7 +- .../gui/navpanel/GroupTreeCell.java | 8 +- .../gui/navpanel/HashHitGroupList.java | 7 +- 66 files changed, 533 insertions(+), 409 deletions(-) create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle_ja.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle_ja.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle_ja.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle_ja.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle_ja.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle_ja.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle.properties create mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle_ja.properties diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties index b7d2ba3d30..5d2931a865 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties @@ -4,6 +4,9 @@ OpenIDE-Module-Long-Description=\ It is not available on the sleuthkit.org site and has been distributed to limited users. OpenIDE-Module-Name=ImageGallery OpenIDE-Module-Short-Description=Advanced image and video gallery +CTL_ImageGalleryAction=Image/Video Gallery +CTL_ImageGalleryTopComponent=Image/Video Gallery +HINT_ImageGalleryTopComponent=This is a Image/Video Gallery window ImageGalleryOptionsPanel.enabledForCaseBox.text=Enable Image Gallery updates for the current case. ImageGalleryOptionsPanel.enabledByDefaultBox.text=Enable Image Gallery for new cases by default. ImageGalleryOptionsPanel.enabledForCaseBox.toolTipText=If Image Gallery is disabled, only the fact that an update is needed is recorded. If Image Gallery is enabled after ingest, it will do one bulk update based on the results form ingest. If Image Gallery is disabled, you will be prompted to enable it when attempting to open its window. @@ -11,3 +14,17 @@ ImageGalleryOptionsPanel.descriptionLabel.text=To minimize its startup tim ImageGalleryOptionsPanel.furtherDescriptionArea.text=If Image Gallery is disabled, only the fact that an update is needed is recorded. If Image Gallery is enabled after ingest, it will do one bulk update based on the results form ingest. If Image Gallery is disabled, you will be prompted to enable it when attempting to open its window. ImageGalleryOptionsPanel.unavailableDuringInjestLabel.text=This setting is unavailable during ingest. ImageGalleryOptionsPanel.infoIconLabel.text= +ImageGalleryController.checkForGroups.noGroups1.txt=No groups are fully analyzed; but listening to ingest is disabled. No groups will be available until ingest is finished and listening is re-enabled. +ImageGalleryController.checkForGroups.noGroups2.txt=No groups are fully analyzed yet, but ingest is still ongoing. Please Wait. +ImageGalleryController.checkForGroups.noGroups3.txt=No groups are fully analyzed yet, but image / video data is still being populated. Please Wait. +ImageGalleryController.checkForGroups.noGroups4.txt=There are no images/videos available from the added datasources; but listening to ingest is disabled. No groups will be available until ingest is finished and listening is re-enabled. +ImageGalleryController.checkForGroups.noGroups5.txt=There are no images/videos in the added datasources. +ImageGalleryController.checkForGroups.noGroups6.txt=There are no fully analyzed groups to display\: the current Group By setting resulted in no groups, or no groups are fully analyzed but ingest is not running. +ImageGalleryController.innerTask.property.progress=progress +ImageGalleryController.innerTask.property.message=status +ImageGalleryController.copyAnalyzedFile.progress.txt=populating analyzed image/video database +ImageGalleryController.copyAnalyzedFile.progress2=commiting image/video database +ImageGalleryController.copyAnalyzedFile.progress.stop=Stopping copy to drawable db task. +ImageGalleryController.prePopulateDataSourceFiles.progress=prepopulating image/video database +ImageGalleryController.prePopulateDataSourceFiles.progress2=commiting image/video database +ImageGalleryModule.moduleName.txt=Image Gallery diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle_ja.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java index 55d45ac5f5..ec846c1f36 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java @@ -39,7 +39,7 @@ public class FXMLConstructor { private static Logger logger = Logger.getLogger(FXMLConstructor.class.getName()); static public void construct(Object n, String fxmlFileName) { - final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; + final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; //NON-NLS try { FXMLLoader fxmlLoader = new FXMLLoader(new URL(name)); @@ -53,12 +53,12 @@ public class FXMLConstructor { fxmlLoader.setClassLoader(FXMLLoader.getDefaultClassLoader()); fxmlLoader.load(); } catch (IOException ex) { - String msg = String.format("Failed to load fxml file %s", fxmlFileName); + String msg = String.format("Failed to load fxml file %s", fxmlFileName); //NON-NLS logger.log(Level.SEVERE, msg, ex); } } } catch (MalformedURLException ex) { - String msg = String.format("Malformed URL %s", name); + String msg = String.format("Malformed URL %s", name); //NON-NLS logger.log(Level.SEVERE, msg, ex); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java index e2109389fd..812ace17e9 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java @@ -72,7 +72,7 @@ public class FileIDSelectionModel { try { fileNodes.add(new FileNode(controller.getSleuthKitCase().getAbstractFileById(id))); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); + LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); //NON-NLS } } FileNode[] fileNodeArray = fileNodes.stream().toArray(FileNode[]::new); @@ -84,7 +84,7 @@ public class FileIDSelectionModel { try { etc.getExplorerManager().setSelectedNodes(fileNodeArray); } catch (PropertyVetoException ex) { - LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); + LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); //NON-NLS } }); }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java index bddfe6f1e7..bcc46ac842 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java @@ -92,41 +92,41 @@ public enum FileTypeUtils { .collect(Collectors.toList())); //add list of known image extensions imageExtensions.addAll(Arrays.asList( - "bmp" //Bitmap + "bmp" //Bitmap NON-NLS , "gif" //gif - , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants - , "pbm", "pgm", "ppm" // Portable image format variants - , "png" //portable network graphic - , "tga" //targa - , "psd" //photoshop - , "tif", "tiff" //tiff variants - , "yuv", "ico" //icons - , "ai" //illustrator - , "svg" //scalable vector graphics - , "sn", "ras" //sun raster - , "ico" //windows icons - , "tga" //targa + , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants NON-NLS + , "pbm", "pgm", "ppm" // Portable image format variants NON-NLS + , "png" //portable network graphic NON-NLS + , "tga" //targa NON-NLS + , "psd" //photoshop NON-NLS + , "tif", "tiff" //tiff variants NON-NLS + , "yuv", "ico" //icons NON-NLS + , "ai" //illustrator NON-NLS + , "svg" //scalable vector graphics NON-NLS + , "sn", "ras" //sun raster NON-NLS + , "ico" //windows icons NON-NLS + , "tga" //targa NON-NLS )); //add list of known video extensions - videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", - "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", - "rm", "wmv", "mpv", "flv", "swf")); + videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", // NON-NLS + "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", // NON-NLS + "rm", "wmv", "mpv", "flv", "swf")); // NON-NLS supportedExtensions = Sets.union(imageExtensions, videoExtensions); //add list of mimetypes to count as videos even though they aren't prefixed by video/ - videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); + videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); // NON-NLS supportedMimeTypes.addAll(videoMimeTypes); - supportedMimeTypes.addAll(Arrays.asList("application/x-123")); + supportedMimeTypes.addAll(Arrays.asList("application/x-123")); // NON-NLS //add list of mimetypes ImageIO claims to support supportedMimeTypes.addAll(Stream.of(ImageIO.getReaderMIMETypes()) .map(String::toLowerCase) .collect(Collectors.toList())); - supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rearely usefull + supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rearely usefull NON-NLS } /** @@ -150,7 +150,7 @@ public enum FileTypeUtils { try { FILE_TYPE_DETECTOR = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); + LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); //NON-NLS } } return FILE_TYPE_DETECTOR; @@ -198,8 +198,8 @@ public enum FileTypeUtils { return Optional.empty(); } else { mimeType = mimeType.toLowerCase(); - return Optional.of(mimeType.startsWith("image/") - || mimeType.startsWith("video/") + return Optional.of(mimeType.startsWith("image/") //NON-NLS + || mimeType.startsWith("video/") //NON-NLS || supportedMimeTypes.contains(mimeType)); } } @@ -223,11 +223,11 @@ public enum FileTypeUtils { String mimeType = fileTypeDetector.getFileType(file); if (nonNull(mimeType)) { mimeType = mimeType.toLowerCase(); - return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); + return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); //NON-NLS } } } catch (TskCoreException ex) { - LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); + LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); //NON-NLS } return FileTypeUtils.videoExtensions.contains(file.getNameExtension()); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index f532b0e83c..1804461f91 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -58,6 +58,7 @@ import org.apache.commons.lang3.StringUtils; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Cancellable; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -295,33 +296,29 @@ public final class ImageGalleryController implements Executor { if (IngestManager.getInstance().isIngestRunning()) { if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog("No groups are fully analyzed; but listening to ingest is disabled. " - + " No groups will be available until ingest is finished and listening is re-enabled.")); + new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups1.txt"))); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog("No groups are fully analyzed yet, but ingest is still ongoing. Please Wait.", + new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups2.txt"), new ProgressIndicator())); } } else if (getFileUpdateQueueSizeProperty().get() > 0) { replaceNotification(fullUIStackPane, - new NoGroupsDialog("No groups are fully analyzed yet, but image / video data is still being populated. Please Wait.", + new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups3.txt"), new ProgressIndicator())); } else if (db != null && db.countAllFiles() <= 0) { // there are no files in db if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog("There are no images/videos available from the added datasources; but listening to ingest is disabled. " - + " No groups will be available until ingest is finished and listening is re-enabled.")); + new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups4.txt"))); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog("There are no images/videos in the added datasources.")); + new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups5.txt"))); } } else if (!groupManager.isRegrouping()) { replaceNotification(centralStackPane, - new NoGroupsDialog("There are no fully analyzed groups to display:" - + " the current Group By setting resulted in no groups, " - + "or no groups are fully analyzed but ingest is not running.")); + new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups6.txt"))); } } else { @@ -400,7 +397,7 @@ public final class ImageGalleryController implements Executor { * reset the state of the controller (eg if the case is closed) */ public synchronized void reset() { - LOGGER.info("resetting ImageGalleryControler to initial state."); + LOGGER.info("resetting ImageGalleryControler to initial state."); //NON-NLS selectionModel.clearSelection(); setListeningEnabled(false); ThumbnailCache.getDefault().clearCache(); @@ -437,7 +434,7 @@ public final class ImageGalleryController implements Executor { @Nullable synchronized public DrawableFile getFileFromId(Long fileID) throws TskCoreException { if (Objects.isNull(db)) { - LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); + LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); //NON-NLS return null; } return db.getFileFromID(fileID); @@ -463,7 +460,7 @@ public final class ImageGalleryController implements Executor { */ void onStart() { Platform.setImplicitExit(false); - LOGGER.info("setting up ImageGallery listeners"); + LOGGER.info("setting up ImageGallery listeners"); //NON-NLS //TODO can we do anything usefull in an InjestJobEventListener? //IngestManager.getInstance().addIngestJobEventListener((PropertyChangeEvent evt) -> {}); IngestManager.getInstance().addIngestModuleEventListener(new IngestModuleEventListener()); @@ -547,7 +544,7 @@ public final class ImageGalleryController implements Executor { }); } catch (InterruptedException ex) { - LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); + LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); //NON-NLS } } } @@ -578,8 +575,8 @@ public final class ImageGalleryController implements Executor { this.message.set(Status); } SimpleObjectProperty state = new SimpleObjectProperty<>(Worker.State.READY); - SimpleDoubleProperty progress = new SimpleDoubleProperty(this, "pregress"); - SimpleStringProperty message = new SimpleStringProperty(this, "status"); + SimpleDoubleProperty progress = new SimpleDoubleProperty(this, NbBundle.getMessage(this.getClass(), "ImageGalleryController.innerTask.property.progress")); + SimpleStringProperty message = new SimpleStringProperty(this, NbBundle.getMessage(this.getClass(), "ImageGalleryController.innerTask.property.message")); public SimpleDoubleProperty progressProperty() { return progress; @@ -660,7 +657,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); + Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); //NON-NLS } } } @@ -686,7 +683,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); + Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); //NON-NLS } } @@ -713,33 +710,33 @@ public final class ImageGalleryController implements Executor { this.tskCase = tskCase; } - static private final String FILE_EXTESNION_CLAUSE = "(name LIKE '%." + static private final String FILE_EXTESNION_CLAUSE = "(name LIKE '%." //NON-NLS + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), - "' or name LIKE '%.") + "' or name LIKE '%.") //NON-NLS + "')"; static private final String MIMETYPE_CLAUSE = - "blackboard_attributes.value_text LIKE '" + "blackboard_attributes.value_text LIKE '" //NON-NLS + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), - "' OR blackboard_attributes.value_text LIKE '") + "' "; + "' OR blackboard_attributes.value_text LIKE '") + "' "; //NON-NLS - static private final String DRAWABLE_QUERY = FILE_EXTESNION_CLAUSE + " OR tsk_files.obj_id IN (" - + "SELECT tsk_files.obj_id from tsk_files , blackboard_artifacts, blackboard_attributes" - + " WHERE blackboard_artifacts.obj_id = tsk_files.obj_id" - + " AND blackboard_attributes.artifact_id = blackboard_artifacts.artifact_id" - + " AND blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO.getTypeID() - + " AND blackboard_attributes.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_FILE_TYPE_SIG.getTypeID() - + " AND (blackboard_attributes.value_text LIKE 'video/%'" - + " OR blackboard_attributes.value_text LIKE 'image/%'" - + " OR " + MIMETYPE_CLAUSE + static private final String DRAWABLE_QUERY = FILE_EXTESNION_CLAUSE + " OR tsk_files.obj_id IN (" //NON-NLS + + "SELECT tsk_files.obj_id from tsk_files , blackboard_artifacts, blackboard_attributes" //NON-NLS + + " WHERE blackboard_artifacts.obj_id = tsk_files.obj_id" //NON-NLS + + " AND blackboard_attributes.artifact_id = blackboard_artifacts.artifact_id" //NON-NLS + + " AND blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO.getTypeID() //NON-NLS + + " AND blackboard_attributes.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_FILE_TYPE_SIG.getTypeID() //NON-NLS + + " AND (blackboard_attributes.value_text LIKE 'video/%'" //NON-NLS + + " OR blackboard_attributes.value_text LIKE 'image/%'" //NON-NLS + + " OR " + MIMETYPE_CLAUSE //NON-NLS + " )" + ")"; - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("populating analyzed image/video database"); + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress.txt")); @Override public void run() { progressHandle.start(); - updateMessage("populating analyzed image/video database"); + updateMessage(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress.txt")); try { //grab all files with supported extension or detected mime types @@ -753,7 +750,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); + LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); //NON-NLS progressHandle.finish(); break; } @@ -790,16 +787,16 @@ public final class ImageGalleryController implements Executor { progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); - updateMessage("commiting image/video database"); + progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress2")); + updateMessage(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress2")); updateProgress(1.0); progressHandle.start(); taskDB.commitTransaction(tr, true); } catch (TskCoreException ex) { - progressHandle.progress("Stopping copy to drawable db task."); - Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); + progressHandle.progress(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress.stop")); + Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); //NON-NLS progressHandle.finish(); updateMessage(""); updateProgress(-1.0); @@ -831,9 +828,9 @@ public final class ImageGalleryController implements Executor { * check for supported images */ // (name like '.jpg' or name like '.png' ...) - private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; + private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; //NON-NLS - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("prepopulating image/video database", this); + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "ImageGalleryController.prePopulateDataSourceFiles.progress"), this); /** * @@ -853,10 +850,10 @@ public final class ImageGalleryController implements Executor { @Override public void run() { progressHandle.start(); - updateMessage("prepopulating image/video database"); + updateMessage(NbBundle.getMessage(this.getClass(), "ImageGalleryController.prePopulateDataSourceFiles.progress")); try { - String fsQuery = "(fs_obj_id IS NULL) "; //default clause + String fsQuery = "(fs_obj_id IS NULL) "; //default clause NON-NLS /* * NOTE: Logical files currently (Apr '15) have a null value for * fs_obj_id in DB. for them, we will not specify a fs_obj_id, @@ -877,10 +874,10 @@ public final class ImageGalleryController implements Executor { //use this clause to only grab files from the newly added filesystems. fsQuery = fileSystems.stream() .map(fileSystem -> String.valueOf(fileSystem.getId())) - .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); + .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); //NON-NLS } - final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); + final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); //NON-NLS progressHandle.switchToDeterminate(files.size()); //do in transaction @@ -888,7 +885,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); + LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); //NON-NLS progressHandle.finish(); break; } @@ -898,13 +895,13 @@ public final class ImageGalleryController implements Executor { } progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); + progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "ImageGalleryController.prePopulateDataSourceFiles.progress2")); progressHandle.start(); db.commitTransaction(tr, false); } catch (TskCoreException ex) { - Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); + Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); //NON-NLS } progressHandle.finish(); @@ -959,7 +956,7 @@ public final class ImageGalleryController implements Executor { } } catch (TskCoreException ex) { //TODO: What to do here? - LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); + LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); //NON-NLS throw new RuntimeException(ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java index 0a37825f54..372ac616bb 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java @@ -22,6 +22,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.apache.commons.lang3.StringUtils; import static org.apache.commons.lang3.StringUtils.isNotBlank; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableDB; @@ -34,7 +36,7 @@ public class ImageGalleryModule { private static final Logger LOGGER = Logger.getLogger(ImageGalleryModule.class.getName()); - private static final String MODULE_NAME = "Image Gallery"; + private static final String MODULE_NAME = NbBundle.getMessage(ImageGalleryModule.class, "ImageGalleryModule.moduleName.txt"); static String getModuleName() { return MODULE_NAME; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java index be83d9e236..bb44a60ec1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.imagegallery; +import java.awt.*; import java.awt.event.ActionEvent; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; @@ -83,17 +84,17 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel { furtherDescriptionArea.setBackground(new java.awt.Color(240, 240, 240)); furtherDescriptionArea.setColumns(20); - furtherDescriptionArea.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N + furtherDescriptionArea.setFont(furtherDescriptionArea.getFont().deriveFont(Font.PLAIN, 11)); // NOI18N furtherDescriptionArea.setLineWrap(true); furtherDescriptionArea.setRows(5); furtherDescriptionArea.setText(NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.furtherDescriptionArea.text")); // NOI18N furtherDescriptionArea.setWrapStyleWord(true); furtherDescriptionArea.setPreferredSize(new java.awt.Dimension(378, 74)); - infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N + infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(infoIconLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.infoIconLabel.text")); // NOI18N - unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N + unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(unavailableDuringInjestLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.unavailableDuringInjestLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java index 5a89b5f257..51c0b5cb85 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java @@ -29,7 +29,7 @@ class ImageGalleryPreferences { private static final Preferences preferences = NbPreferences.forModule(ImageGalleryPreferences.class); /** key for the listening enabled for new cases setting */ - private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; + private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; //NON-NLS /** * Return setting of whether Image Analyzer should be automatically enabled diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java index d1e8f3a236..bdd5a21f11 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java @@ -32,6 +32,7 @@ import org.netbeans.api.settings.ConvertAsProperties; import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerUtils; import org.openide.util.Lookup; +import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.openide.windows.Mode; import org.openide.windows.TopComponent; @@ -49,7 +50,7 @@ import org.sleuthkit.autopsy.imagegallery.gui.navpanel.HashHitGroupList; * Top component which displays ImageGallery interface. * * Although ImageGallery doesn't currently use the explorer manager, this - * Topcomponenet provides one through the getExplorerManager method. However, + * Topcomponent provides one through the getExplorerManager method. However, * this does not seem to function correctly unless a Netbeans provided explorer * view is present in the TopComponenet, even if it is invisible/ zero sized */ @@ -61,14 +62,18 @@ import org.sleuthkit.autopsy.imagegallery.gui.navpanel.HashHitGroupList; //iconBase = "org/sleuthkit/autopsy/imagegallery/images/lightbulb.png" use this to put icon in window title area, persistenceType = TopComponent.PERSISTENCE_NEVER) @TopComponent.Registration(mode = "timeline", openAtStartup = false) -@Messages({ - "CTL_ImageGalleryAction=Image/Video Gallery", - "CTL_ImageGalleryTopComponent=Image/Video Gallery", - "HINT_ImageGalleryTopComponent=This is a Image/Video Gallery window" -}) +//@Messages({ +// "CTL_ImageGalleryAction=Image/Video Gallery", +// "CTL_ImageGalleryTopComponent=Image/Video Gallery", +// "HINT_ImageGalleryTopComponent=This is a Image/Video Gallery window" +//}) public final class ImageGalleryTopComponent extends TopComponent implements ExplorerManager.Provider, Lookup.Provider { - public final static String PREFERRED_ID = "ImageGalleryTopComponent"; + private final static String PREFERRED_ID = "ImageGalleryTopComponent"; //NON-NLS + private static final String DEFAULT_NAME = NbBundle.getMessage(ImageGalleryTopComponent.class, "CTL_ImageGalleryTopComponent"); + private static final String TOOLTIP_TEXT = NbBundle.getMessage(ImageGalleryTopComponent.class, "HINT_ImageGalleryTopComponent"); + + private static final Logger LOGGER = Logger.getLogger(ImageGalleryTopComponent.class.getName()); private static boolean topComponentInitialized = false; @@ -81,11 +86,11 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl // } // } // timeLineController.openTimeLine(); - final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); + final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent(PREFERRED_ID); if (tc != null) { topComponentInitialized = true; WindowManager.getDefault().isTopComponentFloating(tc); - Mode mode = WindowManager.getDefault().findMode("timeline"); + Mode mode = WindowManager.getDefault().findMode("timeline"); //NON-NLS if (mode != null) { mode.dockInto(tc); } @@ -96,12 +101,12 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl public static void closeTopComponent() { if (topComponentInitialized) { - final TopComponent etc = WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); + final TopComponent etc = WindowManager.getDefault().findTopComponent(PREFERRED_ID); if (etc != null) { try { etc.close(); } catch (Exception e) { - LOGGER.log(Level.SEVERE, "failed to close ImageGalleryTopComponent", e); + LOGGER.log(Level.SEVERE, "failed to close ImageGalleryTopComponent", e); //NON-NLS } } } @@ -134,8 +139,8 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl public ImageGalleryTopComponent() { - setName(Bundle.CTL_ImageGalleryTopComponent()); - setToolTipText(Bundle.HINT_ImageGalleryTopComponent()); + setName(DEFAULT_NAME); + setToolTipText(TOOLTIP_TEXT); initComponents(); @@ -227,4 +232,14 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl public Lookup getLookup() { return lookup; } + + /** + * Returns the unique ID of this TopComponent + * + * @return PREFERRED_ID the unique ID of this TopComponent + */ + @Override + protected String preferredID() { + return PREFERRED_ID; + } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java index 75a35fc798..89a40977f3 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java @@ -37,9 +37,9 @@ import org.sleuthkit.autopsy.coreutils.Logger; */ class PerCaseProperties { - public static final String ENABLED = "enabled"; + public static final String ENABLED = "enabled"; //NON-NLS - public static final String STALE = "stale"; + public static final String STALE = "stale"; //NON-NLS private final Case theCase; @@ -88,7 +88,7 @@ class PerCaseProperties { * @return true if the config exists, false otherwise. */ public synchronized boolean configExists(String moduleName) { - Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); + Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); //NON-NLS return Files.exists(get); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java index 67c4a10dfa..a0c962c775 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java @@ -101,7 +101,7 @@ public enum ThumbnailCache { try { return cache.get(file.getId(), () -> load(file)); } catch (UncheckedExecutionException | CacheLoader.InvalidCacheLoadException | ExecutionException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); //NON-NLS return null; } } @@ -111,7 +111,7 @@ public enum ThumbnailCache { try { return get(ImageGalleryController.getDefault().getFileFromId(fileID)); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); //NON-NLS return null; } } @@ -142,9 +142,9 @@ public enum ThumbnailCache { return cachedThumbnail; } } catch (MalformedURLException ex) { - LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); + LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); //NON-NLS } catch (IOException ex) { - LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); + LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); //NON-NLS } } return null; @@ -176,7 +176,7 @@ public enum ThumbnailCache { return Optional.of(ImageUtils.getCachedThumbnailFile(file.getAbstractFile(), MAX_THUMBNAIL_SIZE)); } catch (Exception e) { - LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); + LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); //NON-NLS return Optional.empty(); } } @@ -193,7 +193,7 @@ public enum ThumbnailCache { try { cache.put(Long.MIN_VALUE, newGetThumbnailTask.get()); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); + LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); //NON-NLS } } }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java index 28a377aade..e3340a4aa8 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java @@ -28,6 +28,8 @@ import javafx.application.Platform; import javafx.scene.control.Alert; import javafx.scene.control.Menu; import javax.swing.SwingWorker; + +import org.openide.util.NbBundle; import org.openide.util.Utilities; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -60,7 +62,11 @@ public class AddDrawableTagAction extends AddTagAction { @Override protected String getActionDisplayName() { - return Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1 ? "Tag Files" : "Tag File"; + if (Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1) { + return NbBundle.getMessage(this.getClass(), "AddDrawableTagAction.pluralTagFile"); + } else { + return NbBundle.getMessage(this.getClass(), "AddDrawableTagAction.singularTagFile"); + } } @Override @@ -78,7 +84,7 @@ public class AddDrawableTagAction extends AddTagAction { for (Long fileID : selectedFiles) { try { final DrawableFile file = controller.getFileFromId(fileID); - LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); + LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); //NON-NLS // check if the same tag is being added for the same abstract file. DrawableTagsManager tagsManager = controller.getTagsManager(); @@ -89,16 +95,16 @@ public class AddDrawableTagAction extends AddTagAction { .findAny(); if (duplicateTagName.isPresent()) { - LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); + LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS } else { - LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); + LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS controller.getTagsManager().addContentTag(file, tagName, comment); } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); + LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); //NON-NLS Platform.runLater(() -> { - new Alert(Alert.AlertType.ERROR, "Unable to tag file " + fileID + ".").show(); + new Alert(Alert.AlertType.ERROR, NbBundle.getMessage(this.getClass(), "AddDrawableTagAction.addTagsToFiles.unableToTag.alert.msg", fileID)).show(); }); } } @@ -111,7 +117,7 @@ public class AddDrawableTagAction extends AddTagAction { try { get(); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); + LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); //NON-NLS } } }.execute(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java index 91c2af6503..e6abd16f6a 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java @@ -25,6 +25,8 @@ import javafx.event.ActionEvent; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javax.swing.SwingUtilities; + +import org.openide.util.NbBundle; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.actions.GetTagNameAndCommentDialog; @@ -77,7 +79,7 @@ abstract class AddTagAction { super(getActionDisplayName()); // Create a "Quick Tag" sub-menu. - Menu quickTagMenu = new Menu("Quick Tag"); + Menu quickTagMenu = new Menu(NbBundle.getMessage(this.getClass(), "AddTagAction.tagMenu.quickTag")); getItems().add(quickTagMenu); /* @@ -87,7 +89,7 @@ abstract class AddTagAction { */ Collection tagNames = controller.getTagsManager().getNonCategoryTagNames(); if (tagNames.isEmpty()) { - MenuItem empty = new MenuItem("No tags"); + MenuItem empty = new MenuItem(NbBundle.getMessage(this.getClass(), "AddTagAction.tagMenu.noTags")); empty.setDisable(true); quickTagMenu.getItems().add(empty); } else { @@ -105,7 +107,7 @@ abstract class AddTagAction { * Selecting this item initiates a dialog that can be used to create * or select a tag name and adds a tag with the resulting name. */ - MenuItem newTagMenuItem = new MenuItem("New Tag..."); + MenuItem newTagMenuItem = new MenuItem(NbBundle.getMessage(this.getClass(), "AddTagAction.tagMenu.newTag")); newTagMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TagName tagName = GetTagNameDialog.doDialog(getIGWindow()); @@ -122,7 +124,7 @@ abstract class AddTagAction { * name with an optional comment and adds a tag with the resulting * name. */ - MenuItem tagAndCommentItem = new MenuItem("Tag and Comment..."); + MenuItem tagAndCommentItem = new MenuItem(NbBundle.getMessage(this.getClass(), "AddTagAction.tagMenu.tagAndComment")); tagAndCommentItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { GetTagNameAndCommentDialog.TagNameAndComment tagNameAndComment = GetTagNameAndCommentDialog.doDialog(getIGWindow()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java index 4488d94967..21f5191b39 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java @@ -24,6 +24,7 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -32,12 +33,12 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm public class Back extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); //NON-NLS private final ImageGalleryController controller; public Back(ImageGalleryController controller) { - super("Back"); + super(NbBundle.getMessage(Back.class, "Back.txt")); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.LEFT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties new file mode 100644 index 0000000000..f65149b66e --- /dev/null +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties @@ -0,0 +1,22 @@ +CTL_OpenAction=View Images/Videos +CTL_OpenHelpAction=Image / Video Gallery Help +AddDrawableTagAction.addTagsToFiles.unableToTag.alert.msg=Unable to tag file {0}. +AddDrawableTagAction.pluralTagFile=Tag Files +AddDrawableTagAction.singularTagFile=Tag File +AddTagAction.tagMenu.newTag=New Tag... +AddTagAction.tagMenu.noTags=No tags +AddTagAction.tagMenu.quickTag=Quick Tag +AddTagAction.tagMenu.tagAndComment=Tag and Comment... +Back.txt=Back +CategorizeAction.displayName.txt=Categorize +DeleteFollwUpTagAction.displayName.txt=Delete Follow Up Tag +Forward.forward.txt=Forward +NextUnseenGroup.markGroupSeen.txt=Mark Group Seen +NextUnseenGroup.nextUnseenGroup.txt=Next Unseen group +OpenAction.performAction.answer.txt=The image / video database may be out of date. Do you want to update and listen for further ingest results?\ +Choosing ''yes'' will update the database and enable listening to future ingests. Choosing ''no'' will display the out of date results. Choosing ''cancel'' will close the image /video gallery +OpenAction.moduleName.text=Image Gallery +OpenExternalViewerAction.displayName.text=External Viewer +OpenExternalViewerAction.externalViewerButton.text=Open in External Viewer +RedoAction.displayName.text=Redo +UndoAction.displayName.text=Undo diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle_ja.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java index 9d89b4fb1b..d497af39e0 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java @@ -35,6 +35,8 @@ import javafx.scene.input.KeyCodeCombination; import javax.annotation.Nonnull; import javax.annotation.concurrent.Immutable; import javax.swing.JOptionPane; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.Category; @@ -71,7 +73,7 @@ public class CategorizeAction extends AddTagAction { @Override protected String getActionDisplayName() { - return "Categorize"; + return NbBundle.getMessage(this.getClass(), "CategorizeAction.displayName.txt"); } @Override @@ -86,7 +88,7 @@ public class CategorizeAction extends AddTagAction { } public void addTagsToFiles(TagName tagName, String comment, Set selectedFiles, boolean createUndo) { - Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); + Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); //NON-NLS controller.queueDBWorkerTask(new CategorizeTask(selectedFiles, tagName, comment, createUndo)); } @@ -97,7 +99,7 @@ public class CategorizeAction extends AddTagAction { static private class CategoryMenu extends Menu { CategoryMenu(ImageGalleryController controller) { - super("Categorize"); + super(NbBundle.getMessage(CategorizeAction.class, "CategorizeAction.displayName.txt")); // Each category get an item in the sub-menu. Selecting one of these menu items adds // a tag with the associated category. @@ -157,7 +159,7 @@ public class CategorizeAction extends AddTagAction { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); + LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); //NON-NLS } }); } else { @@ -170,7 +172,7 @@ public class CategorizeAction extends AddTagAction { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error categorizing result", ex); + LOGGER.log(Level.SEVERE, "Error categorizing result", ex); //NON-NLS JOptionPane.showMessageDialog(null, "Unable to categorize " + fileID + ".", "Categorizing Error", JOptionPane.ERROR_MESSAGE); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java index 27ab1cd8b1..531bc5fafb 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java @@ -23,6 +23,7 @@ import java.util.logging.Level; import javafx.event.ActionEvent; import javax.swing.SwingWorker; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; @@ -39,7 +40,7 @@ public class DeleteFollowUpTagAction extends Action { private static final Logger LOGGER = Logger.getLogger(DeleteFollowUpTagAction.class.getName()); public DeleteFollowUpTagAction(final ImageGalleryController controller, final DrawableFile file) { - super("Delete Follow Up Tag"); + super(NbBundle.getMessage(DeleteFollowUpTagAction.class, "DeleteFollwUpTagAction.displayName.txt")); setEventHandler((ActionEvent t) -> { new SwingWorker() { @@ -57,7 +58,7 @@ public class DeleteFollowUpTagAction extends Action { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); + LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); //NON-NLS } return null; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java index c94cfc5ffb..107a73adbc 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java @@ -24,6 +24,7 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -32,12 +33,12 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm public class Forward extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); //NON-NLS private final ImageGalleryController controller; public Forward(ImageGalleryController controller) { - super("Forward"); + super(NbBundle.getMessage(Forward.class, "Forward.forward.txt")); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.RIGHT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java index 0d446cda84..90007c3cff 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java @@ -26,6 +26,7 @@ import javafx.event.ActionEvent; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; @@ -37,12 +38,12 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; public class NextUnseenGroup extends Action { private static final Image END = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); //NON-NLS private static final Image ADVANCE = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); //NON-NLS - private static final String MARK_GROUP_SEEN = "Mark Group Seen"; - private static final String NEXT_UNSEEN_GROUP = "Next Unseen group"; + private static final String MARK_GROUP_SEEN = NbBundle.getMessage(NextUnseenGroup.class, "NextUnseenGroup.markGroupSeen.txt"); + private static final String NEXT_UNSEEN_GROUP = NbBundle.getMessage(NextUnseenGroup.class, "NextUnseenGroup.nextUnseenGroup.txt"); private final ImageGalleryController controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java index b1f1f651b7..1134c494fd 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java @@ -25,6 +25,7 @@ import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.openide.util.actions.CallableSystemAction; import org.openide.windows.WindowManager; @@ -41,10 +42,10 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryTopComponent; @ActionRegistration( // iconBase = "org/sleuthkit/autopsy/imagegallery/images/lightbulb.png", lazy = false, displayName = "#CTL_OpenAction") -@Messages("CTL_OpenAction=View Images/Videos") +//@Messages("CTL_OpenAction=View Images/Videos") public final class OpenAction extends CallableSystemAction { - private static final String VIEW_IMAGES_VIDEOS = "View Images/Videos"; + private static final String VIEW_IMAGES_VIDEOS = NbBundle.getMessage(OpenAction.class, "CTL_OpenAction"); private static final boolean fxInited = Installer.isJavaFxInited(); @@ -83,11 +84,8 @@ public final class OpenAction extends CallableSystemAction { if (ImageGalleryModule.isDrawableDBStale(currentCase)) { //drawable db is stale, ask what to do - int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), "The image / video database may be out of date. " + "Do you want to update and listen for further ingest results?\n" - + "Choosing 'yes' will update the database and enable listening to future ingests." - + " Choosing 'no' will display the out of date results." - + " Choosing 'cancel' will close the image /video gallery", - "Image Gallery", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(this.getClass(), "OpenAction.performAction.answer.txt"), + NbBundle.getMessage(this.getClass(), "OpenAction.moduleName.text"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); switch (answer) { case JOptionPane.YES_OPTION: diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java index ba33d077ba..7e14774d53 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java @@ -32,14 +32,14 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; * Wraps {@link ExternalViewerAction} in a ControlsFX {@link Action} with * appropriate text and graphic */ -@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer"}) +//@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer"}) public class OpenExternalViewerAction extends Action { - private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); + private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); //NON-NLS private static final ActionEvent ACTION_EVENT = new ActionEvent(OpenExternalViewerAction.class, ActionEvent.ACTION_PERFORMED, ""); //Swing ActionEvent //NOI18N public OpenExternalViewerAction(DrawableFile file) { - super("External Viewer"); + super(NbBundle.getMessage(OpenExternalViewerAction.class, "OpenExternalViewerAction.displayName.text")); /** * TODO: why is the name passed to the action? it means we duplicate diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java index a75a786317..c9745f7ed8 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java @@ -38,15 +38,15 @@ import org.sleuthkit.autopsy.coreutils.Logger; displayName = "#CTL_OpenHelpAction" ) @ActionReference(path = "Menu/Help", position = 350) -@Messages("CTL_OpenHelpAction=Image / Video Gallery Help") +//@Messages("CTL_OpenHelpAction=Image / Video Gallery Help") public final class OpenHelpAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { try { - Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); + Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); //NON-NLS } catch (IOException ex) { - Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); + Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); //NON-NLS } } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java index e3ce54cd7c..e79341ce1c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java @@ -23,6 +23,7 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -30,10 +31,10 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; */ public class RedoAction extends Action { - private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); + private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); //NON-NLS public RedoAction(ImageGalleryController controller) { - super("Redo"); + super(NbBundle.getMessage(RedoAction.class, "RedoAction.displayName.text")); setGraphic(new ImageView(REDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Y, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().redo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java index 0285c57bb7..cd5b0db175 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java @@ -23,6 +23,7 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -30,10 +31,10 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; */ public class UndoAction extends Action { - private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); + private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); //NON-NLS public UndoAction(ImageGalleryController controller) { - super("Undo"); + super(NbBundle.getMessage(UndoAction.class, "UndoAction.displayName.text")); setGraphic(new ImageView(UNDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Z, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().undo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties new file mode 100644 index 0000000000..5180c7d1d2 --- /dev/null +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties @@ -0,0 +1,22 @@ +Category.cat0.uncategorized.displayName=CAT-0\: Uncategorized +Category.cat1.childExploitationIllegal.displayName=CAT-1\: Child Exploitation (Illegal) +Category.cat2.childExploitationNonIllegalAgeDifficult.displayName=CAT-2\: Child Exploitation (Non-Illegal/Age Difficult) +Category.cat3.cgiAnimationChildExploitive.displayName=CAT-3\: CGI/Animation (Child Exploitive) +Category.cat4.exemplarComparisonInternalUseOnly.displayName=CAT-4\: Exemplar/Comparison (Internal Use Only) +Category.cat5.nonPertinent.displayName=CAT-5\: Non-pertinent +DrawableAttribute.analyzed.txt=Analyzed +DrawableAttribute.cameraMake.txt=Camera Make +DrawableAttribute.cameraModel.txt=Camera Model +DrawableAttribute.category.txt=Category +DrawableAttribute.createdTime.txt=Created Time +DrawableAttribute.hashset.txt=Hashset +DrawableAttribute.height.txt=Height +DrawableAttribute.internalObjectId.txt=Internal Object ID +DrawableAttribute.md5Hash.txt=MD5 Hash +DrawableAttribute.modifiedTime.txt=Modified Time +DrawableAttribute.name.txt=Name +DrawableAttribute.path.txt=Path +DrawableAttribute.tags.txt=Tags +DrawableAttribute.width.txt=Width +DrawableTagsManager.followUp.tagName.txt=Follow Up +VideoFile.progress.text=writing temporary file to disk \ No newline at end of file diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle_ja.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java index 1567a1b2b4..fc82a44580 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java @@ -24,6 +24,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import javafx.scene.paint.Color; +import org.openide.util.NbBundle; /** * Enum to represent the six categories in the DHS image categorization scheme. @@ -32,15 +33,15 @@ public enum Category { /* * This order of declaration is required so that Enum's compareTo method - * preserves the fact that lower category numbers are first/most sever, + * preserves the fact that lower category numbers are first/most severe, * except 0 which is last */ - ONE(Color.RED, 1, "CAT-1: Child Exploitation (Illegal)"), - TWO(Color.ORANGE, 2, "CAT-2: Child Exploitation (Non-Illegal/Age Difficult)"), - THREE(Color.YELLOW, 3, "CAT-3: CGI/Animation (Child Exploitive)"), - FOUR(Color.BISQUE, 4, "CAT-4: Exemplar/Comparison (Internal Use Only)"), - FIVE(Color.GREEN, 5, "CAT-5: Non-pertinent"), - ZERO(Color.LIGHTGREY, 0, "CAT-0: Uncategorized"); + ONE(Color.RED, 1, NbBundle.getMessage(Category.class, "Category.cat1.childExploitationIllegal.displayName")), + TWO(Color.ORANGE, 2, NbBundle.getMessage(Category.class, "Category.cat2.childExploitationNonIllegalAgeDifficult.displayName")), + THREE(Color.YELLOW, 3, NbBundle.getMessage(Category.class, "Category.cat3.cgiAnimationChildExploitive.displayName")), + FOUR(Color.BISQUE, 4, NbBundle.getMessage(Category.class, "Category.cat4.exemplarComparisonInternalUseOnly.displayName")), + FIVE(Color.GREEN, 5, NbBundle.getMessage(Category.class, "Category.cat5.nonPertinent.displayName")), + ZERO(Color.LIGHTGREY, 0, NbBundle.getMessage(Category.class, "Category.cat0.uncategorized.displayName")); public static ImmutableList getNonZeroCategories() { return nonZeroCategories; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java index d2018d422c..464c2492b0 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java @@ -68,8 +68,8 @@ public class CategoryManager { * Used to distribute {@link CategoryChangeEvent}s */ private final EventBus categoryEventBus = new AsyncEventBus(Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { - LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); + new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS + LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); //NON-NLS }).build() )); @@ -176,7 +176,7 @@ public class CategoryManager { longAdder.add(db.getCategoryCount(cat)); longAdder.increment(); } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); + LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS } return longAdder; } @@ -210,8 +210,8 @@ public class CategoryManager { try { categoryEventBus.unregister(listener); } catch (IllegalArgumentException e) { - if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { - LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); + if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { //NON-NLS + LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); //NON-NLS } else { throw e; } @@ -254,12 +254,12 @@ public class CategoryManager { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); + LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); //NON-NLS } } } } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); + LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); //NON-NLS } Category newCat = CategoryManager.categoryFromTagName(addedTag.getName()); if (newCat != Category.ZERO) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java index 104af6c6e6..09d8955257 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java @@ -27,6 +27,7 @@ import javafx.beans.property.ReadOnlyStringWrapper; import javafx.beans.property.StringProperty; import javafx.scene.image.Image; import org.apache.commons.lang3.StringUtils; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.datamodel.ContentUtils; import org.sleuthkit.datamodel.TagName; @@ -40,13 +41,13 @@ import org.sleuthkit.datamodel.TagName; public class DrawableAttribute> { public final static DrawableAttribute MD5_HASH - = new DrawableAttribute<>(AttributeName.MD5_HASH, "MD5 Hash", false, "icon-hashtag.png", f -> Collections.singleton(f.getMd5Hash())); + = new DrawableAttribute<>(AttributeName.MD5_HASH, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.md5Hash.txt"), false, "icon-hashtag.png", f -> Collections.singleton(f.getMd5Hash())); // NON-NLS public final static DrawableAttribute NAME - = new DrawableAttribute<>(AttributeName.NAME, "Name", true, "folder-rename.png", f -> Collections.singleton(f.getName())); + = new DrawableAttribute<>(AttributeName.NAME, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.name.txt"), true, "folder-rename.png", f -> Collections.singleton(f.getName())); // NON-NLS public final static DrawableAttribute ANALYZED - = new DrawableAttribute<>(AttributeName.ANALYZED, "Analyzed", true, "", f -> Collections.singleton(f.isAnalyzed())); + = new DrawableAttribute<>(AttributeName.ANALYZED, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.analyzed.txt"), true, "", f -> Collections.singleton(f.isAnalyzed())); /** * since categories are really just tags in autopsy, they are not dealt with @@ -57,37 +58,37 @@ public class DrawableAttribute> { * advantage. move categories into DrawableDB? */ public final static DrawableAttribute CATEGORY - = new DrawableAttribute<>(AttributeName.CATEGORY, "Category", false, "category-icon.png", f -> Collections.singleton(f.getCategory())); + = new DrawableAttribute<>(AttributeName.CATEGORY, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.category.txt"), false, "category-icon.png", f -> Collections.singleton(f.getCategory())); // NON-NLS public final static DrawableAttribute TAGS - = new DrawableAttribute<>(AttributeName.TAGS, "Tags", false, "tag_red.png", DrawableFile::getTagNames); + = new DrawableAttribute<>(AttributeName.TAGS, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.tags.txt"), false, "tag_red.png", DrawableFile::getTagNames); // NON-NLS public final static DrawableAttribute PATH - = new DrawableAttribute<>(AttributeName.PATH, "Path", true, "folder_picture.png", f -> Collections.singleton(f.getDrawablePath())); + = new DrawableAttribute<>(AttributeName.PATH, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.path.txt"), true, "folder_picture.png", f -> Collections.singleton(f.getDrawablePath())); // NON-NLS public final static DrawableAttribute CREATED_TIME - = new DrawableAttribute<>(AttributeName.CREATED_TIME, "Created Time", true, "clock--plus.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getCrtime(), f))); + = new DrawableAttribute<>(AttributeName.CREATED_TIME, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.createdTime.txt"), true, "clock--plus.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getCrtime(), f))); // NON-NLS public final static DrawableAttribute MODIFIED_TIME - = new DrawableAttribute<>(AttributeName.MODIFIED_TIME, "Modified Time", true, "clock--pencil.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getMtime(), f))); + = new DrawableAttribute<>(AttributeName.MODIFIED_TIME, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.modifiedTime.txt"), true, "clock--pencil.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getMtime(), f))); // NON-NLS public final static DrawableAttribute MAKE - = new DrawableAttribute<>(AttributeName.MAKE, "Camera Make", true, "camera.png", f -> Collections.singleton(f.getMake())); + = new DrawableAttribute<>(AttributeName.MAKE, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.cameraMake.txt"), true, "camera.png", f -> Collections.singleton(f.getMake())); // NON-NLS public final static DrawableAttribute MODEL - = new DrawableAttribute<>(AttributeName.MODEL, "Camera Model", true, "camera.png", f -> Collections.singleton(f.getModel())); + = new DrawableAttribute<>(AttributeName.MODEL, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.cameraModel.txt"), true, "camera.png", f -> Collections.singleton(f.getModel())); // NON-NLS public final static DrawableAttribute HASHSET - = new DrawableAttribute<>(AttributeName.HASHSET, "Hashset", true, "hashset_hits.png", DrawableFile::getHashSetNamesUnchecked); + = new DrawableAttribute<>(AttributeName.HASHSET, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.hashset.txt"), true, "hashset_hits.png", DrawableFile::getHashSetNamesUnchecked); // NON-NLS public final static DrawableAttribute OBJ_ID - = new DrawableAttribute<>(AttributeName.OBJ_ID, "Internal Object ID", true, "", f -> Collections.singleton(f.getId())); + = new DrawableAttribute<>(AttributeName.OBJ_ID, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.internalObjectId.txt"), true, "", f -> Collections.singleton(f.getId())); public final static DrawableAttribute WIDTH - = new DrawableAttribute<>(AttributeName.WIDTH, "Width", true, "arrow-resize.png", f -> Collections.singleton(f.getWidth())); + = new DrawableAttribute<>(AttributeName.WIDTH, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.width.txt"), true, "arrow-resize.png", f -> Collections.singleton(f.getWidth())); // NON-NLS public final static DrawableAttribute HEIGHT - = new DrawableAttribute<>(AttributeName.HEIGHT, "Height", true, "arrow-resize-090.png", f -> Collections.singleton(f.getHeight())); + = new DrawableAttribute<>(AttributeName.HEIGHT, NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.height.txt"), true, "arrow-resize-090.png", f -> Collections.singleton(f.getHeight())); // NON-NLS final private static List< DrawableAttribute> groupables = Arrays.asList(PATH, HASHSET, CATEGORY, TAGS, MAKE, MODEL); @@ -119,7 +120,7 @@ public class DrawableAttribute> { public Image getIcon() { if (icon == null) { if (StringUtils.isBlank(imageName) == false) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS } } return icon; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java index 5c648b94cd..dd59ade301 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java @@ -77,11 +77,11 @@ public final class DrawableDB { private static final org.sleuthkit.autopsy.coreutils.Logger LOGGER = Logger.getLogger(DrawableDB.class.getName()); //column name constants////////////////////// - private static final String ANALYZED = "analyzed"; + private static final String ANALYZED = "analyzed"; //NON-NLS - private static final String OBJ_ID = "obj_id"; + private static final String OBJ_ID = "obj_id"; //NON-NLS - private static final String HASH_SET_NAME = "hash_set_name"; + private static final String HASH_SET_NAME = "hash_set_name"; //NON-NLS private final PreparedStatement insertHashSetStmt; @@ -140,7 +140,7 @@ public final class DrawableDB { try { Class.forName("org.sqlite.JDBC"); } catch (ClassNotFoundException ex) { - LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); + LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); //NON-NLS } } private final SleuthkitCase tskCase; @@ -201,33 +201,33 @@ public final class DrawableDB { Files.createDirectories(dbPath.getParent()); if (initializeDBSchema()) { updateFileStmt = prepareStatement( - "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " - + "VALUES (?,?,?,?,?,?,?,?)"); + "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS + + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS insertFileStmt = prepareStatement( - "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " - + "VALUES (?,?,?,?,?,?,?,?)"); + "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS + + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS - removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); + removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); //NON-NLS - pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); - nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); - created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); - modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); - makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); - modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); - analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); - hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); + pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); //NON-NLS + nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); //NON-NLS + created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); //NON-NLS + modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); //NON-NLS + makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); //NON-NLS + modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); //NON-NLS + analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); //NON-NLS + hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); //NON-NLS - updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); - insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); + updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); //NON-NLS + insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); //NON-NLS - groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); + groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); //NON-NLS - selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); - insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); - selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); + selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); //NON-NLS + insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); //NON-NLS + selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); //NON-NLS - insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); + insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); //NON-NLS for (Category cat : Category.values()) { insertGroup(cat.getDisplayName(), DrawableAttribute.CATEGORY); @@ -289,12 +289,12 @@ public final class DrawableDB { public static DrawableDB getDrawableDB(Path dbPath, ImageGalleryController controller) { try { - return new DrawableDB(dbPath.resolve("drawable.db"), controller); + return new DrawableDB(dbPath.resolve("drawable.db"), controller); //NON-NLS } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); + LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); //NON-NLS return null; } catch (ExceptionInInitializerError | IOException ex) { - LOGGER.log(Level.SEVERE, "error creating database connection", ex); + LOGGER.log(Level.SEVERE, "error creating database connection", ex); //NON-NLS return null; } } @@ -304,33 +304,33 @@ public final class DrawableDB { //this should match Sleuthkit db setupt try (Statement statement = con.createStatement()) { //reduce i/o operations, we have no OS crash recovery anyway - statement.execute("PRAGMA synchronous = OFF;"); + statement.execute("PRAGMA synchronous = OFF;"); //NON-NLS //allow to query while in transaction - no need read locks - statement.execute("PRAGMA read_uncommitted = True;"); + statement.execute("PRAGMA read_uncommitted = True;"); //NON-NLS //TODO: do we need this? - statement.execute("PRAGMA foreign_keys = ON"); + statement.execute("PRAGMA foreign_keys = ON"); //NON-NLS //TODO: test this - statement.execute("PRAGMA journal_mode = MEMORY"); + statement.execute("PRAGMA journal_mode = MEMORY"); //NON-NLS // //we don't use this feature, so turn it off for minimal speed up on queries //this is deprecated and not recomended - statement.execute("PRAGMA count_changes = OFF;"); + statement.execute("PRAGMA count_changes = OFF;"); //NON-NLS //this made a big difference to query speed - statement.execute("PRAGMA temp_store = MEMORY"); + statement.execute("PRAGMA temp_store = MEMORY"); //NON-NLS //this made a modest improvement in query speeds - statement.execute("PRAGMA cache_size = 50000"); + statement.execute("PRAGMA cache_size = 50000"); //NON-NLS //we never delete anything so... - statement.execute("PRAGMA auto_vacuum = 0"); + statement.execute("PRAGMA auto_vacuum = 0"); //NON-NLS } try { - LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", + LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", //NON-NLS SQLiteJDBCLoader.getVersion(), SQLiteJDBCLoader.isNativeMode() - ? "native" : "pure-java")); + ? "native" : "pure-java")); //NON-NLS } catch (Exception exception) { - LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); + LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); //NON-NLS } } @@ -349,92 +349,92 @@ public final class DrawableDB { setPragmas(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem accessing database", ex); + LOGGER.log(Level.SEVERE, "problem accessing database", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists drawable_files " - + "( obj_id INTEGER PRIMARY KEY, " - + " path VARCHAR(255), " - + " name VARCHAR(255), " - + " created_time integer, " - + " modified_time integer, " - + " make VARCHAR(255), " - + " model VARCHAR(255), " - + " analyzed integer DEFAULT 0)"; + String sql = "CREATE TABLE if not exists drawable_files " //NON-NLS + + "( obj_id INTEGER PRIMARY KEY, " //NON-NLS + + " path VARCHAR(255), " //NON-NLS + + " name VARCHAR(255), " //NON-NLS + + " created_time integer, " //NON-NLS + + " modified_time integer, " //NON-NLS + + " make VARCHAR(255), " //NON-NLS + + " model VARCHAR(255), " //NON-NLS + + " analyzed integer DEFAULT 0)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); + LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists groups " - + "(group_id INTEGER PRIMARY KEY, " - + " value VARCHAR(255) not null, " - + " attribute VARCHAR(255) not null, " - + " seen integer DEFAULT 0, " - + " UNIQUE(value, attribute) )"; + String sql = "CREATE TABLE if not exists groups " //NON-NLS + + "(group_id INTEGER PRIMARY KEY, " //NON-NLS + + " value VARCHAR(255) not null, " //NON-NLS + + " attribute VARCHAR(255) not null, " //NON-NLS + + " seen integer DEFAULT 0, " //NON-NLS + + " UNIQUE(value, attribute) )"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating groups table", ex); + LOGGER.log(Level.SEVERE, "problem creating groups table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_sets " - + "( hash_set_id INTEGER primary key," - + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; + String sql = "CREATE TABLE if not exists hash_sets " //NON-NLS + + "( hash_set_id INTEGER primary key," //NON-NLS + + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); + LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_set_hits " - + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " - + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " - + " PRIMARY KEY (hash_set_id, obj_id))"; + String sql = "CREATE TABLE if not exists hash_set_hits " //NON-NLS + + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " //NON-NLS + + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " //NON-NLS + + " PRIMARY KEY (hash_set_id, obj_id))"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); + LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; + String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating path_idx", ex); + LOGGER.log(Level.WARNING, "problem creating path_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; + String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating name_idx", ex); + LOGGER.log(Level.WARNING, "problem creating name_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; + String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating make_idx", ex); + LOGGER.log(Level.WARNING, "problem creating make_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; + String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating model_idx", ex); + LOGGER.log(Level.WARNING, "problem creating model_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; + String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); + LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); //NON-NLS } return true; @@ -455,7 +455,7 @@ public final class DrawableDB { closeStatements(); con.close(); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); + LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); //NON-NLS } } con = null; @@ -464,10 +464,10 @@ public final class DrawableDB { public void openDBCon() { try { if (con == null || con.isClosed()) { - con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); + con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); //NON-NLS } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); + LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); //NON-NLS } } @@ -518,7 +518,7 @@ public final class DrawableDB { names.add(rs.getString(HASH_SET_NAME)); } } catch (SQLException sQLException) { - LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); + LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); //NON-NLS } finally { dbReadUnlock(); } @@ -533,11 +533,11 @@ public final class DrawableDB { groupSeenQueryStmt.setString(2, groupKey.getAttribute().attrName.toString()); try (ResultSet rs = groupSeenQueryStmt.executeQuery()) { while (rs.next()) { - return rs.getBoolean("seen"); + return rs.getBoolean("seen"); //NON-NLS } } } catch (SQLException ex) { - String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); + String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); //NON-NLS LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -555,7 +555,7 @@ public final class DrawableDB { updateGroupStmt.setString(3, gk.getAttribute().attrName.toString()); updateGroupStmt.execute(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); + LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); //NON-NLS } finally { dbWriteUnlock(); } @@ -623,7 +623,7 @@ public final class DrawableDB { selectHashSetStmt.setString(1, name); try (ResultSet rs = selectHashSetStmt.executeQuery()) { while (rs.next()) { - int hashsetID = rs.getInt("hash_set_id"); + int hashsetID = rs.getInt("hash_set_id"); //NON-NLS //"insert or ignore into hash_set_hits (hash_set_id, obj_id) values (?,?)"; insertHashHitStmt.setInt(1, hashsetID); insertHashHitStmt.setLong(2, f.getId()); @@ -633,7 +633,7 @@ public final class DrawableDB { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); + LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); //NON-NLS } //and update all groups this file is in @@ -650,7 +650,7 @@ public final class DrawableDB { // This is one of the places where we get an error if the case is closed during processing, // which doesn't need to be reported here. if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); + LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); //NON-NLS } } finally { @@ -676,12 +676,12 @@ public final class DrawableDB { public Boolean isFileAnalyzed(long fileId) { dbReadLock(); try (Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { //NON-NLS while (analyzedQuery.next()) { return analyzedQuery.getBoolean(ANALYZED); } } catch (SQLException ex) { - String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); + String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); //NON-NLS LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -695,12 +695,12 @@ public final class DrawableDB { dbReadLock(); try (Statement stmt = con.createStatement(); //Can't make this a preprared statement because of the IN ( ... ) - ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { + ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { //NON-NLS while (analyzedQuery.next()) { return analyzedQuery.getInt(ANALYZED) == fileIds.size(); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS } finally { dbReadUnlock(); } @@ -717,7 +717,7 @@ public final class DrawableDB { // In testing, this method appears to be a lot faster than doing one large select statement for (Long fileID : fileIDsInGroup) { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); //NON-NLS while (analyzedQuery.next()) { if (analyzedQuery.getInt(ANALYZED) == 0) { return false; @@ -727,7 +727,7 @@ public final class DrawableDB { } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS } //// Old method @@ -741,7 +741,7 @@ public final class DrawableDB { // LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //} } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); //NON-NLS } finally { dbReadUnlock(); } @@ -767,7 +767,7 @@ public final class DrawableDB { dbReadLock(); try { statement = con.createStatement(); - rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); + rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); //NON-NLS while (rs.next()) { ret.add(rs.getLong(1)); } @@ -778,14 +778,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); //NON-NLS } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); //NON-NLS } } dbReadUnlock(); @@ -819,14 +819,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); //NON-NLS } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); //NON-NLS } } dbReadUnlock(); @@ -855,14 +855,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); //NON-NLS } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); //NON-NLS } } dbReadUnlock(); @@ -893,15 +893,15 @@ public final class DrawableDB { default: dbReadLock(); //TODO: convert this to prepared statement - StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); + StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); //NON-NLS String orderByClause = ""; switch (sortBy) { case GROUP_BY_VALUE: - orderByClause = " ORDER BY " + groupBy.attrName.toString(); + orderByClause = " ORDER BY " + groupBy.attrName.toString(); //NON-NLS break; case FILE_COUNT: - orderByClause = " ORDER BY COUNT(*)"; + orderByClause = " ORDER BY COUNT(*)"; //NON-NLS break; case NONE: // case PRIORITY: @@ -915,10 +915,10 @@ public final class DrawableDB { switch (sortOrder) { case DESCENDING: - sortOrderClause = " DESC"; + sortOrderClause = " DESC"; //NON-NLS break; case ASCENDING: - sortOrderClause = " ASC"; + sortOrderClause = " ASC"; //NON-NLS break; default: orderByClause = ""; @@ -940,7 +940,7 @@ public final class DrawableDB { vals.add(value); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); + LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); //NON-NLS } finally { dbReadUnlock(); } @@ -961,7 +961,7 @@ public final class DrawableDB { } catch (SQLException sQLException) { // Don't need to report it if the case was closed if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); + LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); //NON-NLS } } finally { dbWriteUnlock(); @@ -982,7 +982,7 @@ public final class DrawableDB { AbstractFile f = tskCase.getAbstractFileById(id); return DrawableFile.create(f, analyzed, isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); //NON-NLS return null; } } @@ -1001,7 +1001,7 @@ public final class DrawableDB { return DrawableFile.create(f, areFilesAnalyzed(Collections.singleton(id)), isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); //NON-NLS return null; } } @@ -1028,7 +1028,7 @@ public final class DrawableDB { } } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); + LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); //NON-NLS } finally { dbReadUnlock(); } @@ -1062,7 +1062,7 @@ public final class DrawableDB { } } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to get file for group:" + key.getAttribute() + " == " + key.getValue(), ex); + LOGGER.log(Level.WARNING, "failed to get file for group:" + key.getAttribute() + " == " + key.getValue(), ex); //NON-NLS } finally { dbReadUnlock(); } @@ -1088,7 +1088,7 @@ public final class DrawableDB { } return files; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + cat.getDisplayName(), ex); + LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + cat.getDisplayName(), ex); //NON-NLS throw ex; } } @@ -1101,14 +1101,14 @@ public final class DrawableDB { public int countAllFiles() { int result = -1; dbReadLock(); - try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { + try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { //NON-NLS while (rs.next()) { result = rs.getInt("COUNT"); break; } } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); + LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); //NON-NLS } finally { dbReadUnlock(); } @@ -1140,7 +1140,7 @@ public final class DrawableDB { //TODO: delete from hash_set_hits table also... } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); + LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); //NON-NLS } finally { dbWriteUnlock(); } @@ -1151,7 +1151,7 @@ public final class DrawableDB { public class MultipleTransactionException extends IllegalStateException { - private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; + private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; //NON-NLS public MultipleTransactionException() { super(CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO); @@ -1195,12 +1195,12 @@ public final class DrawableDB { dbReadLock(); try { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); + ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); //NON-NLS while (analyzedQuery.next()) { addImageFileToList(analyzedQuery.getLong(OBJ_ID)); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); + LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); //NON-NLS } finally { dbReadUnlock(); } @@ -1252,9 +1252,9 @@ public final class DrawableDB { .count(); } } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); + LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS } catch (TskCoreException ex1) { - LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); + LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); //NON-NLS } return -1; } @@ -1288,15 +1288,15 @@ public final class DrawableDB { //count the fileids that are in the given list and don't have a non-zero category assigned to them. String name = - "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList - + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; + "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList //NON-NLS + + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; //NON-NLS try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(name); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - return resultSet.getLong("count(obj_id)"); + return resultSet.getLong("count(obj_id)"); //NON-NLS } } catch (SQLException | TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error getting category count.", ex); + LOGGER.log(Level.SEVERE, "Error getting category count.", ex); //NON-NLS } return -1; } @@ -1330,7 +1330,7 @@ public final class DrawableDB { con.setAutoCommit(false); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); + LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); //NON-NLS } } @@ -1341,7 +1341,7 @@ public final class DrawableDB { con.rollback(); updatedFiles.clear(); } catch (SQLException ex1) { - LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); + LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); //NON-NLS } finally { close(); } @@ -1363,9 +1363,9 @@ public final class DrawableDB { } } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); + LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); //NON-NLS } else { - LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); + LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); //NON-NLS } rollback(); } @@ -1378,9 +1378,9 @@ public final class DrawableDB { con.setAutoCommit(true); } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); //NON-NLS } else { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); //NON-NLS } } finally { closed = true; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java index bd6d0be705..1c3eda1447 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java @@ -187,9 +187,9 @@ public abstract class DrawableFile extends AbstractFile .map(Tag::getName) .collect(Collectors.toSet()); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); //NON-NLS } catch (IllegalStateException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); + Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); //NON-NLS } return Collections.emptySet(); } @@ -224,7 +224,7 @@ public abstract class DrawableFile extends AbstractFile } } } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); //NON-NLS } return ""; } @@ -256,7 +256,7 @@ public abstract class DrawableFile extends AbstractFile .orElse(Category.ZERO) ); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); + LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); //NON-NLS } catch (IllegalStateException ex) { // We get here many times if the case is closed during ingest, so don't print out a ton of warnings. } @@ -334,7 +334,7 @@ public abstract class DrawableFile extends AbstractFile drawablePath = StringUtils.removeEnd(getUniquePath(), getName()); return drawablePath; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); + LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); //NON-NLS return ""; } } @@ -345,7 +345,7 @@ public abstract class DrawableFile extends AbstractFile try { return getHashSetNames(); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); + LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); //NON-NLS return Collections.emptySet(); } } @@ -363,7 +363,7 @@ public abstract class DrawableFile extends AbstractFile return this.getUniquePath(); } catch (TskCoreException tskCoreException) { String contentName = this.getName(); - LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N + LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N NON-NLS return contentName; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java index 0d122a6219..d9600dcdf4 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java @@ -28,6 +28,7 @@ import java.util.logging.Level; import java.util.stream.Collectors; import javax.annotation.Nonnull; import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.casemodule.services.TagsManager; @@ -45,7 +46,7 @@ public class DrawableTagsManager { private static final Logger LOGGER = Logger.getLogger(DrawableTagsManager.class.getName()); - private static final String FOLLOW_UP = "Follow Up"; + private static final String FOLLOW_UP = NbBundle.getMessage(DrawableTagsManager.class, "DrawableTagsManager.followUp.tagName.txt"); final private Object autopsyTagsManagerLock = new Object(); private TagsManager autopsyTagsManager; @@ -53,8 +54,8 @@ public class DrawableTagsManager { /** Used to distribute {@link TagsChangeEvent}s */ private final EventBus tagsEventBus = new AsyncEventBus( Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { - LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); + new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS + LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); //NON-NLS }).build() )); @@ -147,7 +148,7 @@ public class DrawableTagsManager { .distinct().sorted() .collect(Collectors.toList()); } catch (TskCoreException | IllegalStateException ex) { - LOGGER.log(Level.WARNING, "couldn't access case", ex); + LOGGER.log(Level.WARNING, "couldn't access case", ex); //NON-NLS } return Collections.emptyList(); } @@ -183,7 +184,7 @@ public class DrawableTagsManager { throw new TskCoreException("tagame exists but wasn't found", ex); } } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); + LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); //NON-NLS throw new TskCoreException("Case was closed out from underneath", ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java index a04646c310..9b3b3218f1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java @@ -46,7 +46,7 @@ public class HashSetManager { try { return db.getHashSetsForFile(fileID); } catch (TskCoreException ex) { - Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); + Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); //NON-NLS return Collections.emptySet(); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java index 4249fe3c24..01e5cfd983 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java @@ -46,7 +46,7 @@ public class ImageFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to read image {0}: " + exception.toString(); + return "Failed to read image {0}: " + exception.toString(); //NON-NLS } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java index 20724ef0bc..a45480bcae 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java @@ -29,6 +29,7 @@ import javafx.scene.media.Media; import javafx.scene.media.MediaException; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.VideoUtils; @@ -39,7 +40,7 @@ public class VideoFile extends DrawableFile { private static final Logger LOGGER = Logger.getLogger(VideoFile.class.getName()); - private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); + private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); //NON-NLS VideoFile(T file, Boolean analyzed) { super(file, analyzed); @@ -53,7 +54,7 @@ public class VideoFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to get image preview for video {0}: " + exception.toString(); + return "Failed to get image preview for video {0}: " + exception.toString(); //NON-NLS } @Override @@ -73,7 +74,7 @@ public class VideoFile extends DrawableFile { if (cacheFile.exists() == false || cacheFile.length() < getAbstractFile().getSize()) { Files.createParentDirs(cacheFile); - ProgressHandle progressHandle = ProgressHandleFactory.createHandle("writing temporary file to disk"); + ProgressHandle progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "VideoFile.progress.text")); progressHandle.start(100); ContentUtils.writeToFile(this.getAbstractFile(), cacheFile, progressHandle, null, true); progressHandle.finish(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle.properties new file mode 100644 index 0000000000..7ef8ab2dab --- /dev/null +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle.properties @@ -0,0 +1,7 @@ +GroupManager.progress.regroupingFiles.txt=regrouping files by {0} \: {1} +GroupManager.reGroupTask.displayName.txt=regrouping files by {0} sorted by {1} in {2} order +GroupManager.updateMessage.regroupingFiles.txt=regrouping files by {0} \: {1} +GroupSortBy.fileCount.groupSize.txt=Group Size +GroupSortBy.groupByValue.groupName.txt=Group Name +GroupSortBy.none.txt=None +GroupSortBy.priority.txt=Priority \ No newline at end of file diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle_ja.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java index 85d9a9c80a..0460cbf5de 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java @@ -116,7 +116,7 @@ public class DrawableGroup implements Comparable { .filter(Boolean::booleanValue) .count(); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS } } @@ -129,7 +129,7 @@ public class DrawableGroup implements Comparable { uncatCount.set(ImageGalleryController.getDefault().getDatabase().getCategoryCount(Category.ZERO, fileIDs)); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS } } @@ -142,7 +142,7 @@ public class DrawableGroup implements Comparable { @Override public String toString() { - return "Grouping{ keyProp=" + groupKey + '}'; + return "Grouping{ keyProp=" + groupKey + '}'; //NON-NLS } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java index ce64bebaa3..284a205417 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java @@ -56,7 +56,7 @@ public class GroupKey> implements Comparable @Override public String toString() { - return "GroupKey: " + getAttribute().attrName + " = " + getValue(); + return "GroupKey: " + getAttribute().attrName + " = " + getValue(); //NON-NLS } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java index 8ba8ac6af6..cf51c870be 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java @@ -58,6 +58,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -191,10 +192,10 @@ public class GroupManager { DrawableFile file = db.getFileFromID(fileID); return getGroupKeysForFile(file); } else { - Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); + Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); //NON-NLS } } catch (TskCoreException ex) { - Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); + Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); //NON-NLS } return Collections.emptySet(); } @@ -348,7 +349,7 @@ public class GroupManager { return values; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); + LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); //NON-NLS return Collections.emptyList(); } @@ -392,7 +393,7 @@ public class GroupManager { } } - return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); + return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); //NON-NLS } else { List contentTags = tagsManager.getContentTagsByTagName(tagsManager.getTagName(category)); @@ -404,7 +405,7 @@ public class GroupManager { } } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); + LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); //NON-NLS throw ex; } } @@ -420,7 +421,7 @@ public class GroupManager { } return files; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); + LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); //NON-NLS throw ex; } } @@ -507,7 +508,7 @@ public class GroupManager { /** * an executor to submit async ui related background tasks to. */ - final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); + final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); //NON-NLS public ReadOnlyDoubleProperty regroupProgress() { return regroupProgress.getReadOnlyProperty(); @@ -658,7 +659,7 @@ public class GroupManager { return group; } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); + LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); //NON-NLS } } } @@ -681,7 +682,7 @@ public class GroupManager { private final SortOrder sortOrder; public ReGroupTask(DrawableAttribute groupBy, GroupSortBy sortBy, SortOrder sortOrder) { - super("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", true); + super(NbBundle.getMessage(GroupManager.class, "GroupManager.reGroupTask.displayName.txt", groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), true); this.groupBy = groupBy; this.sortBy = sortBy; @@ -700,7 +701,7 @@ public class GroupManager { return null; } - groupProgress = ProgressHandleFactory.createHandle("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", this); + groupProgress = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "GroupManager.reGroupTask.displayName.txt", groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), this); Platform.runLater(() -> { analyzedGroups.clear(); unSeenGroups.clear(); @@ -718,9 +719,9 @@ public class GroupManager { return null;//abort } p++; - updateMessage("regrouping files by " + groupBy.attrName.toString() + " : " + val); + updateMessage(NbBundle.getMessage(this.getClass(), "GroupManager.updateMessage.regroupingFiles.txt", groupBy.attrName.toString(), val)); updateProgress(p, vals.size()); - groupProgress.progress("regrouping files by " + groupBy.attrName.toString() + " : " + val, p); + groupProgress.progress(NbBundle.getMessage(this.getClass(), "GroupManager.progress.regroupingFiles.txt", groupBy.attrName.toString(), val), p); popuplateIfAnalyzed(new GroupKey(groupBy, val), this); } Platform.runLater(() -> FXCollections.sort(analyzedGroups, sortBy.getGrpComparator(sortOrder))); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java index de2c806105..c475e9a86b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java @@ -27,6 +27,7 @@ import javax.swing.SortOrder; import static javax.swing.SortOrder.ASCENDING; import static javax.swing.SortOrder.DESCENDING; import org.apache.commons.lang3.StringUtils; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; @@ -41,7 +42,7 @@ public enum GroupSortBy implements ComparatorProvider { * sort the groups by the number of files in each sort the groups by the * number of files in each */ - FILE_COUNT("Group Size", true, "folder-open-image.png") { + FILE_COUNT(NbBundle.getMessage(GroupSortBy.class, "GroupSortBy.fileCount.groupSize.txt"), true, "folder-open-image.png") { // NON-NLS @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparingInt(DrawableGroup::getSize)); @@ -56,7 +57,7 @@ public enum GroupSortBy implements ComparatorProvider { * sort the groups by the natural order of the grouping value ( eg group * them by path alphabetically ) */ - GROUP_BY_VALUE("Group Name", true, "folder-rename.png") { + GROUP_BY_VALUE(NbBundle.getMessage(GroupSortBy.class, "GroupSortBy.groupByValue.groupName.txt"), true, "folder-rename.png") { // NON-NLS @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparing(t -> t.groupKey.getValueDisplayName())); @@ -75,7 +76,7 @@ public enum GroupSortBy implements ComparatorProvider { * don't sort the groups just use what ever order they come in (ingest * order) */ - NONE("None", false, "prohibition.png") { + NONE(NbBundle.getMessage(GroupSortBy.class, "GroupSortBy.none.txt"), false, "prohibition.png") { // NON-NLS @Override public Comparator getGrpComparator(SortOrder sortOrder) { return new NoOpComparator<>(); @@ -89,7 +90,7 @@ public enum GroupSortBy implements ComparatorProvider { /** * sort the groups by some priority metric to be determined and implemented */ - PRIORITY("Priority", false, "hashset_hits.png") { + PRIORITY(NbBundle.getMessage(GroupSortBy.class, "GroupSortBy.priority.txt"), false, "hashset_hits.png") { //NON-NLS @Override public Comparator getGrpComparator(SortOrder sortOrder) { return Comparator.nullsLast(Comparator.comparingDouble(DrawableGroup::getHashHitDensity).thenComparingInt(DrawableGroup::getSize).reversed()); @@ -132,7 +133,7 @@ public enum GroupSortBy implements ComparatorProvider { public Image getIcon() { if (icon == null) { if (StringUtils.isBlank(imageName) == false) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS } } return icon; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle.properties new file mode 100644 index 0000000000..c3840e3376 --- /dev/null +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle.properties @@ -0,0 +1,3 @@ +StatusBar.bgTaskLabel.text=Regrouping +StatusBar.fileUpdateTaskLabel.msg=\ File Update Tasks +StatusBar.toolTip.text=Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data. \ No newline at end of file diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle_ja.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java index 402694bd07..872a2afc6b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java @@ -53,7 +53,7 @@ public class NoGroupsDialog extends GridPane { } private NoGroupsDialog() { - FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); + FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); //NON-NLS } public NoGroupsDialog(String message) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java index c1d2fe7a7b..b98b0a918f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java @@ -28,6 +28,7 @@ import javafx.scene.control.Label; import javafx.scene.control.ProgressBar; import javafx.scene.control.Tooltip; import javafx.scene.layout.AnchorPane; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -69,7 +70,7 @@ public class StatusBar extends AnchorPane { assert bgTaskLabel != null : "fx:id=\"bgTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'."; assert bgTaskProgressBar != null : "fx:id=\"bgTaskProgressBar\" was not injected: check your FXML file 'StatusBar.fxml'."; - fileUpdateTaskLabel.textProperty().bind(controller.getFileUpdateQueueSizeProperty().asString().concat(" File Update Tasks"));//;setText(newSize.toString() + " File Update Tasks"); + fileUpdateTaskLabel.textProperty().bind(controller.getFileUpdateQueueSizeProperty().asString().concat(NbBundle.getMessage(this.getClass(), "StatusBar.fileUpdateTaskLabel.msg")));//;setText(newSize.toString() + " File Update Tasks"); fileTaskProgresBar.progressProperty().bind(controller.getFileUpdateQueueSizeProperty().negate()); // controller.getFileUpdateQueueSizeProperty().addListener((ov, oldSize, newSize) -> { // Platform.runLater(() -> { @@ -83,7 +84,7 @@ public class StatusBar extends AnchorPane { if(controller.regroupProgress().lessThan(1.0).get()){ // Regrouping in progress bgTaskProgressBar.progressProperty().setValue(-1.0); - bgTaskLabel.setText("Regrouping"); + bgTaskLabel.setText(NbBundle.getMessage(this.getClass(), "StatusBar.bgTaskLabel.text")); } else{ // Clear the progress bar bgTaskProgressBar.progressProperty().setValue(0.0); @@ -94,14 +95,14 @@ public class StatusBar extends AnchorPane { Platform.runLater(() -> { - staleLabel.setTooltip(new Tooltip("Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data.")); + staleLabel.setTooltip(new Tooltip(NbBundle.getMessage(this.getClass(), "StatusBar.toolTip.text"))); }); staleLabel.visibleProperty().bind(controller.stale()); } public StatusBar(ImageGalleryController controller) { this.controller = controller; - FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); //NON-NLS fxmlLoader.setRoot(this); fxmlLoader.setController(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java index 6fe4ce9b44..b9b1c04813 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java @@ -79,7 +79,7 @@ public class SummaryTablePane extends AnchorPane { public SummaryTablePane(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "SummaryTablePane.fxml"); + FXMLConstructor.construct(this, "SummaryTablePane.fxml"); //NON-NLS } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java index 91ca4a142c..5c68a94436 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java @@ -142,7 +142,7 @@ public class Toolbar extends ToolBar { try { new TagGroupAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); + LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); //NON-NLS } }); @@ -213,7 +213,7 @@ public class Toolbar extends ToolBar { private Toolbar(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "Toolbar.fxml"); + FXMLConstructor.construct(this, "Toolbar.fxml"); //NON-NLS } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java index 9b60278865..b1c675b1cc 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java @@ -46,13 +46,13 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.VideoFile; public class VideoPlayer extends BorderPane { - private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); - private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); - private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); - private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); + private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); //NON-NLS + private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); //NON-NLS + private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); //NON-NLS + private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); //NON-NLS - private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); - private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); + private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); //NON-NLS + private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); //NON-NLS private final MediaPlayer mp; @@ -114,14 +114,14 @@ public class VideoPlayer extends BorderPane { final MediaException ex = mp.getError(); if (ex != null) { Platform.runLater(() -> { - Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); - setCenter(new Text(ex.getType() + "\nSee the logs for details.")); + Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); //NON-NLS + setCenter(new Text(ex.getType() + "\nSee the logs for details.")); //NON-NLS setBottom(null); }); } }); mp.statusProperty().addListener((observableStatus, oldStatus, newStatus) -> { - Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); + Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); //NON-NLS }); mediaView.setMediaPlayer(mp); mediaView.fitHeightProperty().bind(this.heightProperty().subtract(playControlBar.heightProperty())); @@ -236,7 +236,7 @@ public class VideoPlayer extends BorderPane { public VideoPlayer(MediaPlayer mp, VideoFile file) { this.file = file; this.mp = mp; - FXMLConstructor.construct(this, "MediaControl.fxml"); + FXMLConstructor.construct(this, "MediaControl.fxml"); //NON-NLS } protected void updateTime() { @@ -277,10 +277,10 @@ public class VideoPlayer extends BorderPane { int elapsedSeconds = totalSeconds - elapsedMinutes * 60; if (elapsedHours > 0) { - return String.format("%d:%02d:%02d", elapsedHours, + return String.format("%d:%02d:%02d", elapsedHours, //NON-NLS elapsedMinutes, elapsedSeconds); } else { - return String.format("%02d:%02d", elapsedMinutes, + return String.format("%02d:%02d", elapsedMinutes, //NON-NLS elapsedSeconds); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle.properties new file mode 100644 index 0000000000..2b92fdc585 --- /dev/null +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle.properties @@ -0,0 +1,5 @@ +DrawableTileBase.menuItem.extractFiles.text=Extract File(s) +DrawableTileBase.menuItem.showContentViewer.txt=Show Content Viewer +GroupPane.headerString.txt={0} -- {1} hash set hits / {2} files +GroupPane.menuItem.extractFiles.text=Extract File(s) +MetaDataPane.tableView.placeholder.text=Select a file to show its details here. \ No newline at end of file diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle_ja.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java index 674aad0260..badfc20b92 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java @@ -54,7 +54,7 @@ public class DrawableTile extends DrawableTileBase { try { setEffect(Objects.equals(newValue, getFileID()) ? LAST_SELECTED_EFFECT : null); } catch (java.lang.IllegalStateException ex) { - Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); + Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); //NON-NLS } }; @@ -78,7 +78,7 @@ public class DrawableTile extends DrawableTileBase { public DrawableTile(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "DrawableTile.fxml"); + FXMLConstructor.construct(this, "DrawableTile.fxml"); //NON-NLS } /** diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java index 2058737b3c..d2c9f58b90 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java @@ -95,8 +95,8 @@ public abstract class DrawableTileBase extends DrawableUIBase { private static final Border SELECTED_BORDER = new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, new CornerRadii(2), new BorderWidths(3))); //TODO: do this in CSS? -jm - protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); - protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); + protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); //NON-NLS + protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); //NON-NLS protected final FileIDSelectionModel selectionModel; private static ContextMenu contextMenu; @@ -204,7 +204,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { menuItems.add(new AddDrawableTagAction(getController()).getPopupMenu()); - final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); + final MenuItem extractMenuItem = new MenuItem(NbBundle.getMessage(this.getClass(), "DrawableTileBase.menuItem.extractFiles.text")); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -213,10 +213,10 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); menuItems.add(extractMenuItem); - MenuItem contentViewer = new MenuItem("Show Content Viewer"); + MenuItem contentViewer = new MenuItem(NbBundle.getMessage(this.getClass(), "DrawableTileBase.menuItem.showContentViewer.txt")); contentViewer.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { - new NewWindowViewAction("Show Content Viewer", new FileNode(file.getAbstractFile())).actionPerformed(null); + new NewWindowViewAction(NbBundle.getMessage(this.getClass(), "DrawableTileBase.menuItem.showContentViewer.txt"), new FileNode(file.getAbstractFile())).actionPerformed(null); }); }); menuItems.add(contentViewer); @@ -260,7 +260,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { selectionModel.clearAndSelect(file.getId()); new AddDrawableTagAction(getController()).addTag(getController().getTagsManager().getFollowUpTagName(), ""); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); + LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); //NON-NLS } } else { new DeleteFollowUpTagAction(getController(), file).handle(event); @@ -276,7 +276,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { return DrawableAttribute.TAGS.getValue(getFile().get()).stream() .anyMatch(followUpTagName::equals); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); + LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); //NON-NLS return true; } } else { @@ -363,7 +363,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS } }); } @@ -380,7 +380,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { updateFollowUpIcon(); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS } }); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java index d77eee7f44..1a6bfd227e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java @@ -102,7 +102,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView try { fileOpt = Optional.ofNullable(getController().getFileFromId(fileIDOpt.get())); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); + Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); //NON-NLS fileOpt = Optional.empty(); } return fileOpt; @@ -147,7 +147,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView myTask.setOnFailed(failed -> { Throwable exception = myTask.getException(); if (exception instanceof OutOfMemoryError - && exception.getMessage().contains("Java heap space")) { + && exception.getMessage().contains("Java heap space")) { //NON-NLS showErrorNode(Bundle.DrawableUIBase_errorLabel_OOMText(), file); } else { showErrorNode(Bundle.DrawableUIBase_errorLabel_text(), file); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java index 96d30afd93..1219e2d1a8 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java @@ -92,7 +92,7 @@ public interface DrawableView { } catch (NullPointerException ex) { // I think this happens when we're in the process of removing images from the view while // also trying to update it? - Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); + Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); //NON-NLS return false; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java index c82f625763..45c1c1ae2d 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java @@ -97,6 +97,7 @@ import org.controlsfx.control.GridView; import org.controlsfx.control.SegmentedButton; import org.controlsfx.control.action.ActionUtils; import org.openide.util.Lookup; +import org.openide.util.NbBundle; import org.openide.util.actions.Presenter; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; @@ -273,7 +274,7 @@ public class GroupPane extends BorderPane { undoAction = new UndoAction(controller); redoAction = new RedoAction(controller); - FXMLConstructor.construct(this, "GroupPane.fxml"); + FXMLConstructor.construct(this, "GroupPane.fxml"); //NON-NLS } @ThreadConfined(type = ThreadType.JFX) @@ -332,8 +333,7 @@ public class GroupPane extends BorderPane { */ protected String getHeaderString() { return isNull(getGroup()) ? "" - : StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()) + " -- " - + getGroup().getHashSetHitsCount() + " hash set hits / " + getGroup().getSize() + " files"; + : NbBundle.getMessage(this.getClass(), "GroupPane.headerString.txt", StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()), getGroup().getHashSetHitsCount(), getGroup().getSize()); } ContextMenu getContextMenu() { @@ -451,13 +451,13 @@ public class GroupPane extends BorderPane { try { tagSelectedSplitMenu.setText(controller.getTagsManager().getFollowUpTagName().getDisplayName()); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS } tagSelectedSplitMenu.setOnAction(actionEvent -> { try { new TagSelectedFilesAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS } }); @@ -528,7 +528,7 @@ public class GroupPane extends BorderPane { } } } - final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); + final MenuItem extractMenuItem = new MenuItem(NbBundle.getMessage(this.getClass(), "GroupPane.menuItem.extractFiles.text")); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -730,7 +730,7 @@ public class GroupPane extends BorderPane { if (gridView == null || gridView.getSkin() == null) { return Optional.empty(); } - return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); + return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); //NON-NLS } void makeSelection(Boolean shiftDown, Long newFileID) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java index 32b8b8c71f..1da350a189 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java @@ -50,6 +50,7 @@ import javafx.scene.input.KeyEvent; import javafx.scene.layout.Region; import javafx.scene.text.Text; import javafx.util.Pair; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.coreutils.Logger; @@ -84,7 +85,7 @@ public class MetaDataPane extends DrawableUIBase { public MetaDataPane(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "MetaDataPane.fxml"); + FXMLConstructor.construct(this, "MetaDataPane.fxml"); //NON-NLS } @FXML @@ -116,7 +117,7 @@ public class MetaDataPane extends DrawableUIBase { }); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label("Select a file to show its details here.")); + tableView.setPlaceholder(new Label(NbBundle.getMessage(this.getClass(), "MetaDataPane.tableView.placeholder.text"))); tableView.getColumns().setAll(Arrays.asList(attributeColumn, valueColumn)); attributeColumn.setPrefWidth(USE_COMPUTED_SIZE); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java index f7c0ec1751..9b4b7c238f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java @@ -77,7 +77,7 @@ public class SlideShowView extends DrawableTileBase { SlideShowView(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "SlideShowView.fxml"); + FXMLConstructor.construct(this, "SlideShowView.fxml"); //NON-NLS } @FXML @@ -137,7 +137,7 @@ public class SlideShowView extends DrawableTileBase { }); } catch (NullPointerException ex) { // The case has likely been closed - LOGGER.log(Level.WARNING, "Error accessing groupPane"); + LOGGER.log(Level.WARNING, "Error accessing groupPane"); //NON-NLS } } @@ -280,7 +280,7 @@ public class SlideShowView extends DrawableTileBase { */ private String getSupplementalText() { final ObservableList fileIds = getGroupPane().getGroup().fileIds(); - return getFileID().map(fileID -> " ( " + (fileIds.indexOf(fileID) + 1) + " of " + fileIds.size() + " in group )") + return getFileID().map(fileID -> " ( " + (fileIds.indexOf(fileID) + 1) + " of " + fileIds.size() + " in group )") //NON-NLS .orElse(""); } @@ -324,7 +324,7 @@ public class SlideShowView extends DrawableTileBase { final Media media = file.getMedia(); return new VideoPlayer(new MediaPlayer(media), file); } catch (MediaException | IOException | OutOfMemoryError ex) { - LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); + LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); //NON-NLS return doReadImageTask(file); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle.properties new file mode 100644 index 0000000000..895855c779 --- /dev/null +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle.properties @@ -0,0 +1,7 @@ +GroupComparators.groupName.txt=Group Name +GroupComparators.groupSize.txt=Group Size +GroupComparators.hitCount.txt=Hit Count +GroupComparators.hitDensity.txt=Hit Density +GroupComparators.uncategorizedCount.txt=Uncategorized Count +GroupTree.allGroups.txt=All Groups +HashHitGroupList.onlyHashHits.txt=Only Hash Hits \ No newline at end of file diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle_ja.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java index c7bce311c4..26c88c05b1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java @@ -21,6 +21,8 @@ package org.sleuthkit.autopsy.imagegallery.gui.navpanel; import com.google.common.collect.ImmutableList; import java.util.Comparator; import java.util.function.Function; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup; /** @@ -29,19 +31,19 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup; final class GroupComparators> implements Comparator { static final GroupComparators UNCATEGORIZED_COUNT = - new GroupComparators<>("Uncategorized Count", DrawableGroup::getUncategorizedCount, String::valueOf, false); + new GroupComparators<>(NbBundle.getMessage(GroupComparators.class, "GroupComparators.uncategorizedCount.txt"), DrawableGroup::getUncategorizedCount, String::valueOf, false); static final GroupComparators ALPHABETICAL = - new GroupComparators<>("Group Name", DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); + new GroupComparators<>(NbBundle.getMessage(GroupComparators.class, "GroupComparators.groupName.txt"), DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); static final GroupComparators HIT_COUNT = - new GroupComparators<>("Hit Count", DrawableGroup::getHashSetHitsCount, String::valueOf, true); + new GroupComparators<>(NbBundle.getMessage(GroupComparators.class, "GroupComparators.hitCount.txt"), DrawableGroup::getHashSetHitsCount, String::valueOf, true); static final GroupComparators FILE_COUNT = - new GroupComparators<>("Group Size", DrawableGroup::getSize, String::valueOf, true); + new GroupComparators<>(NbBundle.getMessage(GroupComparators.class, "GroupComparators.groupSize.txt"), DrawableGroup::getSize, String::valueOf, true); static final GroupComparators HIT_FILE_RATIO = - new GroupComparators<>("Hit Density", DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); + new GroupComparators<>(NbBundle.getMessage(GroupComparators.class, "GroupComparators.hitDensity.txt"), DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); // NON-NLS private final static ImmutableList> values = ImmutableList.of(UNCATEGORIZED_COUNT, ALPHABETICAL, HIT_COUNT, FILE_COUNT, HIT_FILE_RATIO); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java index 8a56db05b3..27798fb72d 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java @@ -42,7 +42,7 @@ class GroupListCell extends ListCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS /** * reference to group files listener that allows us to remove it from a @@ -72,8 +72,8 @@ class GroupListCell extends ListCell { GroupListCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -154,7 +154,7 @@ class GroupListCell extends ListCell { private String getSeenStyleClass() { return Optional.ofNullable(getItem()) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") + .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java index f2d6fc0e95..b4605e5605 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java @@ -32,6 +32,7 @@ import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; import javafx.scene.image.ImageView; import org.apache.commons.lang3.StringUtils; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -53,15 +54,15 @@ final public class GroupTree extends NavPanel> { public GroupTree(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); + FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS } @FXML @Override void initialize() { super.initialize(); - setText("All Groups"); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); + setText(NbBundle.getMessage(this.getClass(), "GroupTree.allGroups.txt")); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); //NON-NLS getBorderPane().setCenter(groupTree); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java index bf7425ec57..db63abd14f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java @@ -47,7 +47,7 @@ class GroupTreeCell extends TreeCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS /** * reference to group files listener that allows us to remove it from a @@ -75,8 +75,8 @@ class GroupTreeCell extends TreeCell { GroupTreeCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -159,7 +159,7 @@ class GroupTreeCell extends TreeCell { return Optional.ofNullable(getItem()) .map(GroupTreeNode::getGroup) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") + .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java index 1431e46cf7..7bcb74bb99 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java @@ -24,6 +24,7 @@ import javafx.fxml.FXML; import javafx.scene.control.ListView; import javafx.scene.control.SelectionModel; import javafx.scene.image.ImageView; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -47,7 +48,7 @@ final public class HashHitGroupList extends NavPanel { public HashHitGroupList(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); + FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS } @ThreadConfined(type = ThreadConfined.ThreadType.JFX) @@ -71,8 +72,8 @@ final public class HashHitGroupList extends NavPanel { void initialize() { super.initialize(); - setText("Only Hash Hits"); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); + setText(NbBundle.getMessage(this.getClass(), "HashHitGroupList.onlyHashHits.txt")); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); //NON-NLS getBorderPane().setCenter(groupList); sorted = getController().getGroupManager().getAnalyzedGroups().filtered((DrawableGroup t) -> t.getHashSetHitsCount() > 0).sorted(); From 4de213d6d051cf07ccffeb4dc90a8f020a01321b Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Thu, 28 Jan 2016 11:58:02 -0500 Subject: [PATCH 04/48] Extracted hard coded strings. --- .../sleuthkit/autopsy/imagegallery/actions/Bundle.properties | 2 ++ .../autopsy/imagegallery/actions/CategorizeAction.java | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties index f65149b66e..bcdd268818 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties @@ -20,3 +20,5 @@ OpenExternalViewerAction.displayName.text=External Viewer OpenExternalViewerAction.externalViewerButton.text=Open in External Viewer RedoAction.displayName.text=Redo UndoAction.displayName.text=Undo +CategorizeAction.caterror.displayTitle.txt=Categorizing Error +CategorizeAction.caterror.errMsg.txt=Unable to categorize {0}. diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java index d497af39e0..aa7b8e6374 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java @@ -173,7 +173,10 @@ public class CategorizeAction extends AddTagAction { } } catch (TskCoreException ex) { LOGGER.log(Level.SEVERE, "Error categorizing result", ex); //NON-NLS - JOptionPane.showMessageDialog(null, "Unable to categorize " + fileID + ".", "Categorizing Error", JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, + NbBundle.getMessage(this.getClass(), "CategorizeAction.caterror.errMsg.txt", fileID), + NbBundle.getMessage(this.getClass(), "CategorizeAction.caterror.displayTitle.txt"), + JOptionPane.ERROR_MESSAGE); } } From ae991f5c7afbcdc3011ae1ff74a5fbe0b2eacac4 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 28 Jan 2016 15:53:33 -0500 Subject: [PATCH 05/48] Tidy up autopsy.casemodule.NewCaseWizardAction --- .../casemodule/NewCaseWizardAction.java | 46 +++++++------------ .../netbeans/core/startup/Bundle.properties | 2 +- .../core/windows/view/ui/Bundle.properties | 2 +- 3 files changed, 18 insertions(+), 32 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 491f66ba5e..9b6c29a7c5 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2015 Basis Technology Corp. + * Copyright 2011-2016 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -37,70 +37,57 @@ import org.openide.util.actions.SystemAction; import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JOptionPane; import org.sleuthkit.autopsy.casemodule.Case.CaseType; -import org.sleuthkit.autopsy.core.UserPreferences; -import org.sleuthkit.datamodel.CaseDbConnectionInfo; import org.openide.windows.WindowManager; import java.awt.Cursor; import org.sleuthkit.autopsy.ingest.IngestManager; /** - * Action to open the New Case wizard. + * An action that runs the new case wizard. */ final class NewCaseWizardAction extends CallableSystemAction { private static final long serialVersionUID = 1L; - - private WizardDescriptor.Panel[] panels; - private static final Logger logger = Logger.getLogger(NewCaseWizardAction.class.getName()); + private WizardDescriptor.Panel[] panels; @Override public void performAction() { - - // if ingest is ongoing, warn and get confirmaion before opening a different case + /* + * If ingest is running, do a dialog to warn the user and confirm + * abandoning the ingest. + */ if (IngestManager.getInstance().isIngestRunning()) { - // show the confirmation first to close the current case and open the "New Case" wizard panel String closeCurrentCase = NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"); NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(closeCurrentCase, NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning.title"), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE); descriptor.setValue(NotifyDescriptor.NO_OPTION); - Object res = DialogDisplayer.getDefault().notify(descriptor); if (res != null && res == DialogDescriptor.YES_OPTION) { try { - Case.getCurrentCase().closeCase(); // close the current case + Case.getCurrentCase().closeCase(); } catch (Exception ex) { - Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS + Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case", ex); //NON-NLS } } else { return; } } - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - newCaseAction(); // start the new case creation process + newCaseAction(); } - /** - * The method to perform new case creation - */ private void newCaseAction() { final WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels()); - // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); wizardDescriptor.setTitle(NbBundle.getMessage(this.getClass(), "NewCaseWizardAction.newCase.windowTitle.text")); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.setVisible(true); dialog.toFront(); - if (wizardDescriptor.getValue() == WizardDescriptor.FINISH_OPTION) { new SwingWorker() { - @Override protected Void doInBackground() throws Exception { - // Create case. - String caseNumber = (String) wizardDescriptor.getProperty("caseNumber"); //NON-NLS String examiner = (String) wizardDescriptor.getProperty("caseExaminer"); //NON-NLS final String caseName = (String) wizardDescriptor.getProperty("caseName"); //NON-NLS @@ -112,11 +99,8 @@ final class NewCaseWizardAction extends CallableSystemAction { @Override protected void done() { - final String caseName = (String) wizardDescriptor.getProperty("caseName"); //NON-NLS try { get(); - CaseType currentCaseType = CaseType.values()[(int) wizardDescriptor.getProperty("caseType")]; //NON-NLS - CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo(); AddImageAction addImageAction = SystemAction.get(AddImageAction.class); addImageAction.actionPerformed(null); } catch (Exception ex) { @@ -126,7 +110,11 @@ final class NewCaseWizardAction extends CallableSystemAction { + NbBundle.getMessage(this.getClass(), "CaseExceptionWarning.CheckMultiUserOptions"), NbBundle.getMessage(this.getClass(), "CaseCreateAction.msgDlg.cantCreateCase.msg"), JOptionPane.ERROR_MESSAGE); //NON-NLS - + /** + * This is a bit of a hack, but close the startup + * window, if it was the source of the action + * invocation. + */ try { StartupWindowProvider.getInstance().close(); } catch (Exception unused) { @@ -148,7 +136,6 @@ final class NewCaseWizardAction extends CallableSystemAction { private void doFailedCaseCleanup(WizardDescriptor wizardDescriptor) { String createdDirectory = (String) wizardDescriptor.getProperty("createdDirectory"); //NON-NLS - if (createdDirectory != null) { logger.log(Level.INFO, "Deleting a created case directory due to an error, dir: {0}", createdDirectory); //NON-NLS Case.deleteCaseDirectory(new File(createdDirectory)); @@ -159,8 +146,7 @@ final class NewCaseWizardAction extends CallableSystemAction { } /** - * Initialize panels representing individual wizard's steps and sets various - * properties for them influencing wizard appearance. + * Initializes the new case wizard panels. */ @SuppressWarnings({"unchecked", "rawtypes"}) private WizardDescriptor.Panel[] getPanels() { diff --git a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties index f0d04d8afb..b7f65c5191 100644 --- a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties +++ b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -1,5 +1,5 @@ #Updated by build script -#Mon, 21 Dec 2015 06:26:49 -0500 +#Thu, 28 Jan 2016 15:43:18 -0500 LBL_splash_window_title=Starting Autopsy SPLASH_HEIGHT=314 SPLASH_WIDTH=538 diff --git a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties index 960ee135b3..ef07541dfb 100644 --- a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties +++ b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties @@ -1,4 +1,4 @@ #Updated by build script -#Mon, 21 Dec 2015 06:26:49 -0500 +#Thu, 28 Jan 2016 15:43:18 -0500 CTL_MainWindow_Title=Autopsy 4.0.0 CTL_MainWindow_Title_No_Project=Autopsy 4.0.0 From 330ed4b3f5fc913f63e205b7aa5881b51d5d0cdb Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 28 Jan 2016 16:17:42 -0500 Subject: [PATCH 06/48] Tidy up autopsy.casemodule.OpenRecentCasePanel --- .../autopsy/casemodule/Bundle.properties | 1 - .../autopsy/casemodule/Bundle_ja.properties | 1 - .../sleuthkit/autopsy/casemodule/Case.java | 14 +- .../casemodule/OpenRecentCasePanel.java | 284 +++++++++--------- 4 files changed, 151 insertions(+), 149 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index a6420390c7..2232085c5b 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -114,7 +114,6 @@ Case.open.msgDlg.updated.msg=Updated case database schema.\nA backup copy of the Case.open.msgDlg.updated.title=Case Database Schema Update Case.open.exception.checkFile.msg=Check that you selected the correct case file (usually with {0} extension) Case.open.exception.multiUserCaseNotEnabled=Cannot open a multi-user case if multi-user cases are not enabled. See Tools, Options, Multi-user. -Case.open.exception.gen.msg=Error opening the case Case.checkImgExist.confDlg.doesntExist.msg={0} has detected that one of the images associated with \n\ this case are missing. Would you like to search for them now?\n\ Previously, the image was located at\:\n\ diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties index 4fd28db906..6895817f35 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties @@ -109,7 +109,6 @@ Case.open.msgDlg.updated.msg=\u30b1\u30fc\u30b9\u30c7\u30fc\u30bf\u30d9\u30fc\u3 {0} Case.open.msgDlg.updated.title=\u30b1\u30fc\u30b9\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b9\u30ad\u30fc\u30de\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8 Case.open.exception.checkFile.msg=\u6b63\u3057\u3044\u30b1\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3057\u305f\u304b\u78ba\u8a8d\u3057\u3066\u4e0b\u3055\u3044\uff08\u901a\u5e38\u62e1\u5f35\u5b50{0}\u3092\u6301\u3064\uff09 -Case.open.exception.gen.msg=\u30b1\u30fc\u30b9\u3092\u958b\u304f\u306e\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f Case.checkImgExist.confDlg.doesntExist.msg={0} \u304c\u3053\u306e\u30b1\u30fc\u30b9\u306b\u95a2\u9023\u3059\u308b\u30a4\u30e1\u30fc\u30b8\u306e\uff11\u500b\u304c\u6b20\u843d\u3057\u3066\u3044\u308b\u306e\u3092\u691c\u51fa\u3057\u307e\u3057\u305f\u3002\u305d\u308c\u3089\u3092\u4eca\u304b\u3089\u691c\u7d22\u3057\u307e\u3059\u304b\uff1f\n\n\ \u4ee5\u524d\u3001\u30a4\u30e1\u30fc\u30b8\u306f\u4e0b\u8a18\u306b\u3042\u308a\u307e\u3057\u305f\uff1a\n\ {1}\n\ diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index a5e5ebb9bd..71906df653 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -632,22 +632,22 @@ public class Case implements SleuthkitCase.ErrorObserver { } catch (CaseMetadataException ex) { /** - * Clean-up the case if it was actually opened. TODO: Do this - * better. + * Attempt clean up. */ try { Case badCase = Case.getCurrentCase(); badCase.closeCase(); - } catch (IllegalStateException unused) { - // Already logged. + } catch (IllegalStateException ignored) { } - throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.gen.msg") + ": " + ex.getMessage(), ex); //NON-NLS + throw new CaseActionException(ex.getMessage(), ex); //NON-NLS } catch (TskCoreException ex) { + /** + * Attempt clean up. + */ try { Case badCase = Case.getCurrentCase(); badCase.closeCase(); - } catch (CaseActionException | IllegalStateException unused) { - // Already logged. + } catch (IllegalStateException ignored) { } SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java index 00b4b600c3..df588ab42e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2015 Basis Technology Corp. + * Copyright 2011-2016 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -35,12 +35,13 @@ import java.awt.Cursor; * Panel show from the splash dialog that shows recent cases and allows them to * be opened. */ -class OpenRecentCasePanel extends javax.swing.JPanel { +final class OpenRecentCasePanel extends javax.swing.JPanel { - static String[] caseNames; - static String[] casePaths; - private static final Logger logger = Logger.getLogger(OpenRecentCasePanel.class.getName()); + private static final long serialVersionUID = 1L; private static OpenRecentCasePanel instance; + private static String[] caseNames; + private static String[] casePaths; + private static final Logger logger = Logger.getLogger(OpenRecentCasePanel.class.getName()); private RecentCasesTableModel model; private OpenRecentCasePanel() { @@ -77,6 +78,144 @@ class OpenRecentCasePanel extends javax.swing.JPanel { return instance; } + // Open the selected case + private void openCase() { + if (casePaths.length < 1) { + logger.log(Level.INFO, "No Case paths exist, cannot open the case"); //NON-NLS + return; + } + final String casePath = casePaths[imagesTable.getSelectedRow()]; + final String caseName = caseNames[imagesTable.getSelectedRow()]; + if (!casePath.equals("")) { + // Close the startup menu + try { + StartupWindowProvider.getInstance().close(); + CueBannerPanel.closeOpenRecentCasesWindow(); + } catch (Exception ex) { + logger.log(Level.WARNING, "Error: couldn't open case: " + caseName, ex); //NON-NLS + } + // Open the recent cases + if (caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())) { + JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), + NbBundle.getMessage(this.getClass(), + "OpenRecentCasePanel.openCase.msgDlg.caseDoesntExist.msg", + caseName), + NbBundle.getMessage(this.getClass(), + "OpenRecentCasePanel.openCase.msgDlg.err"), + JOptionPane.ERROR_MESSAGE); + RecentCases.getInstance().removeRecentCase(caseName, casePath); // remove the recent case if it doesn't exist anymore + + //if case is not opened, open the start window + if (Case.isCaseOpen() == false) { + StartupWindowProvider.getInstance().open(); + } + + } else { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); + new Thread(() -> { + try { + Case.open(casePath); + } catch (CaseActionException ex) { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getMessage(), + NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); //NON-NLS + if (!Case.isCaseOpen()) { + StartupWindowProvider.getInstance().open(); + } + }); + } + }).start(); + } + } + } + + /** + * Sets the Close button action listener. + * + * @param e the action listener + */ + public void setCloseButtonActionListener(ActionListener e) { + this.cancelButton.addActionListener(e); + } + + /** + * Table model to keep track of recent cases. + */ + private class RecentCasesTableModel extends AbstractTableModel { + + private static final long serialVersionUID = 1L; + + @Override + public int getRowCount() { + int count = 0; + for (String s : caseNames) { + if (!s.equals("")) { + count++; + } + } + return count; + } + + @Override + public int getColumnCount() { + return 2; + } + + @Override + public String getColumnName(int column) { + String colName = null; + switch (column) { + case 0: + colName = NbBundle.getMessage(OpenRecentCasePanel.class, "OpenRecentCasePanel.colName.caseName"); + break; + case 1: + colName = NbBundle.getMessage(OpenRecentCasePanel.class, "OpenRecentCasePanel.colName.path"); + break; + default: + break; + } + return colName; + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + Object ret = null; + switch (columnIndex) { + case 0: + ret = caseNames[rowIndex]; + break; + case 1: + ret = shortenPath(casePaths[rowIndex]); + break; + default: + logger.log(Level.SEVERE, "Invalid table column index: {0}", columnIndex); //NON-NLS + break; + } + return ret; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + + @Override + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + } + + private String shortenPath(String path) { + String shortenedPath = path; + if (shortenedPath.length() > 50) { + shortenedPath = path.substring(0, 10 + path.substring(10).indexOf(File.separator) + 1) + "..." + + path.substring((path.length() - 20) + path.substring(path.length() - 20).indexOf(File.separator)); + } + return shortenedPath; + } + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -180,59 +319,6 @@ class OpenRecentCasePanel extends javax.swing.JPanel { } }//GEN-LAST:event_imagesTableKeyPressed - // Open the selected case - private void openCase() { - if (casePaths.length < 1) { - logger.log(Level.INFO, "No Case paths exist, cannot open the case"); //NON-NLS - return; - } - final String casePath = casePaths[imagesTable.getSelectedRow()]; - final String caseName = caseNames[imagesTable.getSelectedRow()]; - if (!casePath.equals("")) { - // Close the startup menu - try { - StartupWindowProvider.getInstance().close(); - CueBannerPanel.closeOpenRecentCasesWindow(); - } catch (Exception ex) { - logger.log(Level.WARNING, "Error: couldn't open case: " + caseName, ex); //NON-NLS - } - // Open the recent cases - if (caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())) { - JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), - NbBundle.getMessage(this.getClass(), - "OpenRecentCasePanel.openCase.msgDlg.caseDoesntExist.msg", - caseName), - NbBundle.getMessage(this.getClass(), - "OpenRecentCasePanel.openCase.msgDlg.err"), - JOptionPane.ERROR_MESSAGE); - RecentCases.getInstance().removeRecentCase(caseName, casePath); // remove the recent case if it doesn't exist anymore - - //if case is not opened, open the start window - if (Case.isCaseOpen() == false) { - StartupWindowProvider.getInstance().open(); - } - - } else { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - }); - new Thread(() -> { - try { - Case.open(casePath); - } catch (CaseActionException ex) { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getMessage(), - NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); //NON-NLS - if (!Case.isCaseOpen()) { - StartupWindowProvider.getInstance().open(); - } - }); - } - }).start(); - } - } - } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton cancelButton; private javax.swing.JTable imagesTable; @@ -241,86 +327,4 @@ class OpenRecentCasePanel extends javax.swing.JPanel { private javax.swing.JScrollPane tableScrollPane; // End of variables declaration//GEN-END:variables - /** - * Sets the Close button action listener. - * - * @param e the action listener - */ - public void setCloseButtonActionListener(ActionListener e) { - this.cancelButton.addActionListener(e); - } - - /** - * Table model to keep track of recent cases. - */ - private class RecentCasesTableModel extends AbstractTableModel { - - @Override - public int getRowCount() { - int count = 0; - for (String s : caseNames) { - if (!s.equals("")) { - count++; - } - } - return count; - } - - @Override - public int getColumnCount() { - return 2; - } - - @Override - public String getColumnName(int column) { - String colName = null; - - switch (column) { - case 0: - colName = NbBundle.getMessage(OpenRecentCasePanel.class, "OpenRecentCasePanel.colName.caseName"); - break; - case 1: - colName = NbBundle.getMessage(OpenRecentCasePanel.class, "OpenRecentCasePanel.colName.path"); - break; - default: - ; - - } - return colName; - } - - @Override - public Object getValueAt(int rowIndex, int columnIndex) { - Object ret = null; - switch (columnIndex) { - case 0: - ret = caseNames[rowIndex]; - break; - case 1: - ret = shortenPath(casePaths[rowIndex]); - break; - default: - logger.log(Level.SEVERE, "Invalid table column index: {0}", columnIndex); //NON-NLS - break; - } - return ret; - } - - @Override - public boolean isCellEditable(int rowIndex, int columnIndex) { - return false; - } - - @Override - public void setValueAt(Object aValue, int rowIndex, int columnIndex) { - } - - private String shortenPath(String path) { - if (path.length() > 50) { - path = path.substring(0, 10 + path.substring(10).indexOf(File.separator) + 1) + "..." - + path.substring((path.length() - 20) + path.substring(path.length() - 20).indexOf(File.separator)); - } - return path; - } - } } From 1d56106d6ef100c6f01844638ebaa026f4e7bdee Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 28 Jan 2016 16:58:01 -0500 Subject: [PATCH 07/48] Tidy up corecomponents.Installer --- .../sleuthkit/autopsy/casemodule/Case.java | 7 +--- .../autopsy/casemodule/CaseOpenAction.java | 9 +++-- .../autopsy/corecomponents/Installer.java | 37 ++++++++----------- 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 71906df653..fbf53a99fc 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -554,11 +554,7 @@ public class Case implements SleuthkitCase.ErrorObserver { * * @throws CaseActionException */ - /** - * TODO: Deprecate this and throw a more general exception. - */ public static void open(String caseMetadataFilePath) throws CaseActionException { - if (!caseMetadataFilePath.endsWith(CASE_DOT_EXTENSION)) { throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.checkFile.msg", CASE_DOT_EXTENSION)); } @@ -590,8 +586,7 @@ public class Case implements SleuthkitCase.ErrorObserver { db = SleuthkitCase.openCase(metadata.getCaseDatabaseName(), UserPreferences.getDatabaseConnectionInfo(), caseDir); } catch (UserPreferencesException ex) { logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS - throw new CaseActionException( - NbBundle.getMessage(Case.class, "Case.databaseConnectionInfo.error.msg"), ex); + throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.databaseConnectionInfo.error.msg"), ex); } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index 7c5a5ca9e0..5ea268adf4 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -45,6 +45,7 @@ import org.sleuthkit.autopsy.ingest.IngestManager; @ServiceProvider(service = CaseOpenAction.class) public final class CaseOpenAction implements ActionListener { + private static final Logger logger = Logger.getLogger(CaseOpenAction.class.getName()); private static final String PROP_BASECASE = "LBL_BaseCase_PATH"; //NON-NLS private final JFileChooser fileChooser = new JFileChooser(); private final FileFilter caseMetadataFileFilter; @@ -71,7 +72,6 @@ public final class CaseOpenAction implements ActionListener { */ @Override public void actionPerformed(ActionEvent e) { - /* * If ingest is running, do a dialog to warn the user and confirm * abandoning the ingest. @@ -87,7 +87,7 @@ public final class CaseOpenAction implements ActionListener { try { Case.getCurrentCase().closeCase(); } catch (Exception ex) { - Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case", ex); //NON-NLS + logger.log(Level.SEVERE, "Error closing case", ex); //NON-NLS } } else { return; @@ -121,10 +121,11 @@ public final class CaseOpenAction implements ActionListener { try { Case.open(path); } catch (CaseActionException ex) { + logger.log(Level.SEVERE, String.format("Could not open case at %s", path), ex); SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getMessage() + " " - + NbBundle.getMessage(this.getClass(), "CaseExceptionWarning.CheckMultiUserOptions"), + JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), + ex.getMessage(), NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); //NON-NLS if (!Case.isCaseOpen()) { StartupWindowProvider.getInstance().open(); diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java index c2e989635e..d6c641734e 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2015 Basis Technology Corp. + * Copyright 2011-2016 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,8 +43,9 @@ import org.sleuthkit.autopsy.coreutils.Logger; */ public class Installer extends ModuleInstall { - private static Installer instance; + private static final long serialVersionUID = 1L; private static final Logger logger = Logger.getLogger(Installer.class.getName()); + private static Installer instance; public synchronized static Installer getDefault() { if (instance == null) { @@ -61,13 +62,15 @@ public class Installer extends ModuleInstall { public void restored() { super.restored(); - setupLAF(); + setLookAndFeel(); UIManager.put("ViewTabDisplayerUI", "org.sleuthkit.autopsy.corecomponents.NoTabsTabDisplayerUI"); UIManager.put(DefaultTabbedContainerUI.KEY_VIEW_CONTENT_BORDER, BorderFactory.createEmptyBorder()); UIManager.put("TabbedPane.contentBorderInsets", new Insets(0, 0, 0, 0)); /* - * Open the passed in case, if an aut file was double clicked. + * Open the case if a case metadata file was double-clicked. This only + * works if the user has associated files with ".aut" extensions with + * Autopsy. */ WindowManager.getDefault().invokeWhenUIReady(() -> { Collection processors = Lookup.getDefault().lookupAll(OptionProcessor.class); @@ -77,11 +80,10 @@ public class Installer extends ModuleInstall { final String caseFile = argsProcessor.getDefaultArg(); if (caseFile != null && !caseFile.equals("") && caseFile.endsWith(".aut") && new File(caseFile).exists()) { //NON-NLS new Thread(() -> { - // Create case. try { Case.open(caseFile); } catch (Exception ex) { - logger.log(Level.SEVERE, "Error opening case: ", ex); //NON-NLS + logger.log(Level.SEVERE, "Error opening case", ex); //NON-NLS } }).start(); return; @@ -105,22 +107,16 @@ public class Installer extends ModuleInstall { if (Case.isCaseOpen()) { Case.getCurrentCase().closeCase(); } - } catch (CaseActionException | IllegalStateException unused) { + } catch (CaseActionException | IllegalStateException ignored) { // Exception already logged. Shutting down, no need to do popup. } }).start(); } - private void setupLAF() { - - //TODO apply custom skinning - //UIManager.put("nimbusBase", new Color()); - //UIManager.put("nimbusBlueGrey", new Color()); - //UIManager.put("control", new Color()); + private void setLookAndFeel() { if (System.getProperty("os.name").toLowerCase().contains("mac")) { //NON-NLS - setupMacOsXLAF(); + setOSXLookAndFeel(); } - } /** @@ -128,24 +124,21 @@ public class Installer extends ModuleInstall { * dependent elements that set the Menu Bar to be in the correct place on * Mac OS X. */ - private void setupMacOsXLAF() { + private void setOSXLookAndFeel() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { logger.log(Level.WARNING, "Unable to set theme. ", ex); //NON-NLS } - final String[] UI_MENU_ITEM_KEYS = new String[]{"MenuBarUI", //NON-NLS - }; - - Map uiEntries = new TreeMap<>(); - // Store the keys that deal with menu items + final String[] UI_MENU_ITEM_KEYS = new String[]{"MenuBarUI",}; //NON-NLS + Map uiEntries = new TreeMap<>(); for (String key : UI_MENU_ITEM_KEYS) { uiEntries.put(key, UIManager.get(key)); } - //use Metal if available + // Use Metal if available for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { //NON-NLS try { From 23a6618bb2c4e7cac061c80cd14304487b2383b2 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 28 Jan 2016 17:00:44 -0500 Subject: [PATCH 08/48] Fix logging in corecomponents.Installer --- Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java index d6c641734e..ce1fceda24 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java @@ -107,8 +107,8 @@ public class Installer extends ModuleInstall { if (Case.isCaseOpen()) { Case.getCurrentCase().closeCase(); } - } catch (CaseActionException | IllegalStateException ignored) { - // Exception already logged. Shutting down, no need to do popup. + } catch (CaseActionException | IllegalStateException ex) { + logger.log(Level.SEVERE, "Error closing case", ex); //NON-NLS } }).start(); } From 7b0da9a29bec8c631277c60230b5fde5a15a1fd2 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Thu, 28 Jan 2016 19:42:35 -0500 Subject: [PATCH 09/48] Extracted hard coded strings. Commented strings with NON-NLS. --- .../src/org/sleuthkit/autopsy/core/Bundle.properties | 7 ++++++- Core/src/org/sleuthkit/autopsy/core/Installer.java | 4 ++-- .../org/sleuthkit/autopsy/core/ServicesMonitor.java | 12 ++++++------ .../org/sleuthkit/autopsy/core/UserPreferences.java | 12 ++++++------ 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/core/Bundle.properties b/Core/src/org/sleuthkit/autopsy/core/Bundle.properties index 913f6d8c82..8ba6b8f14e 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/core/Bundle.properties @@ -23,4 +23,9 @@ ServicesMonitor.unknownServiceName.excepton.txt=Requested service name {0} is un TextConverter.convert.exception.txt=Unable to convert text {0} to hex text TextConverter.convertFromHex.exception.txt=Unable to convert hex text to text ServicesMonitor.KeywordSearchNull=Cannot find Keyword Search service -ServicesMonitor.InvalidPortNumber=Invalid port number. \ No newline at end of file +ServicesMonitor.InvalidPortNumber=Invalid port number. +ServicesMonitor.remoteCaseDatabase.displayName.text=Multi-user case database service +ServicesMonitor.remoteKeywordSearch.displayName.text=Multi-user keyword search service +ServicesMonitor.messaging.displayName.text=Messaging service +ServicesMonitor.databaseConnectionInfo.error.msg=Error accessing case database connection info +ServicesMonitor.messagingService.connErr.text=Error accessing messaging service connection info \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/core/Installer.java b/Core/src/org/sleuthkit/autopsy/core/Installer.java index 2c5493d38d..8809bb549f 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/core/Installer.java @@ -123,9 +123,9 @@ public class Installer extends ModuleInstall { } // This library name is different in 32-bit versus 64-bit - String libintlName = "libintl-8"; + String libintlName = "libintl-8"; //NON-NLS if (PlatformUtil.is64BitJVM() == false) { - libintlName = "intl"; + libintlName = "intl"; //NON-NLS } try { System.loadLibrary(libintlName); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/core/ServicesMonitor.java b/Core/src/org/sleuthkit/autopsy/core/ServicesMonitor.java index 4c1fb92989..70857146d4 100644 --- a/Core/src/org/sleuthkit/autopsy/core/ServicesMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/core/ServicesMonitor.java @@ -52,7 +52,7 @@ public class ServicesMonitor { private static final Logger logger = Logger.getLogger(ServicesMonitor.class.getName()); private final ScheduledThreadPoolExecutor periodicTasksExecutor; - private static final String PERIODIC_TASK_THREAD_NAME = "services-monitor-periodic-task-%d"; + private static final String PERIODIC_TASK_THREAD_NAME = "services-monitor-periodic-task-%d"; //NON-NLS private static final int NUMBER_OF_PERIODIC_TASK_THREADS = 1; private static final long CRASH_DETECTION_INTERVAL_MINUTES = 2; @@ -84,18 +84,18 @@ public class ServicesMonitor { * changes. New value is set to updated ServiceStatus, old value is * null. */ - REMOTE_CASE_DATABASE("Multi-user case database service"), + REMOTE_CASE_DATABASE(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.remoteCaseDatabase.displayName.text")), /** * Property change event fired when remote keyword search service status * changes. New value is set to updated ServiceStatus, old value is * null. */ - REMOTE_KEYWORD_SEARCH("Multi-user keyword search service"), + REMOTE_KEYWORD_SEARCH(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.remoteKeywordSearch.displayName.text")), /** * Property change event fired when messaging service status changes. * New value is set to updated ServiceStatus, old value is null. */ - MESSAGING("Messaging service"); + MESSAGING(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.messaging.displayName.text")); private final String displayName; @@ -244,7 +244,7 @@ public class ServicesMonitor { info = UserPreferences.getDatabaseConnectionInfo(); } catch (UserPreferencesException ex) { logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS - setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.DOWN.toString(), "Error accessing case database connection info"); + setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.DOWN.toString(), NbBundle.getMessage(this.getClass(), "ServicesMonitor.databaseConnectionInfo.error.msg")); return; } try { @@ -289,7 +289,7 @@ public class ServicesMonitor { info = UserPreferences.getMessageServiceConnectionInfo(); } catch (UserPreferencesException ex) { logger.log(Level.SEVERE, "Error accessing messaging service connection info", ex); //NON-NLS - setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.DOWN.toString(), "Error accessing messaging service connection info"); + setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.DOWN.toString(), NbBundle.getMessage(this.getClass(), "ServicesMonitor.messagingService.connErr.text")); return; } diff --git a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java index 03c97a0479..0cfaddf97b 100755 --- a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java +++ b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java @@ -147,7 +147,7 @@ public final class UserPreferences { public static CaseDbConnectionInfo getDatabaseConnectionInfo() throws UserPreferencesException { DbType dbType; try { - dbType = DbType.valueOf(preferences.get(EXTERNAL_DATABASE_TYPE, "POSTGRESQL")); + dbType = DbType.valueOf(preferences.get(EXTERNAL_DATABASE_TYPE, "POSTGRESQL")); //NON-NLS } catch (Exception ex) { dbType = DbType.SQLITE; } @@ -290,7 +290,7 @@ public final class UserPreferences { */ static final class TextConverter { - private static final char[] TMP = "hgleri21auty84fwe".toCharArray(); + private static final char[] TMP = "hgleri21auty84fwe".toCharArray(); //NON-NLS private static final byte[] SALT = { (byte) 0xde, (byte) 0x33, (byte) 0x10, (byte) 0x12, (byte) 0xde, (byte) 0x33, (byte) 0x10, (byte) 0x12,}; @@ -306,9 +306,9 @@ public final class UserPreferences { */ static String convertTextToHexText(String property) throws UserPreferencesException { try { - SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES"); + SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES"); //NON-NLS SecretKey key = keyFactory.generateSecret(new PBEKeySpec(TMP)); - Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES"); + Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES"); //NON-NLS pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec(SALT, 20)); return base64Encode(pbeCipher.doFinal(property.getBytes("UTF-8"))); } catch (Exception ex) { @@ -332,9 +332,9 @@ public final class UserPreferences { */ static String convertHexTextToText(String property) throws UserPreferencesException { try { - SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES"); + SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES"); //NON-NLS SecretKey key = keyFactory.generateSecret(new PBEKeySpec(TMP)); - Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES"); + Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES"); //NON-NLS pbeCipher.init(Cipher.DECRYPT_MODE, key, new PBEParameterSpec(SALT, 20)); return new String(pbeCipher.doFinal(base64Decode(property)), "UTF-8"); } catch (Exception ex) { From bedbbc16a1a005d8f1ddfa128d89c2f6bfa62417 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Thu, 28 Jan 2016 20:12:50 -0500 Subject: [PATCH 10/48] Extracted hard coded strings. Commented strings with NON-NLS. --- .../autopsy/coreutils/Bundle.properties | 5 +- .../sleuthkit/autopsy/coreutils/FileUtil.java | 2 +- .../autopsy/coreutils/ImageUtils.java | 96 +++++++++---------- .../autopsy/coreutils/NetworkUtils.java | 4 +- .../autopsy/coreutils/PlatformUtil.java | 8 +- .../autopsy/coreutils/UNCPathUtilities.java | 2 +- .../autopsy/coreutils/VideoUtils.java | 31 +++--- 7 files changed, 76 insertions(+), 72 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/Bundle.properties b/Core/src/org/sleuthkit/autopsy/coreutils/Bundle.properties index d63b55a2cc..2202e10ecb 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/coreutils/Bundle.properties @@ -21,4 +21,7 @@ PlatformUtil.getAllMemUsageInfo.usageText={0}\n\ {1}\n\ Process Virtual Memory\: {2} StringExtract.illegalStateException.cannotInit.msg=Unicode table not properly initialized, cannot instantiate StringExtract - +ImageUtils.GetOrGenerateThumbnailTask.loadingThumbnailFor=Loading thumbnail for {0} +ImageUtils.GetOrGenerateThumbnailTask.generatingPreviewFor=Generating preview for {0} +ImageUtils.ReadImageTask.mesage.text=Reading image: {0} +VideoUtils.genVideoThumb.progress.text=extracting temporary file {0} diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java index b1d1c33c51..91e12a32ba 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java @@ -31,7 +31,7 @@ import java.nio.file.Path; public class FileUtil { private static final Logger logger = Logger.getLogger(FileUtil.class.getName()); - private static String TEMP_FILE_PREFIX = "Autopsy"; + private static String TEMP_FILE_PREFIX = "Autopsy"; //NON-NLS /** * Recursively delete all of the files and sub-directories in a directory. diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java index 04df8cf403..be29d789c9 100755 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java @@ -67,16 +67,16 @@ import org.sleuthkit.datamodel.ReadContentInputStream; import org.sleuthkit.datamodel.TskCoreException; /** - * Utilities for working with image files and creating thumbnails. Reuses + * Utilities for working with image files and creating thumbnails. Re-uses * thumbnails by storing them in the case's cache directory. */ public class ImageUtils { private static final Logger LOGGER = Logger.getLogger(ImageUtils.class.getName()); - private static final String COULD_NOT_WRITE_CACHE_THUMBNAIL = "Could not write cache thumbnail: "; //NOI18N - private static final String COULD_NOT_CREATE_IMAGE_INPUT_STREAM = "Could not create ImageInputStream."; //NOI18N - private static final String NO_IMAGE_READER_FOUND_FOR_ = "No ImageReader found for "; //NOI18N + private static final String COULD_NOT_WRITE_CACHE_THUMBNAIL = "Could not write cache thumbnail: "; //NOI18N NON-NLS + private static final String COULD_NOT_CREATE_IMAGE_INPUT_STREAM = "Could not create ImageInputStream."; //NOI18N NON-NLS + private static final String NO_IMAGE_READER_FOUND_FOR_ = "No ImageReader found for "; //NOI18N NON-NLS /** * save thumbnails to disk as this format @@ -89,12 +89,12 @@ public class ImageUtils { private static final BufferedImage DEFAULT_THUMBNAIL; - private static final String IMAGE_GIF_MIME = "image/gif"; //NOI18N + private static final String IMAGE_GIF_MIME = "image/gif"; //NOI18N NON-NLS private static final SortedSet GIF_MIME_SET = ImmutableSortedSet.copyOf(new String[]{IMAGE_GIF_MIME}); private static final List SUPPORTED_IMAGE_EXTENSIONS; private static final SortedSet SUPPORTED_IMAGE_MIME_TYPES; - private static final List CONDITIONAL_MIME_TYPES = Arrays.asList("audio/x-aiff", "application/octet-stream"); //NOI18N + private static final List CONDITIONAL_MIME_TYPES = Arrays.asList("audio/x-aiff", "application/octet-stream"); //NOI18N NON-NLS private static final boolean openCVLoaded; @@ -104,7 +104,7 @@ public class ImageUtils { try { tempImage = ImageIO.read(ImageUtils.class.getResourceAsStream("/org/sleuthkit/autopsy/images/file-icon.png"));//NON-NLS //NOI18N } catch (IOException ex) { - LOGGER.log(Level.SEVERE, "Failed to load default icon.", ex); //NOI18N + LOGGER.log(Level.SEVERE, "Failed to load default icon.", ex); //NOI18N NON-NLS tempImage = null; } DEFAULT_THUMBNAIL = tempImage; @@ -113,16 +113,16 @@ public class ImageUtils { boolean openCVLoadedTemp; try { System.loadLibrary(Core.NATIVE_LIBRARY_NAME); - if (System.getProperty("os.arch").equals("amd64") || System.getProperty("os.arch").equals("x86_64")) { //NOI18N - System.loadLibrary("opencv_ffmpeg248_64"); //NOI18N + if (System.getProperty("os.arch").equals("amd64") || System.getProperty("os.arch").equals("x86_64")) { //NOI18N NON-NLS + System.loadLibrary("opencv_ffmpeg248_64"); //NOI18N NON-NLS } else { - System.loadLibrary("opencv_ffmpeg248"); //NOI18N + System.loadLibrary("opencv_ffmpeg248"); //NOI18N NON-NLS } openCVLoadedTemp = true; } catch (UnsatisfiedLinkError e) { openCVLoadedTemp = false; - LOGGER.log(Level.SEVERE, "OpenCV Native code library failed to load", e); //NOI18N + LOGGER.log(Level.SEVERE, "OpenCV Native code library failed to load", e); //NOI18N NON-NLS //TODO: show warning bubble } @@ -136,12 +136,12 @@ public class ImageUtils { * with ImageIO automatically */ SUPPORTED_IMAGE_MIME_TYPES.addAll(Arrays.asList( - "image/x-rgb", - "image/x-ms-bmp", - "image/x-portable-graymap", - "image/x-portable-bitmap", - "application/x-123")); //TODO: is this correct? -jm //NOI18N - SUPPORTED_IMAGE_MIME_TYPES.removeIf("application/octet-stream"::equals); //NOI18N + "image/x-rgb", //NON-NLS + "image/x-ms-bmp", //NON-NLS + "image/x-portable-graymap", //NON-NLS + "image/x-portable-bitmap", //NON-NLS + "application/x-123")); //TODO: is this correct? -jm //NOI18N NON-NLS + SUPPORTED_IMAGE_MIME_TYPES.removeIf("application/octet-stream"::equals); //NOI18N NON-NLS } /** @@ -154,7 +154,7 @@ public class ImageUtils { */ private static final Executor imageSaver = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder() - .namingPattern("icon saver-%d").build()); //NOI18N + .namingPattern("icon saver-%d").build()); //NOI18N NON-NLS public static List getSupportedImageExtensions() { return Collections.unmodifiableList(SUPPORTED_IMAGE_EXTENSIONS); @@ -240,22 +240,22 @@ public class ImageUtils { return IMAGE_GIF_MIME.equalsIgnoreCase(fileType); } } catch (FileTypeDetectorInitException ex) { - LOGGER.log(Level.WARNING, "Failed to initialize FileTypeDetector.", ex); //NOI18N + LOGGER.log(Level.WARNING, "Failed to initialize FileTypeDetector.", ex); //NOI18N NON-NLS } catch (TskCoreException ex) { - if (ex.getMessage().contains("An SQLException was provoked by the following failure: java.lang.InterruptedException")) { - LOGGER.log(Level.WARNING, "Mime type look up with FileTypeDetector was interupted."); //NOI18N} + if (ex.getMessage().contains("An SQLException was provoked by the following failure: java.lang.InterruptedException")) { //NON-NLS + LOGGER.log(Level.WARNING, "Mime type look up with FileTypeDetector was interupted."); //NOI18N} NON-NLS return "gif".equalsIgnoreCase(file.getNameExtension()); //NOI18N } else { - LOGGER.log(Level.SEVERE, "Failed to get mime type of " + getContentPathSafe(file) + " with FileTypeDetector.", ex); //NOI18N} + LOGGER.log(Level.SEVERE, "Failed to get mime type of " + getContentPathSafe(file) + " with FileTypeDetector.", ex); //NOI18N} NON-NLS } } - LOGGER.log(Level.WARNING, "Falling back on direct mime type check for {0}.", getContentPathSafe(file)); //NOI18N + LOGGER.log(Level.WARNING, "Falling back on direct mime type check for {0}.", getContentPathSafe(file)); //NOI18N NON-NLS switch (file.isMimeType(GIF_MIME_SET)) { case TRUE: return true; case UNDEFINED: - LOGGER.log(Level.WARNING, "Falling back on extension check."); //NOI18N + LOGGER.log(Level.WARNING, "Falling back on extension check."); //NOI18N NON-NLS return "gif".equalsIgnoreCase(file.getNameExtension()); //NOI18N case FALSE: default: @@ -294,8 +294,8 @@ public class ImageUtils { || (conditionalMimes.contains(mimeType.toLowerCase()) && supportedExtension.contains(extension)); } } catch (FileTypeDetector.FileTypeDetectorInitException | TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to look up mimetype for {0} using FileTypeDetector:{1}", new Object[]{getContentPathSafe(file), ex.toString()}); //NOI18N - LOGGER.log(Level.INFO, "Falling back on AbstractFile.isMimeType"); //NOI18N + LOGGER.log(Level.WARNING, "Failed to look up mimetype for {0} using FileTypeDetector:{1}", new Object[]{getContentPathSafe(file), ex.toString()}); //NOI18N NON-NLS + LOGGER.log(Level.INFO, "Falling back on AbstractFile.isMimeType"); //NOI18N NON-NLS AbstractFile.MimeMatchEnum mimeMatch = file.isMimeType(supportedMimeTypes); if (mimeMatch == AbstractFile.MimeMatchEnum.TRUE) { return true; @@ -360,7 +360,7 @@ public class ImageUtils { try { return SwingFXUtils.fromFXImage(thumbnailTask.get(), null); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.WARNING, "Failed to get thumbnail for {0}: " + ex.toString(), getContentPathSafe(content)); + LOGGER.log(Level.WARNING, "Failed to get thumbnail for {0}: " + ex.toString(), getContentPathSafe(content)); //NON-NLS return DEFAULT_THUMBNAIL; } } else { @@ -435,9 +435,9 @@ public class ImageUtils { private static File getCachedThumbnailLocation(long fileID) { try { String cacheDirectory = Case.getCurrentCase().getCacheDirectory(); - return Paths.get(cacheDirectory, "thumbnails", fileID + ".png").toFile(); //NOI18N + return Paths.get(cacheDirectory, "thumbnails", fileID + ".png").toFile(); //NOI18N NON-NLS } catch (IllegalStateException e) { - LOGGER.log(Level.WARNING, "Could not get cached thumbnail location. No case is open."); + LOGGER.log(Level.WARNING, "Could not get cached thumbnail location. No case is open."); //NON-NLS return null; } @@ -532,7 +532,7 @@ public class ImageUtils { */ static public int getImageWidth(AbstractFile file) throws IOException { return getImageProperty(file, - "ImageIO could not determine width of {0}: ", //NOI18N + "ImageIO could not determine width of {0}: ", //NOI18N NON-NLS imageReader -> imageReader.getWidth(0) ); } @@ -549,7 +549,7 @@ public class ImageUtils { */ static public int getImageHeight(AbstractFile file) throws IOException { return getImageProperty(file, - "ImageIO could not determine height of {0}: ", //NOI18N + "ImageIO could not determine height of {0}: ", //NOI18N NON-NLS imageReader -> imageReader.getHeight(0) ); } @@ -646,18 +646,18 @@ public class ImageUtils { */ static private class GetThumbnailTask extends ReadImageTaskBase { - private static final String FAILED_TO_READ_IMAGE_FOR_THUMBNAIL_GENERATION = "Failed to read image for thumbnail generation."; //NOI18N + private static final String FAILED_TO_READ_IMAGE_FOR_THUMBNAIL_GENERATION = "Failed to read image for thumbnail generation."; //NOI18N NON-NLS private final int iconSize; private final File cacheFile; private final boolean defaultOnFailure; - @NbBundle.Messages({"# {0} - file name", - "GetOrGenerateThumbnailTask.loadingThumbnailFor=Loading thumbnail for {0}", "# {0} - file name", - "GetOrGenerateThumbnailTask.generatingPreviewFor=Generating preview for {0}"}) +// @NbBundle.Messages({"# {0} - file name", +// "GetOrGenerateThumbnailTask.loadingThumbnailFor=Loading thumbnail for {0}", "# {0} - file name", +// "GetOrGenerateThumbnailTask.generatingPreviewFor=Generating preview for {0}"}) private GetThumbnailTask(AbstractFile file, int iconSize, boolean defaultOnFailure) { super(file); - updateMessage(Bundle.GetOrGenerateThumbnailTask_loadingThumbnailFor(file.getName())); + updateMessage(NbBundle.getMessage(this.getClass(), "ImageUtils.GetOrGenerateThumbnailTask.loadingThumbnailFor", file.getName())); this.iconSize = iconSize; this.defaultOnFailure = defaultOnFailure; this.cacheFile = getCachedThumbnailLocation(file.getId()); @@ -679,7 +679,7 @@ public class ImageUtils { return SwingFXUtils.toFXImage(cachedThumbnail, null); } } catch (IOException ex) { - LOGGER.log(Level.WARNING, "ImageIO had a problem reading thumbnail for image {0}: " + ex.toString(), ImageUtils.getContentPathSafe(file)); //NOI18N + LOGGER.log(Level.WARNING, "ImageIO had a problem reading thumbnail for image {0}: " + ex.toString(), ImageUtils.getContentPathSafe(file)); //NOI18N NON-NLS } } @@ -691,7 +691,7 @@ public class ImageUtils { if (VideoUtils.isVideoThumbnailSupported(file)) { if (openCVLoaded) { - updateMessage(Bundle.GetOrGenerateThumbnailTask_generatingPreviewFor(file.getName())); + updateMessage(NbBundle.getMessage(this.getClass(), "ImageUtils.GetOrGenerateThumbnailTask.generatingPreviewFor", file.getName())); thumbnail = VideoUtils.generateVideoThumbnail(file, iconSize); } if (null == thumbnail) { @@ -716,7 +716,7 @@ public class ImageUtils { thumbnail = ScalrWrapper.resizeFast(bufferedImage, iconSize); } catch (IllegalArgumentException | OutOfMemoryError e) { // if resizing does not work due to extreme aspect ratio or oom, crop the image instead. - LOGGER.log(Level.WARNING, "Could not scale image {0}: " + e.toString() + ". Attemptying to crop {0} instead", ImageUtils.getContentPathSafe(file)); //NOI18N + LOGGER.log(Level.WARNING, "Could not scale image {0}: " + e.toString() + ". Attemptying to crop {0} instead", ImageUtils.getContentPathSafe(file)); //NOI18N NON-NLS final int height = bufferedImage.getHeight(); final int width = bufferedImage.getWidth(); @@ -727,12 +727,12 @@ public class ImageUtils { try { thumbnail = ScalrWrapper.cropImage(bufferedImage, cropWidth, cropHeight); } catch (Exception cropException) { - LOGGER.log(Level.WARNING, "Could not crop image {0}: " + cropException.toString(), ImageUtils.getContentPathSafe(file)); //NOI18N + LOGGER.log(Level.WARNING, "Could not crop image {0}: " + cropException.toString(), ImageUtils.getContentPathSafe(file)); //NOI18N NON-NLS throw cropException; } } } catch (Exception e) { - LOGGER.log(Level.WARNING, "Could not scale image {0}: " + e.toString(), ImageUtils.getContentPathSafe(file)); //NOI18N + LOGGER.log(Level.WARNING, "Could not scale image {0}: " + e.toString(), ImageUtils.getContentPathSafe(file)); //NOI18N NON-NLS throw e; } } @@ -765,7 +765,7 @@ public class ImageUtils { } ImageIO.write(thumbnail, FORMAT, cacheFile); } catch (IllegalArgumentException | IOException ex) { - LOGGER.log(Level.WARNING, "Could not write thumbnail for {0}: " + ex.toString(), ImageUtils.getContentPathSafe(file)); //NOI18N + LOGGER.log(Level.WARNING, "Could not write thumbnail for {0}: " + ex.toString(), ImageUtils.getContentPathSafe(file)); //NOI18N NON-NLS } }); } @@ -794,13 +794,13 @@ public class ImageUtils { ReadImageTask(AbstractFile file) { super(file); - updateMessage(Bundle.LoadImageTask_mesageText(file.getName())); + updateMessage(NbBundle.getMessage(this.getClass(), "ImageUtils.ReadImageTask.mesage.text", file.getName())); } +// @NbBundle.Messages({ +// "# {0} - file name", +// "LoadImageTask.mesageText=Reading image: {0}"}) @Override - @NbBundle.Messages({ - "# {0} - file name", - "LoadImageTask.mesageText=Reading image: {0}"}) protected javafx.scene.image.Image call() throws Exception { return readImage(); } @@ -811,7 +811,7 @@ public class ImageUtils { */ static private abstract class ReadImageTaskBase extends Task implements IIOReadProgressListener { - private static final String IMAGE_UTILS_COULD_NOT_READ_UNSUPPORTE_OR_CORRUPT = "ImageUtils could not read {0}. It may be unsupported or corrupt"; //NOI18N + private static final String IMAGE_UTILS_COULD_NOT_READ_UNSUPPORTE_OR_CORRUPT = "ImageUtils could not read {0}. It may be unsupported or corrupt"; //NOI18N NON-NLS final AbstractFile file; private ImageReader reader; @@ -955,7 +955,7 @@ public class ImageUtils { return content.getUniquePath(); } catch (TskCoreException tskCoreException) { String contentName = content.getName(); - LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N + LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N NON-NLS return contentName; } } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/NetworkUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/NetworkUtils.java index 5564fa3f59..af41bc1980 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/NetworkUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/NetworkUtils.java @@ -34,10 +34,10 @@ public class NetworkUtils { } catch (UnknownHostException ex) { // getLocalHost().getHostName() can fail in some situations. // Use environment variable if so. - hostName = System.getenv("COMPUTERNAME"); + hostName = System.getenv("COMPUTERNAME"); //NON-NLS } if (hostName == null || hostName.isEmpty()) { - hostName = System.getenv("COMPUTERNAME"); + hostName = System.getenv("COMPUTERNAME"); //NON-NLS } return hostName; } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java index 1736e08e82..b715d8ce35 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java @@ -50,7 +50,7 @@ import org.sleuthkit.datamodel.TskCoreException; */ public class PlatformUtil { - private static final String PYTHON_MODULES_SUBDIRECTORY = "python_modules"; + private static final String PYTHON_MODULES_SUBDIRECTORY = "python_modules"; //NON-NLS private static String javaPath = null; public static final String OS_NAME_UNKNOWN = NbBundle.getMessage(PlatformUtil.class, "PlatformUtil.nameUnknown"); public static final String OS_VERSION_UNKNOWN = NbBundle.getMessage(PlatformUtil.class, "PlatformUtil.verUnknown"); @@ -80,13 +80,13 @@ public class PlatformUtil { File coreFolder = InstalledFileLocator.getDefault().locate("core", PlatformUtil.class.getPackage().getName(), false); //NON-NLS File rootPath = coreFolder.getParentFile(); - String modulesPath = rootPath.getAbsolutePath() + File.separator + "modules"; + String modulesPath = rootPath.getAbsolutePath() + File.separator + "modules"; //NON-NLS File modulesPathF = new File(modulesPath); if (modulesPathF.exists() && modulesPathF.isDirectory()) { return modulesPath; } else { rootPath = rootPath.getParentFile(); - modulesPath = rootPath.getAbsolutePath() + File.separator + "modules"; + modulesPath = rootPath.getAbsolutePath() + File.separator + "modules"; //NON-NLS modulesPathF = new File(modulesPath); if (modulesPathF.exists() && modulesPathF.isDirectory()) { return modulesPath; @@ -104,7 +104,7 @@ public class PlatformUtil { * not found */ public static String getUserModulesPath() { - return getUserDirectory().getAbsolutePath() + File.separator + "modules"; + return getUserDirectory().getAbsolutePath() + File.separator + "modules"; //NON-NLS } /** diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/UNCPathUtilities.java b/Core/src/org/sleuthkit/autopsy/coreutils/UNCPathUtilities.java index ba353f8401..103a94013c 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/UNCPathUtilities.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/UNCPathUtilities.java @@ -36,7 +36,7 @@ public class UNCPathUtilities { private static Map drives; private static final String MAPPED_DRIVES = "_mapped_drives.txt"; //NON-NLS - private static final String TEMP_FOLDER = "TEMP"; + private static final String TEMP_FOLDER = "TEMP"; //NON-NLS private static final String DATA_TRIGGER = "----------"; //NON-NLS private static final String OK_TXT = "OK"; //NON-NLS private static final String COLON = ":"; //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java index eeedf64915..dc06b75019 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java @@ -32,6 +32,7 @@ import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.opencv.core.Mat; import org.opencv.highgui.VideoCapture; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.corelibs.ScalrWrapper; import static org.sleuthkit.autopsy.coreutils.ImageUtils.isMediaThumbnailSupported; @@ -44,24 +45,24 @@ import org.sleuthkit.datamodel.AbstractFile; public class VideoUtils { private static final List SUPPORTED_VIDEO_EXTENSIONS = - Arrays.asList("mov", "m4v", "flv", "mp4", "3gp", "avi", "mpg", - "mpeg", "asf", "divx", "rm", "moov", "wmv", "vob", "dat", - "m1v", "m2v", "m4v", "mkv", "mpe", "yop", "vqa", "xmv", - "mve", "wtv", "webm", "vivo", "vc1", "seq", "thp", "san", - "mjpg", "smk", "vmd", "sol", "cpk", "sdp", "sbg", "rtsp", - "rpl", "rl2", "r3d", "mlp", "mjpeg", "hevc", "h265", "265", - "h264", "h263", "h261", "drc", "avs", "pva", "pmp", "ogg", - "nut", "nuv", "nsv", "mxf", "mtv", "mvi", "mxg", "lxf", - "lvf", "ivf", "mve", "cin", "hnm", "gxf", "fli", "flc", - "flx", "ffm", "wve", "uv2", "dxa", "dv", "cdxl", "cdg", - "bfi", "jv", "bik", "vid", "vb", "son", "avs", "paf", "mm", + Arrays.asList("mov", "m4v", "flv", "mp4", "3gp", "avi", "mpg", //NON-NLS + "mpeg", "asf", "divx", "rm", "moov", "wmv", "vob", "dat", //NON-NLS + "m1v", "m2v", "m4v", "mkv", "mpe", "yop", "vqa", "xmv", //NON-NLS + "mve", "wtv", "webm", "vivo", "vc1", "seq", "thp", "san", //NON-NLS + "mjpg", "smk", "vmd", "sol", "cpk", "sdp", "sbg", "rtsp", //NON-NLS + "rpl", "rl2", "r3d", "mlp", "mjpeg", "hevc", "h265", "265", //NON-NLS + "h264", "h263", "h261", "drc", "avs", "pva", "pmp", "ogg", //NON-NLS + "nut", "nuv", "nsv", "mxf", "mtv", "mvi", "mxg", "lxf", //NON-NLS + "lvf", "ivf", "mve", "cin", "hnm", "gxf", "fli", "flc", //NON-NLS + "flx", "ffm", "wve", "uv2", "dxa", "dv", "cdxl", "cdg", //NON-NLS + "bfi", "jv", "bik", "vid", "vb", "son", "avs", "paf", "mm", //NON-NLS "flm", "tmv", "4xm"); //NON-NLS private static final SortedSet SUPPORTED_VIDEO_MIME_TYPES = new TreeSet<>( - Arrays.asList("application/x-shockwave-flash", "video/x-m4v", "video/x-flv", "video/quicktime", "video/avi", "video/msvideo", "video/x-msvideo", + Arrays.asList("application/x-shockwave-flash", "video/x-m4v", "video/x-flv", "video/quicktime", "video/avi", "video/msvideo", "video/x-msvideo", //NON-NLS "video/mp4", "video/x-ms-wmv", "video/mpeg", "video/asf")); //NON-NLS - private static final List CONDITIONAL_MIME_TYPES = Arrays.asList("application/octet-stream"); + private static final List CONDITIONAL_MIME_TYPES = Arrays.asList("application/octet-stream"); //NON-NLS public static List getSupportedVideoExtensions() { return SUPPORTED_VIDEO_EXTENSIONS; @@ -83,7 +84,7 @@ public class VideoUtils { } public static File getTempVideoFile(AbstractFile file) { - return Paths.get(Case.getCurrentCase().getTempDirectory(), "videos", file.getId() + "." + file.getNameExtension()).toFile(); + return Paths.get(Case.getCurrentCase().getTempDirectory(), "videos", file.getId() + "." + file.getNameExtension()).toFile(); //NON-NLS } public static boolean isVideoThumbnailSupported(AbstractFile file) { @@ -96,7 +97,7 @@ public class VideoUtils { try { if (tempFile.exists() == false || tempFile.length() < file.getSize()) { com.google.common.io.Files.createParentDirs(tempFile); - ProgressHandle progress = ProgressHandleFactory.createHandle("extracting temporary file " + file.getName()); + ProgressHandle progress = ProgressHandleFactory.createHandle(NbBundle.getMessage(VideoUtils.class, "VideoUtils.genVideoThumb.progress.text", file.getName())); progress.start(100); try { ContentUtils.writeToFile(file, tempFile, progress, null, true); From 18a1f909a52cf4920db7f4bb3ec1b85be9ae3d65 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Thu, 28 Jan 2016 20:29:29 -0500 Subject: [PATCH 11/48] Commented strings with NON-NLS. --- .../autopsy/datamodel/BlackboardArtifactNode.java | 2 +- .../autopsy/datamodel/BlackboardArtifactTagNode.java | 2 +- .../org/sleuthkit/autopsy/datamodel/ContentTagNode.java | 2 +- .../org/sleuthkit/autopsy/datamodel/DataSourcesNode.java | 2 +- .../org/sleuthkit/autopsy/datamodel/DeletedContent.java | 4 ++-- .../org/sleuthkit/autopsy/datamodel/DirectoryNode.java | 2 +- .../org/sleuthkit/autopsy/datamodel/EmailExtracted.java | 6 +++--- .../org/sleuthkit/autopsy/datamodel/ExtractedContent.java | 4 ++-- Core/src/org/sleuthkit/autopsy/datamodel/FileNode.java | 2 +- Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java | 4 ++-- .../src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java | 2 +- .../org/sleuthkit/autopsy/datamodel/FileTypesNode.java | 8 ++++---- Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java | 4 ++-- Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java | 2 +- .../org/sleuthkit/autopsy/datamodel/InterestingHits.java | 4 ++-- Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java | 6 +++--- .../org/sleuthkit/autopsy/datamodel/LayoutFileNode.java | 2 +- .../org/sleuthkit/autopsy/datamodel/LocalFileNode.java | 2 +- .../autopsy/datamodel/RecentFilesFilterNode.java | 2 +- .../org/sleuthkit/autopsy/datamodel/RecentFilesNode.java | 2 +- Core/src/org/sleuthkit/autopsy/datamodel/Reports.java | 4 ++-- Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java | 2 +- Core/src/org/sleuthkit/autopsy/datamodel/Tags.java | 8 ++++---- Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java | 2 +- .../sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java | 2 +- Core/src/org/sleuthkit/autopsy/datamodel/VolumeNode.java | 2 +- 26 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java index fcce21eaaa..4a62a26b2c 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java @@ -416,6 +416,6 @@ public class BlackboardArtifactNode extends DisplayableItemNode { @Override public String getItemType() { - return "BlackboardArtifact"; + return "BlackboardArtifact"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java index 64868e4dd1..f9e27a8969 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java @@ -110,6 +110,6 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode { @Override public String getItemType() { - return "BlackboardArtifactTag"; + return "BlackboardArtifactTag"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java index 669214eb8c..9c92e82958 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java @@ -124,6 +124,6 @@ class ContentTagNode extends DisplayableItemNode { @Override public String getItemType() { - return "ContentTag"; + return "ContentTag"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java index 6669afbfc7..eb0af9c01c 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java @@ -58,7 +58,7 @@ public class DataSourcesNode extends DisplayableItemNode { @Override public String getItemType() { - return "DataSources"; + return "DataSources"; //NON-NLS } /* diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java index a1bcfe3168..b1ffc42918 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java @@ -149,7 +149,7 @@ public class DeletedContent implements AutopsyVisitableItem { @Override public String getItemType() { - return "DeletedContent"; + return "DeletedContent"; //NON-NLS } } @@ -282,7 +282,7 @@ public class DeletedContent implements AutopsyVisitableItem { @Override public String getItemType() { - return "DeletedContentChildren"; + return "DeletedContentChildren"; //NON-NLS } // update the display name when new events are fired diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java index cf8e88c7b3..baf0b51966 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java @@ -103,6 +103,6 @@ public class DirectoryNode extends AbstractFsContentNode { @Override public String getItemType() { - return "Directory"; + return "Directory"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java index cb87b1fa53..a21ceecc2e 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java @@ -193,7 +193,7 @@ public class EmailExtracted implements AutopsyVisitableItem { @Override public String getItemType() { - return "EmailExtractedRoot"; + return "EmailExtractedRoot"; //NON-NLS } } @@ -348,7 +348,7 @@ public class EmailExtracted implements AutopsyVisitableItem { @Override public String getItemType() { - return "EmailExtractedAccount"; + return "EmailExtractedAccount"; //NON-NLS } } @@ -439,7 +439,7 @@ public class EmailExtracted implements AutopsyVisitableItem { @Override public String getItemType() { - return "EmailExtractedFolder"; + return "EmailExtractedFolder"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java index 2e03c39a03..5c38965bb6 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java @@ -85,7 +85,7 @@ public class ExtractedContent implements AutopsyVisitableItem { } static String getIconFilePath(int typeID) { - String filePath = "org/sleuthkit/autopsy/images/"; + String filePath = "org/sleuthkit/autopsy/images/"; //NON-NLS if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID()) { return filePath + "bookmarks.png"; //NON-NLS } else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID()) { @@ -185,7 +185,7 @@ public class ExtractedContent implements AutopsyVisitableItem { @Override public String getItemType() { - return "ExtractedContentRoot"; + return "ExtractedContentRoot"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileNode.java index 53c9270494..036e6a2de0 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileNode.java @@ -186,6 +186,6 @@ public class FileNode extends AbstractFsContentNode { @Override public String getItemType() { - return "File"; + return "File"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java index 587037fb24..9acf789592 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java @@ -146,7 +146,7 @@ public class FileSize implements AutopsyVisitableItem { @Override public String getItemType() { - return "FileSizeRoot"; + return "FileSizeRoot"; //NON-NLS } } @@ -288,7 +288,7 @@ public class FileSize implements AutopsyVisitableItem { @Override public String getItemType() { - return "FileSize"; + return "FileSize"; //NON-NLS } // update the display name when new events are fired diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java index d2cb20d2c6..04102bfead 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java @@ -84,7 +84,7 @@ public class FileTypeNode extends DisplayableItemNode { @Override public String getItemType() { - return "FileType"; + return "FileType"; //NON-NLS } // update the display name when new events are fired diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java index 24e7cd18f5..2240d4ca24 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java @@ -107,12 +107,12 @@ public class FileTypesNode extends DisplayableItemNode { @Override public String getItemType() { if(filter == null) - return "FileTypes"; + return "FileTypes"; //NON-NLS if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_DOCUMENT_FILTER)) - return "FileTypesDoc"; + return "FileTypesDoc"; //NON-NLS if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_EXECUTABLE_FILTER)) - return "FileTypesExe"; - return "FileTypes"; + return "FileTypesExe"; //NON-NLS + return "FileTypes"; //NON-NLS } /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java index 60855fe8a0..6e4503bec0 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java @@ -171,7 +171,7 @@ public class HashsetHits implements AutopsyVisitableItem { @Override public String getItemType() { - return "HashsetRoot"; + return "HashsetRoot"; //NON-NLS } } @@ -329,7 +329,7 @@ public class HashsetHits implements AutopsyVisitableItem { @Override public String getItemType() { - return "HashsetName"; + return "HashsetName"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java index 49ec5214c9..bdf90c2e8b 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java @@ -112,6 +112,6 @@ public class ImageNode extends AbstractContentNode { @Override public String getItemType() { - return "Image"; + return "Image"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java index e69dfd75b5..acc9013158 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java @@ -164,7 +164,7 @@ public class InterestingHits implements AutopsyVisitableItem { @Override public String getItemType() { - return "InterestingHitsRoot"; + return "InterestingHitsRoot"; //NON-NLS } } @@ -315,7 +315,7 @@ public class InterestingHits implements AutopsyVisitableItem { @Override public String getItemType() { - return "InterestingHitsSetName"; + return "InterestingHitsSetName"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java index 77be04dd6d..9a1290bc29 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java @@ -242,7 +242,7 @@ public class KeywordHits implements AutopsyVisitableItem { @Override public String getItemType() { - return "KeywordRoot"; + return "KeywordRoot"; //NON-NLS } } @@ -397,7 +397,7 @@ public class KeywordHits implements AutopsyVisitableItem { @Override public String getItemType() { - return "KeywordList"; + return "KeywordList"; //NON-NLS } } @@ -495,7 +495,7 @@ public class KeywordHits implements AutopsyVisitableItem { @Override public String getItemType() { - return "KeywordTerm"; + return "KeywordTerm"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java index ef6ab09c02..575695dbe7 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java @@ -40,7 +40,7 @@ public class LayoutFileNode extends AbstractAbstractFileNode { @Override public String getItemType() { - return "LayoutFile"; + return "LayoutFile"; //NON-NLS } public static enum LayoutContentPropertyType { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java index 04c542bfc7..3956bb93ac 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java @@ -118,6 +118,6 @@ public class LocalFileNode extends AbstractAbstractFileNode { @Override public String getItemType() { - return "LocalFile"; + return "LocalFile"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java index 832d385cfe..0d7d503c10 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java @@ -85,6 +85,6 @@ public class RecentFilesFilterNode extends DisplayableItemNode { @Override public String getItemType() { - return "RecentFilesFilter"; + return "RecentFilesFilter"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java index 8fcb72d7cb..dd2501e19b 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java @@ -68,6 +68,6 @@ public class RecentFilesNode extends DisplayableItemNode { @Override public String getItemType() { - return "RecentFiles"; + return "RecentFiles"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java b/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java index bcf5d7b266..327fdf1270 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java @@ -91,7 +91,7 @@ public final class Reports implements AutopsyVisitableItem { @Override public String getItemType() { - return "ReportsList"; + return "ReportsList"; //NON-NLS } } @@ -216,7 +216,7 @@ public final class Reports implements AutopsyVisitableItem { @Override public String getItemType() { - return "Reports"; + return "Reports"; //NON-NLS } private static class DeleteReportAction extends AbstractAction { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java index 46e4853e0b..7f761f2b05 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java @@ -71,6 +71,6 @@ public class ResultsNode extends DisplayableItemNode { @Override public String getItemType() { - return "Results"; + return "Results"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java b/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java index 1b013baf5c..a9eabeccc6 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java @@ -111,7 +111,7 @@ public class Tags implements AutopsyVisitableItem { @Override public String getItemType() { - return "TagsRoots"; + return "TagsRoots"; //NON-NLS } } @@ -273,7 +273,7 @@ public class Tags implements AutopsyVisitableItem { @Override public String getItemType() { - return "TagsName"; + return "TagsName"; //NON-NLS } } @@ -373,7 +373,7 @@ public class Tags implements AutopsyVisitableItem { @Override public String getItemType() { - return "TagsContentType"; + return "TagsContentType"; //NON-NLS } } @@ -471,7 +471,7 @@ public class Tags implements AutopsyVisitableItem { @Override public String getItemType() { - return "TagsBlackboardArtifact"; + return "TagsBlackboardArtifact"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java index 08c2e6b806..25314fbc00 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java @@ -75,6 +75,6 @@ public class ViewsNode extends DisplayableItemNode { @Override public String getItemType() { - return "Views"; + return "Views"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java index 5900487444..de5c23a0d0 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java @@ -151,6 +151,6 @@ public class VirtualDirectoryNode extends AbstractAbstractFileNode { @Override public String getItemType() { - return "Volume"; + return "Volume"; //NON-NLS } } From 083f38b85050826523f97a0cb652cd8ed2c51c07 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Thu, 28 Jan 2016 20:38:45 -0500 Subject: [PATCH 12/48] Commented strings with NON-NLS. --- .../sleuthkit/autopsy/events/LocalEventPublisher.java | 2 +- .../autopsy/events/MessageServiceConnectionInfo.java | 8 ++++---- .../sleuthkit/autopsy/events/RemoteEventPublisher.java | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/events/LocalEventPublisher.java b/Core/src/org/sleuthkit/autopsy/events/LocalEventPublisher.java index 3972bed895..fea68754e5 100644 --- a/Core/src/org/sleuthkit/autopsy/events/LocalEventPublisher.java +++ b/Core/src/org/sleuthkit/autopsy/events/LocalEventPublisher.java @@ -107,7 +107,7 @@ final class LocalEventPublisher { try { subscriber.propertyChange(event); } catch (Exception ex) { - logger.log(Level.SEVERE, "Exception thrown by subscriber", ex); + logger.log(Level.SEVERE, "Exception thrown by subscriber", ex); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/events/MessageServiceConnectionInfo.java b/Core/src/org/sleuthkit/autopsy/events/MessageServiceConnectionInfo.java index 487e06c61f..9db745b09b 100644 --- a/Core/src/org/sleuthkit/autopsy/events/MessageServiceConnectionInfo.java +++ b/Core/src/org/sleuthkit/autopsy/events/MessageServiceConnectionInfo.java @@ -35,10 +35,10 @@ import org.openide.util.NbBundle; @Immutable public final class MessageServiceConnectionInfo { - private static final String MESSAGE_SERVICE_URI = "tcp://%s:%s?wireFormat.maxInactivityDuration=0"; - private static final String CONNECTION_TIMED_OUT = "connection timed out"; - private static final String CONNECTION_REFUSED = "connection refused"; - private static final String PASSWORD_OR_USERNAME_BAD = "user name ["; + private static final String MESSAGE_SERVICE_URI = "tcp://%s:%s?wireFormat.maxInactivityDuration=0"; //NON-NLS + private static final String CONNECTION_TIMED_OUT = "connection timed out"; //NON-NLS + private static final String CONNECTION_REFUSED = "connection refused"; //NON-NLS + private static final String PASSWORD_OR_USERNAME_BAD = "user name ["; //NON-NLS private static final int IS_REACHABLE_TIMEOUT_MS = 1000; private final String userName; private final String password; diff --git a/Core/src/org/sleuthkit/autopsy/events/RemoteEventPublisher.java b/Core/src/org/sleuthkit/autopsy/events/RemoteEventPublisher.java index 58a567e415..6a83f2ef32 100644 --- a/Core/src/org/sleuthkit/autopsy/events/RemoteEventPublisher.java +++ b/Core/src/org/sleuthkit/autopsy/events/RemoteEventPublisher.java @@ -43,7 +43,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; final class RemoteEventPublisher { private static final Logger logger = Logger.getLogger(RemoteEventPublisher.class.getName()); - private static final String ALL_MESSAGE_SELECTOR = "All"; + private static final String ALL_MESSAGE_SELECTOR = "All"; //NON-NLS private final LocalEventPublisher localPublisher; private final Connection connection; private final Session session; @@ -76,11 +76,11 @@ final class RemoteEventPublisher { Topic topic = session.createTopic(eventChannelName); producer = session.createProducer(topic); producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); - consumer = session.createConsumer(topic, "events = '" + ALL_MESSAGE_SELECTOR + "'", true); + consumer = session.createConsumer(topic, "events = '" + ALL_MESSAGE_SELECTOR + "'", true); //NON-NLS receiver = new MessageReceiver(); consumer.setMessageListener(receiver); } catch (URISyntaxException | JMSException ex) { - logger.log(Level.SEVERE, "Failed to connect to event channel", ex); + logger.log(Level.SEVERE, "Failed to connect to event channel", ex); //NON-NLS try { stop(); } catch (JMSException ignored) { @@ -121,7 +121,7 @@ final class RemoteEventPublisher { */ synchronized void publish(AutopsyEvent event) throws JMSException { ObjectMessage message = session.createObjectMessage(); - message.setStringProperty("events", ALL_MESSAGE_SELECTOR); + message.setStringProperty("events", ALL_MESSAGE_SELECTOR); //NON-NLS message.setObject(event); producer.send(message); } @@ -151,7 +151,7 @@ final class RemoteEventPublisher { } } } catch (Exception ex) { - logger.log(Level.SEVERE, "Error receiving message", ex); + logger.log(Level.SEVERE, "Error receiving message", ex); //NON-NLS } } } From d6474574cdd691ffd25a939cc7a0e9b88e10237e Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Thu, 28 Jan 2016 20:41:45 -0500 Subject: [PATCH 13/48] Commented strings with NON-NLS. --- .../externalresults/ExternalResultsImporter.java | 14 +++++++------- .../externalresults/ExternalResultsXMLParser.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java b/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java index 568f45f680..f2f7f39797 100644 --- a/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java +++ b/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java @@ -148,19 +148,19 @@ public final class ExternalResultsImporter { if (attributeType == null) { switch (attributeData.getValueType()) { case "text": //NON-NLS - attributeType = caseDb.addArtifactAttributeType(attributeData.getType(), BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.fromLabel("String"), attributeData.getType()); + attributeType = caseDb.addArtifactAttributeType(attributeData.getType(), BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.fromLabel("String"), attributeData.getType()); //NON-NLS break; case "int32": //NON-NLS - attributeType = caseDb.addArtifactAttributeType(attributeData.getType(), BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.fromLabel("Integer"), attributeData.getType()); + attributeType = caseDb.addArtifactAttributeType(attributeData.getType(), BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.fromLabel("Integer"), attributeData.getType()); //NON-NLS break; case "int64": //NON-NLS - attributeType = caseDb.addArtifactAttributeType(attributeData.getType(), BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.fromLabel("Long"), attributeData.getType()); + attributeType = caseDb.addArtifactAttributeType(attributeData.getType(), BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.fromLabel("Long"), attributeData.getType()); //NON-NLS break; case "double": //NON-NLS - attributeType = caseDb.addArtifactAttributeType(attributeData.getType(), BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.fromLabel("Double"), attributeData.getType()); + attributeType = caseDb.addArtifactAttributeType(attributeData.getType(), BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.fromLabel("Double"), attributeData.getType()); //NON-NLS break; - case "datetime": - attributeType = caseDb.addArtifactAttributeType(attributeData.getType(), BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.fromLabel("DateTime"), attributeData.getType()); + case "datetime": //NON-NLS + attributeType = caseDb.addArtifactAttributeType(attributeData.getType(), BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.fromLabel("DateTime"), attributeData.getType()); //NON-NLS } } @@ -180,7 +180,7 @@ public final class ExternalResultsImporter { double doubleValue = Double.parseDouble(attributeData.getValue()); attributes.add(new BlackboardAttribute(attributeType, attributeData.getSourceModule(), doubleValue)); break; - case "datetime": + case "datetime": //NON-NLS long dateTimeValue = Long.parseLong(attributeData.getValue()); attributes.add(new BlackboardAttribute(attributeType, attributeData.getSourceModule(), dateTimeValue)); break; diff --git a/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsXMLParser.java b/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsXMLParser.java index 5bcfc51dc1..8443e6b71a 100644 --- a/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsXMLParser.java +++ b/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsXMLParser.java @@ -101,7 +101,7 @@ public final class ExternalResultsXMLParser implements ExternalResultsParser { VALUE_TYPE_INT32("int32"), //NON-NLS VALUE_TYPE_INT64("int64"), //NON-NLS VALUE_TYPE_DOUBLE("double"), //NON-NLS - VALUE_TYPE_DATETIME("datetime"); + VALUE_TYPE_DATETIME("datetime"); //NON-NLS private final String text; private AttributeValues(final String text) { From adfa7d30809ffdf73ad590f931ffedc313f708cf Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Thu, 28 Jan 2016 21:03:05 -0500 Subject: [PATCH 14/48] Extracted strings. Commented strings with NON-NLS. --- .../sleuthkit/autopsy/ingest/Bundle.properties | 8 ++++++++ .../autopsy/ingest/DataSourceIngestJob.java | 18 +++++++++--------- .../ingest/DataSourceIngestPipeline.java | 6 +++--- .../autopsy/ingest/FileIngestPipeline.java | 6 ++++-- .../sleuthkit/autopsy/ingest/IngestJob.java | 16 +++++++++------- .../autopsy/ingest/IngestJobSettings.java | 6 +++--- .../autopsy/ingest/IngestManager.java | 4 ++-- .../autopsy/ingest/IngestMonitor.java | 2 +- .../autopsy/ingest/RunIngestSubMenu.java | 2 +- .../ingest/events/BlackboardPostEvent.java | 2 +- .../ingest/events/ContentChangedEvent.java | 2 +- .../ingest/events/DataSourceAnalysisEvent.java | 2 +- .../ingest/events/FileAnalyzedEvent.java | 2 +- 13 files changed, 44 insertions(+), 32 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties index 309fbab41b..ba1e445d8a 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties @@ -109,3 +109,11 @@ IngestManager.cancellingIngest.msgDlg.text=Cancelling all currently running inge IngestManager.serviceIsDown.msgDlg.text={0} is down RunIngestSubMenu.menuItem.empty=-Empty- RunIngestModulesMenu.getName.text=Run Ingest Modules +DataSourceIngestPipeline.moduleError.title.text={0} Error +FileIngestPipeline.moduleError.title.text={0} Error +IngestJob.cancelReason.notCancelled.text=Not cancelled +IngestJob.cancelReason.cancelledByUser.text=Cancelled by user +IngestJob.cancelReason.ingestModStartFail.text=Ingest modules startup failed +IngestJob.cancelReason.outOfDiskSpace.text=Out of disk space +IngestJob.cancelReason.servicesDown.text=Not cancelled +IngestJob.cancelReason.caseClosed.text=Case closed diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java index a84f262988..2004674df7 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java @@ -360,10 +360,10 @@ final class DataSourceIngestJob { List errors = startUpIngestPipelines(); if (errors.isEmpty()) { if (this.hasFirstStageDataSourceIngestPipeline() || this.hasFileIngestPipeline()) { - logger.log(Level.INFO, "Starting first stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Starting first stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS this.startFirstStage(); } else if (this.hasSecondStageDataSourceIngestPipeline()) { - logger.log(Level.INFO, "Starting second stage analysis for {0} (jobId={1}), no first stage configured", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Starting second stage analysis for {0} (jobId={1}), no first stage configured", new Object[]{dataSource.getName(), this.id}); //NON-NLS this.startSecondStage(); } } @@ -450,13 +450,13 @@ final class DataSourceIngestJob { * Schedule the first stage tasks. */ if (this.hasFirstStageDataSourceIngestPipeline() && this.hasFileIngestPipeline()) { - logger.log(Level.INFO, "Scheduling first stage data source and file level analysis tasks for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Scheduling first stage data source and file level analysis tasks for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS DataSourceIngestJob.taskScheduler.scheduleIngestTasks(this); } else if (this.hasFirstStageDataSourceIngestPipeline()) { - logger.log(Level.INFO, "Scheduling first stage data source level analysis tasks for {0} (jobId={1}), no file level analysis configured", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Scheduling first stage data source level analysis tasks for {0} (jobId={1}), no file level analysis configured", new Object[]{dataSource.getName(), this.id}); //NON-NLS DataSourceIngestJob.taskScheduler.scheduleDataSourceIngestTask(this); } else { - logger.log(Level.INFO, "Scheduling file level analysis tasks for {0} (jobId={1}), no first stage data source level analysis configured", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Scheduling file level analysis tasks for {0} (jobId={1}), no first stage data source level analysis configured", new Object[]{dataSource.getName(), this.id}); //NON-NLS DataSourceIngestJob.taskScheduler.scheduleFileIngestTasks(this); /** @@ -475,7 +475,7 @@ final class DataSourceIngestJob { * Starts the second stage of this ingest job. */ private void startSecondStage() { - logger.log(Level.INFO, "Starting second stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Starting second stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS this.stage = DataSourceIngestJob.Stages.SECOND; if (this.doUI) { this.startDataSourceIngestProgressBar(); @@ -483,7 +483,7 @@ final class DataSourceIngestJob { synchronized (this.dataSourceIngestPipelineLock) { this.currentDataSourceIngestPipeline = this.secondStageDataSourceIngestPipeline; } - logger.log(Level.INFO, "Scheduling second stage data source level analysis tasks for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Scheduling second stage data source level analysis tasks for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS DataSourceIngestJob.taskScheduler.scheduleDataSourceIngestTask(this); } @@ -572,7 +572,7 @@ final class DataSourceIngestJob { * job and starts the second stage, if appropriate. */ private void finishFirstStage() { - logger.log(Level.INFO, "Finished first stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Finished first stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS // Shut down the file ingest pipelines. Note that no shut down is // required for the data source ingest pipeline because data source @@ -622,7 +622,7 @@ final class DataSourceIngestJob { * Shuts down the ingest pipelines and progress bars for this job. */ private void finish() { - logger.log(Level.INFO, "Finished analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Finished analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS this.stage = DataSourceIngestJob.Stages.FINALIZATION; if (this.doUI) { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java index c10d1436d2..4c27c201d5 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java @@ -109,9 +109,9 @@ final class DataSourceIngestPipeline { this.job.updateDataSourceIngestProgressBarDisplayName(displayName); this.job.switchDataSourceIngestProgressBarToIndeterminate(); DataSourceIngestPipeline.ingestManager.setIngestTaskProgress(task, module.getDisplayName()); - logger.log(Level.INFO, "{0} analysis of {1} (jobId={2}) starting", new Object[]{module.getDisplayName(), this.job.getDataSource().getName(), this.job.getDataSource().getId()}); + logger.log(Level.INFO, "{0} analysis of {1} (jobId={2}) starting", new Object[]{module.getDisplayName(), this.job.getDataSource().getName(), this.job.getDataSource().getId()}); //NON-NLS module.process(dataSource, new DataSourceIngestModuleProgress(this.job)); - logger.log(Level.INFO, "{0} analysis of {1} (jobId={2}) finished", new Object[]{module.getDisplayName(), this.job.getDataSource().getName(), this.job.getDataSource().getId()}); + logger.log(Level.INFO, "{0} analysis of {1} (jobId={2}) finished", new Object[]{module.getDisplayName(), this.job.getDataSource().getName(), this.job.getDataSource().getId()}); //NON-NLS } catch (Throwable ex) { // Catch-all exception firewall errors.add(new IngestModuleError(module.getDisplayName(), ex)); String msg = ex.getMessage(); @@ -119,7 +119,7 @@ final class DataSourceIngestPipeline { if (msg == null) { msg = ex.toString(); } - MessageNotifyUtil.Notify.error(module.getDisplayName() + " Error", msg); + MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "DataSourceIngestPipeline.moduleError.title.text", module.getDisplayName()), msg); } if (this.job.isCancelled()) { break; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java index 251e0bbf08..9f1cc0aaa5 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java @@ -21,6 +21,8 @@ package org.sleuthkit.autopsy.ingest; import java.util.ArrayList; import java.util.Date; import java.util.List; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.datamodel.AbstractFile; @@ -128,7 +130,7 @@ final class FileIngestPipeline { if (msg == null) { msg = ex.toString(); } - MessageNotifyUtil.Notify.error(module.getDisplayName() + " Error", msg); + MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "FileIngestPipeline.moduleError.title.text", module.getDisplayName()), msg); } if (this.job.isCancelled()) { break; @@ -161,7 +163,7 @@ final class FileIngestPipeline { if (msg == null) { msg = ex.toString(); } - MessageNotifyUtil.Notify.error(module.getDisplayName() + " Error", msg); + MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "FileIngestPipeline.moduleError.title.text", module.getDisplayName()), msg); } } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java index 0958eb8d5f..14c0f12430 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java @@ -27,6 +27,8 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; + +import org.openide.util.NbBundle; import org.sleuthkit.datamodel.Content; /** @@ -42,12 +44,12 @@ public final class IngestJob { */ public enum CancellationReason { - NOT_CANCELLED("Not cancelled"), - USER_CANCELLED("Cancelled by user"), - INGEST_MODULES_STARTUP_FAILED("Ingest modules startup failed"), - OUT_OF_DISK_SPACE("Out of disk space"), - SERVICES_DOWN("Not cancelled"), - CASE_CLOSED("Case closed"); + NOT_CANCELLED(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.notCancelled.text")), + USER_CANCELLED(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.cancelledByUser.text")), + INGEST_MODULES_STARTUP_FAILED(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.ingestModStartFail.text")), + OUT_OF_DISK_SPACE(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.outOfDiskSpace.text")), + SERVICES_DOWN(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.servicesDown.text")), + CASE_CLOSED(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.caseClosed.text")); private final String displayName; @@ -128,7 +130,7 @@ public final class IngestJob { synchronized List start() { List errors = new ArrayList<>(); if (started) { - errors.add(new IngestModuleError("IngestJob", new IllegalStateException("Job already started"))); + errors.add(new IngestModuleError("IngestJob", new IllegalStateException("Job already started"))); //NON-NLS return errors; } started = true; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java index 98a307d544..de15f82949 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java @@ -55,7 +55,7 @@ public class IngestJobSettings { private final String executionContext; private final IngestType ingestType; private String moduleSettingsFolderPath; - private static final CharSequence pythonModuleSettingsPrefixCS = "org.python.proxies.".subSequence(0, "org.python.proxies.".length() - 1); + private static final CharSequence pythonModuleSettingsPrefixCS = "org.python.proxies.".subSequence(0, "org.python.proxies.".length() - 1); //NON-NLS private final List moduleTemplates; private boolean processUnallocatedSpace; private final List warnings; @@ -337,7 +337,7 @@ public class IngestJobSettings { moduleNames.add("E01 Verifier"); //NON-NLS break; case "Archive Extractor": //NON-NLS - moduleNames.add("Embedded File Extractor"); + moduleNames.add("Embedded File Extractor"); //NON-NLS break; default: moduleNames.add(name); @@ -454,7 +454,7 @@ public class IngestJobSettings { if (isPythonModuleSettingsFile(moduleSettingsFilePath)) { // compiled python modules have variable instance number as a part of their file name. // This block of code gets rid of that variable instance number and helps maitains constant module name over multiple runs. - moduleSettingsFilePath = moduleSettingsFilePath.replaceAll("[$][\\d]+.settings$", "\\$.settings"); + moduleSettingsFilePath = moduleSettingsFilePath.replaceAll("[$][\\d]+.settings$", "\\$.settings"); //NON-NLS NON-NLS } try (NbObjectOutputStream out = new NbObjectOutputStream(new FileOutputStream(moduleSettingsFilePath))) { out.writeObject(settings); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 926ad71d78..f528cba6e6 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -106,8 +106,8 @@ public class IngestManager { private int numberOfFileIngestThreads; private final ExecutorService fileIngestThreadPool; - private static final String JOB_EVENT_CHANNEL_NAME = "%s-Ingest-Job-Events"; - private static final String MODULE_EVENT_CHANNEL_NAME = "%s-Ingest-Module-Events"; + private static final String JOB_EVENT_CHANNEL_NAME = "%s-Ingest-Job-Events"; //NON-NLS + private static final String MODULE_EVENT_CHANNEL_NAME = "%s-Ingest-Module-Events"; //NON-NLS private static final Set jobEventNames = Stream.of(IngestJobEvent.values()) .map(IngestJobEvent::toString) .collect(Collectors.toSet()); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java index 1a895d9b92..f1cad5531c 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java @@ -64,7 +64,7 @@ public final class IngestMonitor { MONITOR_LOGGER.setUseParentHandlers(false); MONITOR_LOGGER.addHandler(monitorLogHandler); } catch (IOException | SecurityException ex) { - logger.log(Level.SEVERE, "Failed to create memory usage logger", ex); + logger.log(Level.SEVERE, "Failed to create memory usage logger", ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java index f4db5d47e8..a0472a8f7c 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java @@ -52,7 +52,7 @@ final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent { // No open Cases, create a disabled empty menu return getEmpty(); } catch (TskCoreException e) { - System.out.println("Exception getting images: " + e.getMessage()); + System.out.println("Exception getting images: " + e.getMessage()); //NON-NLS } JComponent[] comps = new JComponent[images.size()]; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java index a63b3893e9..f793e33e07 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java @@ -99,7 +99,7 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa eventData = new ModuleDataEvent(data.moduleName, data.artifactTypeId, !artifacts.isEmpty() ? artifacts : null); return eventData; } catch (IllegalStateException | TskCoreException ex) { - logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); + logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS return null; } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java index 3ff37f4be1..7370d90586 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java @@ -89,7 +89,7 @@ public final class ContentChangedEvent extends AutopsyEvent implements Serializa eventData = new ModuleContentEvent(data.moduleName, content); return eventData; } catch (IllegalStateException | TskCoreException ex) { - logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); + logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS return null; } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java index f401285044..c508d3e276 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java @@ -99,7 +99,7 @@ public abstract class DataSourceAnalysisEvent extends AutopsyEvent implements Se dataSource = Case.getCurrentCase().getSleuthkitCase().getContentById(id); return dataSource; } catch (IllegalStateException | TskCoreException ex) { - logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); + logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS return null; } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java index ca629bf261..afc8c0a996 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java @@ -79,7 +79,7 @@ public final class FileAnalyzedEvent extends AutopsyEvent implements Serializabl file = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(id); return file; } catch (IllegalStateException | TskCoreException ex) { - logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); + logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS return null; } } From 9f48b29704629de9e81cdf324395048af47d9b26 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Thu, 28 Jan 2016 21:07:22 -0500 Subject: [PATCH 15/48] Commented strings with NON-NLS. --- .../autopsy/modules/android/CacheLocationAnalyzer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java index f2b6fc4bce..266bf09469 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java @@ -58,7 +58,7 @@ class CacheLocationAnalyzer { blackboard = Case.getCurrentCase().getServices().getBlackboard(); try { List abstractFiles = fileManager.findFiles(dataSource, "cache.cell"); //NON-NLS - abstractFiles.addAll(fileManager.findFiles(dataSource, "cache.wifi")); + abstractFiles.addAll(fileManager.findFiles(dataSource, "cache.wifi")); //NON-NLS for (AbstractFile abstractFile : abstractFiles) { try { From 0b8deccf9ad28f4075e86a75b1f855d89e9f664a Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Thu, 28 Jan 2016 21:24:14 -0500 Subject: [PATCH 16/48] Commented strings with NON-NLS. Extracted strings. Removed unused strings from Bundles. --- .../embeddedfileextractor/Bundle.properties | 4 +++- .../Bundle_ja.properties | 20 ---------------- .../embeddedfileextractor/ImageExtractor.java | 24 +++++++++---------- .../SevenZipExtractor.java | 14 +++++------ 4 files changed, 22 insertions(+), 40 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/Bundle.properties b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/Bundle.properties index c91965d14b..3523597a00 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/Bundle.properties @@ -38,4 +38,6 @@ EmbeddedFileExtractorIngestModule.ImageExtractor.xlsxContainer.init.err=Xlsx con EmbeddedFileExtractorIngestModule.ImageExtractor.extractImage.addToDB.exception.msg=Unable to add the derived files to the database. EmbeddedFileExtractorIngestModule.ImageExtractor.getOutputFolderPath.exception.msg=Could not get path for image extraction from Abstract File: {0} EmbeddedFileExtractorIngestModule.ImageExtractor.getOutputFolderPath.exception.msg=Could not get path for image extraction from Abstract File: {0} -EmbeddedFileExtractorIngestModule.ArchiveExtractor.UnpackStream.write.noSpace.msg=Unable to write content to disk. Not enough space. \ No newline at end of file +EmbeddedFileExtractorIngestModule.ArchiveExtractor.UnpackStream.write.noSpace.msg=Unable to write content to disk. Not enough space. +SevenZipContentReadStream.seek.exception.invalidOrigin=Invalid origin {0} +SevenZipContentReadStream.read.exception.errReadStream=Error reading stream diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/Bundle_ja.properties index 9f25567758..dd4f49b9b6 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/Bundle_ja.properties +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/Bundle_ja.properties @@ -9,23 +9,3 @@ OpenIDE-Module-Name=7Zip OpenIDE-Module-Short-Description=7Zip\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb SevenZipContentReadStream.seek.exception.invalidOrigin=\u7121\u52b9\u306a\u30b7\u30fc\u30af\u30aa\u30ea\u30b8\u30f3\uff1a {0} SevenZipContentReadStream.read.exception.errReadStream=\u30b3\u30f3\u30c6\u30f3\u30c4\u30b9\u30c8\u30ea\u30fc\u30e0\u306e\u8aad\u307f\u53d6\u308a\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002 -SevenZipIngestModule.moduleName=\u30a2\u30fc\u30ab\u30a4\u30d6\u30a8\u30af\u30b9\u30c8\u30e9\u30af\u30bf\u30fc -SevenZipIngestModule.moduleDesc.text=\u30a2\u30fc\u30ab\u30a4\u30d6\u30d5\u30a1\u30a4\u30eb(zip, rar, arj, 7z, gzip, bzip2, tar)\u3092\u62bd\u51fa\u3057\u3001\u73fe\u5728\u306e\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u306b\u30ea\u30b9\u30b1\u3057\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30c4\u30ea\u30fc\u306b\u65b0\u898f\u30d5\u30a1\u30a4\u30eb\u3092\u6295\u5165\u3057\u307e\u3059\u3002 -SevenZipIngestModule.encryptionFileLevel=\u30d5\u30a1\u30a4\u30eb\u30ec\u30d9\u30eb\u6697\u53f7\u5316 -SevenZipIngestModule.encryptionFull=\u5168\u4f53\u6697\u53f7\u5316 -SevenZipIngestModule.init.errInitModule.msg={0}\u306e\u521d\u671f\u5316\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f -SevenZipIngestModule.init.errInitModule.details=\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\: {0}\: {1}\u306e\u521d\u671f\u5316\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f -SevenZipIngestModule.init.errCantInitLib=7-Zip\u30e9\u30a4\u30d6\u30e9\u30ea\: {0}\u3092\u521d\u671f\u5316\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f -SevenZipIngestModule.isZipBombCheck.warnMsg=Zip\u7206\u5f3e\u306e\u53ef\u80fd\u6027\u304c\u3042\u308b\u3082\u306e\u304c\u30a2\u30fc\u30ab\u30a4\u30d6\: {0}, item\: {1}\u306b\u691c\u51fa\u3055\u308c\u307e\u3057\u305f -SevenZipIngestModule.isZipBombCheck.warnDetails=\u30a2\u30fc\u30ab\u30a4\u30d6\u30a2\u30a4\u30c6\u30e0\u306e\u5727\u7e2e\u7387\u306f{0}\u3001\u3053\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30a2\u30a4\u30c6\u30e0\u306e\u51e6\u7406\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3059\u3002{1} -SevenZipIngestModule.unpack.warnMsg.zipBomb=Zip\u7206\u5f3e\u306e\u53ef\u80fd\u6027\u304c\u3042\u308b\u3082\u306e\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\uff1a {0} -SevenZipIngestModule.unpack.warnDetails.zipBomb=\u30a2\u30fc\u30ab\u30a4\u30d6\u306f {0}\u30ec\u30d9\u30eb\u306e\u6df1\u3055\u3067\u3059\u3001\u3053\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u3068\u305d\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u51e6\u7406\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3059 {1} -SevenZipIngestModule.unpack.unknownPath.msg=\u30a2\u30fc\u30ab\u30a4\u30d6\: {0}\u306b\u4e0d\u660e\u306e\u30a2\u30a4\u30c6\u30e0\u30d1\u30b9\u304c\u5b58\u5728\u3057\u307e\u3059\u3001{1}\u3092\u4f7f\u7528\u3057\u307e\u3059 -SevenZipIngestModule.unpack.notEnoughDiskSpace.msg=\u30a2\u30fc\u30ab\u30a4\u30d6\u30a2\u30a4\u30c6\u30e0\: {0}, {1}\u3092\u89e3\u51cd\u3059\u308b\u306e\u306b\u5341\u5206\u306a\u30c7\u30a3\u30b9\u30af\u30b9\u30da\u30fc\u30b9\u304c\u3042\u308a\u307e\u305b\u3093 -SevenZipIngestModule.unpack.notEnoughDiskSpace.details=\u30a2\u30fc\u30ab\u30a4\u30d6\u30a2\u30a4\u30c6\u30e0\u306f\u89e3\u51cd\u3059\u308b\u306e\u306b\u5927\u304d\u3059\u304e\u307e\u3059\u3001\u3053\u306e\u30a2\u30a4\u30c6\u30e0\u306e\u89e3\u51cd\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3059\u3002 -SevenZipIngestModule.unpack.errUnpacking.msg={0}\u89e3\u51cd\u30a8\u30e9\u30fc -SevenZipIngestModule.unpack.errUnpacking.details={0}. {1}\u306e\u89e3\u51cd\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f -SevenZipIngestModule.unpack.encrFileDetected.msg=\u30a2\u30fc\u30ab\u30a4\u30d6\u306b\u6697\u53f7\u5316\u30d5\u30a1\u30a4\u30eb\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\u3002 -SevenZipIngestModule.unpack.encrFileDetected.details=\u30a2\u30fc\u30ab\u30a4\u30d6\: {0}\u306e\u4e00\u90e8\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u6697\u53f7\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002{1}\u30a8\u30af\u30b9\u30c8\u30e9\u30af\u30bf\u30fc\u306f\u3053\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u304b\u3089\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u62bd\u51fa\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 -SevenZipIngestModule.UnpackStream.write.exception.msg=\u89e3\u51cd\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u4e0b\u8a18\u3078\u306e\u66f8\u304d\u8fbc\u307f\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\: {0} -SevenZipIngestModule.UnpackedTree.exception.msg=\u6d3e\u751f\u30d5\u30a1\u30a4\u30eb\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\:{0}\u306b\u8ffd\u52a0\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ImageExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ImageExtractor.java index 12550f4601..c916aa7f55 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ImageExtractor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ImageExtractor.java @@ -57,7 +57,7 @@ class ImageExtractor { private static final Logger logger = Logger.getLogger(ImageExtractor.class.getName()); private final IngestJobContext context; private String parentFileName; - private final String UNKNOWN_NAME_PREFIX = "image_"; + private final String UNKNOWN_NAME_PREFIX = "image_"; //NON-NLS private final FileTypeDetector fileTypeDetector; private String moduleDirRelative; @@ -68,12 +68,12 @@ class ImageExtractor { */ enum SupportedImageExtractionFormats { - DOC("application/msword"), - DOCX("application/vnd.openxmlformats-officedocument.wordprocessingml.document"), - PPT("application/vnd.ms-powerpoint"), - PPTX("application/vnd.openxmlformats-officedocument.presentationml.presentation"), - XLS("application/vnd.ms-excel"), - XLSX("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + DOC("application/msword"), //NON-NLS + DOCX("application/vnd.openxmlformats-officedocument.wordprocessingml.document"), //NON-NLS + PPT("application/vnd.ms-powerpoint"), //NON-NLS + PPTX("application/vnd.openxmlformats-officedocument.presentationml.presentation"), //NON-NLS + XLS("application/vnd.ms-excel"), //NON-NLS + XLSX("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); //NON-NLS private final String mimeType; @@ -266,7 +266,7 @@ class ImageExtractor { outputFolderPath = getOutputFolderPath(this.parentFileName); } if (outputFolderPath == null) { - logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); + logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); //NON-NLS return null; } listOfExtractedImages = new ArrayList<>(); @@ -309,7 +309,7 @@ class ImageExtractor { outputFolderPath = getOutputFolderPath(this.parentFileName); } if (outputFolderPath == null) { - logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); + logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); //NON-NLS return null; } @@ -379,7 +379,7 @@ class ImageExtractor { outputFolderPath = getOutputFolderPath(this.parentFileName); } if (outputFolderPath == null) { - logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); + logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); //NON-NLS return null; } @@ -428,7 +428,7 @@ class ImageExtractor { outputFolderPath = getOutputFolderPath(this.parentFileName); } if (outputFolderPath == null) { - logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); + logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); //NON-NLS return null; } @@ -473,7 +473,7 @@ class ImageExtractor { outputFolderPath = getOutputFolderPath(this.parentFileName); } if (outputFolderPath == null) { - logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); + logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.extractImageFrom.outputPath.exception.msg", af.getName())); //NON-NLS return null; } diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java index e739a6db34..44052df224 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java @@ -99,13 +99,13 @@ class SevenZipExtractor { */ private enum SupportedArchiveExtractionFormats { - ZIP("application/zip"), - SEVENZ("application/x-7z-compressed"), - GZIP("application/gzip"), - XGZIP("application/x-gzip"), - XBZIP2("application/x-bzip2"), - XTAR("application/x-tar"), - XGTAR("application/x-gtar"); + ZIP("application/zip"), //NON-NLS + SEVENZ("application/x-7z-compressed"), //NON-NLS + GZIP("application/gzip"), //NON-NLS + XGZIP("application/x-gzip"), //NON-NLS + XBZIP2("application/x-bzip2"), //NON-NLS + XTAR("application/x-tar"), //NON-NLS + XGTAR("application/x-gtar"); //NON-NLS private final String mimeType; From 1f2ea4c4e834e60f619cd86c006ba562b610f678 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 12:45:49 -0500 Subject: [PATCH 17/48] Re-ran searches. Extracted strings. Marked others with NON-NLS. --- .../org/sleuthkit/autopsy/imagegallery/Bundle.properties | 1 + .../autopsy/imagegallery/ImageGalleryController.java | 2 +- .../autopsy/imagegallery/datamodel/Bundle.properties | 1 + .../autopsy/imagegallery/datamodel/DrawableAttribute.java | 4 ++-- .../imagegallery/datamodel/grouping/GroupManager.java | 8 ++++---- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties index 5d2931a865..997f7045a8 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties @@ -28,3 +28,4 @@ ImageGalleryController.copyAnalyzedFile.progress.stop=Stopping copy to drawable ImageGalleryController.prePopulateDataSourceFiles.progress=prepopulating image/video database ImageGalleryController.prePopulateDataSourceFiles.progress2=commiting image/video database ImageGalleryModule.moduleName.txt=Image Gallery +ImageGalleryController.notifyMsg.errPopulatingDb.txt=There was an error populating Image Gallery database. diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index 0e395b67b4..cacb068e16 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -791,7 +791,7 @@ public final class ImageGalleryController implements Executor { } catch (TskCoreException ex) { progressHandle.progress(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress.stop")); Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); //NON-NLS - MessageNotifyUtil.Notify.warn("There was an error populating Image Gallery database.", ex.getMessage()); + MessageNotifyUtil.Notify.warn(NbBundle.getMessage(this.getClass(), "ImageGalleryController.notifyMsg.errPopulatingDb.txt"), ex.getMessage()); progressHandle.finish(); updateMessage(""); updateProgress(-1.0); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties index 5180c7d1d2..a913cf0d3d 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties @@ -13,6 +13,7 @@ DrawableAttribute.hashset.txt=Hashset DrawableAttribute.height.txt=Height DrawableAttribute.internalObjectId.txt=Internal Object ID DrawableAttribute.md5Hash.txt=MD5 Hash +DrawableAttribute.mimeType.txt=MIME type DrawableAttribute.modifiedTime.txt=Modified Time DrawableAttribute.name.txt=Name DrawableAttribute.path.txt=Path diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java index acfbabb32f..490588e07a 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java @@ -148,9 +148,9 @@ public class DrawableAttribute> { public final static DrawableAttribute MIME_TYPE = new DrawableAttribute<>(AttributeName.MIME_TYPE, - "MIME type", + NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.mimeType.txt"), false, - "mime_types.png", + "mime_types.png", // NON-NLS f -> Collections.singleton(f.getMIMEType())); final private static List< DrawableAttribute> groupables = diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java index eda95c523b..f0b9192f78 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java @@ -348,7 +348,7 @@ public class GroupManager { break; case MIME_TYPE: HashSet types = new HashSet<>(); - try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); + try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); //NON-NLS ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { final String mimeType = resultSet.getString("mime_type"); // NON-NLS @@ -694,13 +694,13 @@ public class GroupManager { HashSet hashSet = new HashSet<>(); String query = (null == mimeType) - ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" - : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; + ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" //NON-NLS + : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; //NON-NLS try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(query); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final long fileID = resultSet.getLong("obj_id"); + final long fileID = resultSet.getLong("obj_id"); //NON-NLS if (db.isInDB(fileID)) { hashSet.add(fileID); } From 5521ac3b6d2bec1a7d9d03dc1f8f585c130847bd Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 13:23:38 -0500 Subject: [PATCH 18/48] Rran searches. Marked strings with NON-NLS. --- .../autopsy/modules/exif/ExifParserFileIngestModule.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java index 2e1ba91472..de946ffd0f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java @@ -79,9 +79,9 @@ public final class ExifParserFileIngestModule implements FileIngestModule { private Blackboard blackboard; ExifParserFileIngestModule() { - supportedMimeTypes.add("audio/x-wav"); - supportedMimeTypes.add("image/jpeg"); - supportedMimeTypes.add("image/tiff"); + supportedMimeTypes.add("audio/x-wav"); //NON-NLS + supportedMimeTypes.add("image/jpeg"); //NON-NLS + supportedMimeTypes.add("image/tiff"); //NON-NLS } @Override From 0eb7421d04e01374861238a6a9c56ef28ef60e8c Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 13:30:03 -0500 Subject: [PATCH 19/48] Ran searches. Marked strings with NON-NLS. --- .../modules/fileextmismatch/FileExtMismatchSettingsPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java index f44a9e7c0b..fa0a090fdc 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java @@ -166,7 +166,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel jPanel1.setPreferredSize(new java.awt.Dimension(687, 450)); - saveButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/fileextmismatch/save16.png"))); // NOI18N + saveButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/fileextmismatch/save16.png"))); // NOI18N NON-NLS saveButton.setText(org.openide.util.NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.saveButton.text")); // NOI18N saveButton.setEnabled(false); saveButton.addActionListener(new java.awt.event.ActionListener() { From bcc0d554190e3adeaba582ea1f4ad7f6c42ff28e Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 13:33:51 -0500 Subject: [PATCH 20/48] Ran searches. Marked strings with NON-NLS. Fixed font issue. --- .../modules/filetypeid/FileTypeIdGlobalSettingsPanel.java | 6 +++--- .../modules/filetypeid/UserDefinedFileTypesManager.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.java index e0653b5947..0b277672a2 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.java @@ -444,10 +444,10 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane filesSetNameTextField.setText(org.openide.util.NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.filesSetNameTextField.text")); // NOI18N - ingestRunningWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/filetypeid/warning16.png"))); // NOI18N + ingestRunningWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/filetypeid/warning16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(ingestRunningWarningLabel, org.openide.util.NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.ingestRunningWarningLabel.text")); // NOI18N - jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + jLabel1.setFont(jLabel1.getFont().deriveFont(Font.BOLD, 11)); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.jLabel1.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.jLabel2.text")); // NOI18N @@ -624,7 +624,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane byte[] signatureBytes; if (FileType.Signature.Type.RAW == sigType) { try { - sigString = sigString.replaceAll("\\s", ""); + sigString = sigString.replaceAll("\\s", ""); //NON-NLS signatureBytes = DatatypeConverter.parseHexBinary(sigString); } catch (IllegalArgumentException ex) { JOptionPane.showMessageDialog(null, diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/UserDefinedFileTypesManager.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/UserDefinedFileTypesManager.java index c1b0dfe969..5dd48f58f2 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/UserDefinedFileTypesManager.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/UserDefinedFileTypesManager.java @@ -68,7 +68,7 @@ final class UserDefinedFileTypesManager { private static final String SIGNATURE_TYPE_ATTRIBUTE = "type"; //NON-NLS private static final String BYTES_TAG_NAME = "Bytes"; //NON-NLS private static final String OFFSET_TAG_NAME = "Offset"; //NON-NLS - private static final String RELATIVE_ATTRIBUTE = "RelativeToStart"; + private static final String RELATIVE_ATTRIBUTE = "RelativeToStart"; //NON-NLS private static final String INTERESTING_FILES_SET_TAG_NAME = "InterestingFileSset"; //NON-NLS private static final String ALERT_ATTRIBUTE = "alert"; //NON-NLS private static final String ENCODING_FOR_XML_FILE = "UTF-8"; //NON-NLS @@ -230,8 +230,8 @@ final class UserDefinedFileTypesManager { fileTypes.add(fileType); // Add rule for .tga - byteArray = DatatypeConverter.parseHexBinary("54525545564953494F4E2D5846494C452E00"); - fileType = new FileType("image/x-tga", new Signature(byteArray, 17, false), "", false); + byteArray = DatatypeConverter.parseHexBinary("54525545564953494F4E2D5846494C452E00"); //NON-NLS + fileType = new FileType("image/x-tga", new Signature(byteArray, 17, false), "", false); //NON-NLS fileTypes.add(fileType); } // parseHexBinary() throws this if the argument passed in is not Hex From 9c80f70050ff6b2b344fa46987cdaf81dfc24063 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 13:40:18 -0500 Subject: [PATCH 21/48] Ran searches. Marked strings with NON-NLS. Fixed font issue. --- .../modules/hashdatabase/HashLookupSettingsPanel.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashLookupSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashLookupSettingsPanel.java index f55ab6ba68..6d336b290b 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashLookupSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashLookupSettingsPanel.java @@ -506,7 +506,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.jLabel6.text")); // NOI18N - jButton3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jButton3.setFont(jButton3.getFont().deriveFont(Font.PLAIN, 14)); org.openide.awt.Mnemonics.setLocalizedText(jButton3, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.jButton3.text")); // NOI18N setMinimumSize(new java.awt.Dimension(700, 430)); @@ -514,7 +514,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan jPanel1.setPreferredSize(new java.awt.Dimension(671, 430)); - ingestWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png"))); // NOI18N + ingestWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.ingestWarningLabel.text")); // NOI18N hashSetTable.setModel(new javax.swing.table.DefaultTableModel( @@ -534,7 +534,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan }); jScrollPane1.setViewportView(hashSetTable); - deleteDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/delete16.png"))); // NOI18N + deleteDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/delete16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(deleteDatabaseButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.deleteDatabaseButton.text")); // NOI18N deleteDatabaseButton.setMaximumSize(new java.awt.Dimension(140, 25)); deleteDatabaseButton.setMinimumSize(new java.awt.Dimension(140, 25)); @@ -545,7 +545,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan } }); - importDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/import16.png"))); // NOI18N + importDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/import16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(importDatabaseButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.importDatabaseButton.text")); // NOI18N importDatabaseButton.setMaximumSize(new java.awt.Dimension(140, 25)); importDatabaseButton.setMinimumSize(new java.awt.Dimension(140, 25)); @@ -593,7 +593,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan org.openide.awt.Mnemonics.setLocalizedText(optionsLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.optionsLabel.text")); // NOI18N - createDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/new16.png"))); // NOI18N + createDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/new16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(createDatabaseButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.createDatabaseButton.text")); // NOI18N createDatabaseButton.setMaximumSize(new java.awt.Dimension(140, 25)); createDatabaseButton.setMinimumSize(new java.awt.Dimension(140, 25)); From 06d6a4b5004144a878d02ea7e4ee4f72d70c3881 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 13:46:19 -0500 Subject: [PATCH 22/48] Ran searches. Marked strings with NON-NLS. Fixed font issue. Removed unused string from Bundle_ja --- .../modules/interestingitems/Bundle_ja.properties | 1 - .../FilesIdentifierIngestModule.java | 2 +- .../interestingitems/FilesSetRulePanel.java | 2 +- .../InterestingItemDefsManager.java | 8 ++++---- .../interestingitems/InterestingItemDefsPanel.java | 14 +++++++------- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/Bundle_ja.properties index ae17fa6dc4..e84363de1c 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/Bundle_ja.properties +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/Bundle_ja.properties @@ -14,7 +14,6 @@ FilesSetRulePanel.jLabel1.text=\u30D5\u30A1\u30A4\u30EB\u30BF\u30A4\u30D7\uFF1A FilesSetRulePanel.jLabel2.text=\u30CD\u30FC\u30E0\u30D1\u30BF\u30FC\u30F3\uFF1A FilesSetRulePanel.jLabel3.text=\u30D1\u30B9\u30D1\u30BF\u30FC\u30F3\uFF1A FilesSetRulePanel.messages.emptyNameFilter=\u7591\u308F\u3057\u3044\u30D5\u30A1\u30A4\u30EB\u30BB\u30C3\u30C8\u30EB\u30FC\u30EB\u306F\u691C\u7D22\u3059\u308B\u540D\u524D\u304C\u5FC5\u8981\u3067\u3059\u3002 -FilesSetRulePanel.messages.filesSetRulesMustBeNamed=\u7591\u308F\u3057\u3044\u30D5\u30A1\u30A4\u30EB\u30BB\u30C3\u30C8\u30EB\u30FC\u30EB\u306F\u540D\u524D\u304C\u5FC5\u8981\u3067\u3059\u3002 FilesSetRulePanel.messages.invalidCharInName=\u6B63\u898F\u8868\u73FE\u4EE5\u5916\u306F\\\u3001/\u3001\:\u3001*\u3001?\u3001"\u3001<\u3001>\u3092\u540D\u524D\u306B\u542B\u3081\u307E\u305B\u3093\u3002 FilesSetRulePanel.messages.invalidCharInPath=\u6B63\u898F\u8868\u73FE\u4EE5\u5916\u306F\\\u3001\:\u3001*\u3001?\u3001"\u3001<\u3001>\u3092\u30D1\u30B9\u306B\u542B\u3081\u307E\u305B\u3093\u3002 FilesSetRulePanel.messages.invalidNameRegex=\u6B63\u898F\u8868\u73FE\u306F\u6709\u52B9\u306A\u540D\u524D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF1A\n\n{0} diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java index bb89fba38f..ae93cbbc74 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java @@ -130,7 +130,7 @@ final class FilesIdentifierIngestModule implements FileIngestModule { IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(moduleName, BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT, Collections.singletonList(artifact))); } catch (TskCoreException ex) { - FilesIdentifierIngestModule.logger.log(Level.SEVERE, "Error posting to the blackboard", ex); //NOI18N + FilesIdentifierIngestModule.logger.log(Level.SEVERE, "Error posting to the blackboard", ex); //NOI18N NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java index 4a77379207..f45b4e8287 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java @@ -403,7 +403,7 @@ final class FilesSetRulePanel extends javax.swing.JPanel { org.openide.awt.Mnemonics.setLocalizedText(pathRegexCheckBox, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.pathRegexCheckBox.text")); // NOI18N - pathSeparatorInfoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/info-icon-16.png"))); // NOI18N + pathSeparatorInfoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/info-icon-16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(pathSeparatorInfoLabel, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.pathSeparatorInfoLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.jLabel4.text")); // NOI18N diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/InterestingItemDefsManager.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/InterestingItemDefsManager.java index 3a09b34045..781846cabe 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/InterestingItemDefsManager.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/InterestingItemDefsManager.java @@ -258,11 +258,11 @@ final class InterestingItemDefsManager extends Observable { if (!rules.containsKey(rule.getUuid())) { rules.put(rule.getUuid(), rule); } else { - logger.log(Level.SEVERE, "Found duplicate rule {0} for set named {1} in interesting file sets definition file at {2}, discarding malformed set", new Object[]{rule.getUuid(), setName, filePath}); //NOI18N + logger.log(Level.SEVERE, "Found duplicate rule {0} for set named {1} in interesting file sets definition file at {2}, discarding malformed set", new Object[]{rule.getUuid(), setName, filePath}); //NOI18N NON-NLS return; } } else { - logger.log(Level.SEVERE, "Found malformed rule for set named {0} in interesting file sets definition file at {1}, discarding malformed set", new Object[]{setName, filePath}); //NOI18N + logger.log(Level.SEVERE, "Found malformed rule for set named {0} in interesting file sets definition file at {1}, discarding malformed set", new Object[]{setName, filePath}); //NOI18N NON-NLS return; } } @@ -294,7 +294,7 @@ final class InterestingItemDefsManager extends Observable { String content = elem.getTextContent(); FilesSet.Rule.FullNameFilter nameFilter; String regex = elem.getAttribute(FilesSetXML.REGEX_ATTR); - if ((!regex.isEmpty() && regex.equalsIgnoreCase("true")) || content.contains("*")) { // NON_NLS + if ((!regex.isEmpty() && regex.equalsIgnoreCase("true")) || content.contains("*")) { // NON-NLS Pattern pattern = compileRegex(content); if (pattern != null) { nameFilter = new FilesSet.Rule.FullNameFilter(pattern); @@ -352,7 +352,7 @@ final class InterestingItemDefsManager extends Observable { String content = elem.getTextContent(); FilesSet.Rule.ExtensionFilter extFilter; String regex = elem.getAttribute(FilesSetXML.REGEX_ATTR); - if ((!regex.isEmpty() && regex.equalsIgnoreCase("true")) || content.contains("*")) { // NON_NLS + if ((!regex.isEmpty() && regex.equalsIgnoreCase("true")) || content.contains("*")) { // NON-NLS Pattern pattern = compileRegex(content); if (pattern != null) { extFilter = new FilesSet.Rule.ExtensionFilter(pattern); diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/InterestingItemDefsPanel.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/InterestingItemDefsPanel.java index b4e6d5ad89..6e4cd91148 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/InterestingItemDefsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/InterestingItemDefsPanel.java @@ -418,7 +418,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.jLabel6.text")); // NOI18N - newRuleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/add16.png"))); // NOI18N + newRuleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/add16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(newRuleButton, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.newRuleButton.text")); // NOI18N newRuleButton.setEnabled(false); newRuleButton.addActionListener(new java.awt.event.ActionListener() { @@ -431,7 +431,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp org.openide.awt.Mnemonics.setLocalizedText(filesRadioButton, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.filesRadioButton.text")); // NOI18N filesRadioButton.setEnabled(false); - editRuleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/edit16.png"))); // NOI18N + editRuleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/edit16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(editRuleButton, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.editRuleButton.text")); // NOI18N editRuleButton.setEnabled(false); editRuleButton.addActionListener(new java.awt.event.ActionListener() { @@ -452,7 +452,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp setDescriptionTextArea.setRows(2); setDescScrollPanel.setViewportView(setDescriptionTextArea); - editSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/edit16.png"))); // NOI18N + editSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/edit16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(editSetButton, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.editSetButton.text")); // NOI18N editSetButton.setEnabled(false); editSetButton.addActionListener(new java.awt.event.ActionListener() { @@ -500,7 +500,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp org.openide.awt.Mnemonics.setLocalizedText(bothRadioButton, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.bothRadioButton.text")); // NOI18N bothRadioButton.setEnabled(false); - deleteSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/delete16.png"))); // NOI18N + deleteSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/delete16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(deleteSetButton, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.deleteSetButton.text")); // NOI18N deleteSetButton.setEnabled(false); deleteSetButton.addActionListener(new java.awt.event.ActionListener() { @@ -509,7 +509,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp } }); - deleteRuleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/delete16.png"))); // NOI18N + deleteRuleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/delete16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(deleteRuleButton, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.deleteRuleButton.text")); // NOI18N deleteRuleButton.setEnabled(false); deleteRuleButton.addActionListener(new java.awt.event.ActionListener() { @@ -518,7 +518,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp } }); - newSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/add16.png"))); // NOI18N + newSetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/add16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(newSetButton, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.newSetButton.text")); // NOI18N newSetButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -546,7 +546,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp jTextArea1.setEditable(false); jTextArea1.setBackground(new java.awt.Color(240, 240, 240)); jTextArea1.setColumns(20); - jTextArea1.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N + jTextArea1.setFont(jTextArea1.getFont().deriveFont(Font.PLAIN, 11)); jTextArea1.setLineWrap(true); jTextArea1.setRows(3); jTextArea1.setText(org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.jTextArea1.text")); // NOI18N From c9ac85bd4c578e5fda7d57d765d385f20e179a7f Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 13:57:06 -0500 Subject: [PATCH 23/48] Ran searches. Extracted strings. --- .../src/org/sleuthkit/autopsy/modules/iOS/Bundle.properties | 3 +++ .../sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/Bundle.properties b/Core/src/org/sleuthkit/autopsy/modules/iOS/Bundle.properties index 183b0ba88a..8909d23e0e 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/Bundle.properties @@ -1,2 +1,5 @@ iOSModuleFactory.moduleName=iOS Analyzer iOSModuleFactory.moduleDescription=Extracts system and 3rd party app data +TextMessageAnalyzer.bbAttribute.incoming=Incoming +TextMessageAnalyzer.bbAttribute.outgoing=Outgoing +TextMessageAnalyzer.bbAttribute.smsMessage=SMS Message diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java index 0412e2e303..44c08ae0cf 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java @@ -116,17 +116,17 @@ class TextMessageAnalyzer { // @@@ NEed to put into more specific TO or FROM if (type.equals("1")) { - bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DIRECTION, moduleName, "Incoming")); + bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DIRECTION, moduleName, NbBundle.getMessage(this.getClass(), "TextMessageAnalyzer.bbAttribute.incoming"))); bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM, moduleName, address)); } else { - bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DIRECTION, moduleName, "Outgoing")); + bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DIRECTION, moduleName, NbBundle.getMessage(this.getClass(), "TextMessageAnalyzer.bbAttribute.outgoing"))); bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO, moduleName, address)); } bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME, moduleName, date)); bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DIRECTION, moduleName, type)); bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SUBJECT, moduleName, subject)); bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT, moduleName, body)); - bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_MESSAGE_TYPE, moduleName, "SMS Message")); + bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_MESSAGE_TYPE, moduleName, NbBundle.getMessage(this.getClass(), "TextMessageAnalyzer.bbAttribute.smsMessage"))); try { // index the artifact for keyword search From 5c846cf3fae7c7b76cb4d6414aba4e0d42aef27b Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 14:00:20 -0500 Subject: [PATCH 24/48] Ran searches. Fixed mis-spelled NON-NLS tags. --- .../modules/photoreccarver/PhotoRecCarverFileIngestModule.java | 2 +- .../modules/photoreccarver/PhotoRecCarverOutputParser.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java index bb8d8ed62f..f848838d02 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java @@ -214,7 +214,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule { "\"" + outputDirPath.toAbsolutePath() + File.separator + PHOTOREC_RESULTS_BASE + "\"", "/cmd", // NON-NLS "\"" + tempFilePath.toFile() + "\"", - "search"); // NON_NLS + "search"); // NON-NLS // Add environment variable to force PhotoRec to run with the same permissions Autopsy uses processAndSettings.environment().put("__COMPAT_LAYER", "RunAsInvoker"); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java index fabb91e94f..caff08b50c 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java +++ b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java @@ -149,7 +149,7 @@ class PhotoRecCarverOutputParser { } return fileManager.addCarvedFiles(carvedFileContainer); } catch (NumberFormatException | TskCoreException ex) { - logger.log(Level.SEVERE, "Error parsing PhotoRec output and inserting it into the database: {0}", ex); //NON_NLS + logger.log(Level.SEVERE, "Error parsing PhotoRec output and inserting it into the database: {0}", ex); //NON-NLS } List empty = Collections.emptyList(); From 2db1ac9e0b354015917d98b38b7a84b5b1ed066f Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 14:03:27 -0500 Subject: [PATCH 25/48] Ran searches. Tagged strings. --- Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java index 74cda734bf..1d2925060e 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java @@ -173,7 +173,7 @@ class EvalFileObj extends EvaluatableObject { if (h.getSimpleHashValue() != null) { if (h.getType().getValue().equals("MD5")) { //NON-NLS String newClause = ""; - if (h.getSimpleHashValue().getValue().toString().toLowerCase().contains("##comma##")) { + if (h.getSimpleHashValue().getValue().toString().toLowerCase().contains("##comma##")) { //NON-NLS String[] parts = h.getSimpleHashValue().getValue().toString().toLowerCase().split("##comma##"); //NON-NLS String hashList = ""; for (String s : parts) { @@ -182,7 +182,7 @@ class EvalFileObj extends EvaluatableObject { } hashList += "\'" + s + "\'"; } - newClause = "md5 IN (" + hashList + ")"; + newClause = "md5 IN (" + hashList + ")"; //NON-NLS } else { newClause = "md5=\'" + h.getSimpleHashValue().getValue().toString().toLowerCase() + "\'"; //NON-NLS } From 00b4ca26ceae2dc20beeed82f5ab874e1651c048 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 14:11:52 -0500 Subject: [PATCH 26/48] Ran searches. Tagged strings. Created empty Bundle_Ja. --- .../UserArtifacts/Bundle_ja.properties | 0 .../UserArtifactIngestModule.java | 22 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/Bundle_ja.properties diff --git a/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/Bundle_ja.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java index eed24aa489..35ae84f9ff 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java @@ -42,8 +42,8 @@ public class UserArtifactIngestModule implements DataSourceIngestModule { progressBar.switchToDeterminate(2); try { FileManager manager = Case.getCurrentCase().getServices().getFileManager(); - List file1 = manager.findFiles("Sunset.jpg"); - List file2 = manager.findFiles("Winter.jpg"); + List file1 = manager.findFiles("Sunset.jpg"); //NON-NLS + List file2 = manager.findFiles("Winter.jpg"); //NON-NLS BlackboardArtifact art1; BlackboardArtifact art2; if (!file1.isEmpty()) { @@ -56,8 +56,8 @@ public class UserArtifactIngestModule implements DataSourceIngestModule { } else { art2 = dataSource.newArtifact(type2.getTypeID()); } - BlackboardAttribute.Type attributeType = Case.getCurrentCase().getServices().getBlackboard().addAttributeType("Test", TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.LONG, "2"); - BlackboardAttribute.Type attributeType2 = Case.getCurrentCase().getServices().getBlackboard().addAttributeType("Test2", TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.BYTE, "3"); + BlackboardAttribute.Type attributeType = Case.getCurrentCase().getServices().getBlackboard().addAttributeType("Test", TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.LONG, "2"); //NON-NLS + BlackboardAttribute.Type attributeType2 = Case.getCurrentCase().getServices().getBlackboard().addAttributeType("Test2", TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.BYTE, "3"); //NON-NLS art1.addAttribute(new BlackboardAttribute(attributeType, UserArtifactIngestModuleFactory.getModuleName(), -1L)); progressBar.progress(1); @@ -65,14 +65,16 @@ public class UserArtifactIngestModule implements DataSourceIngestModule { UserArtifactIngestModuleFactory.getModuleName(), new byte[7])); progressBar.progress(1); IngestServices.getInstance().postMessage(IngestMessage.createDataMessage( - "name", + "name", // NON-NLS UserArtifactIngestModuleFactory.getModuleName(), - "Test Results", - "Test", + "Test Results", //NON-NLS + "Test", //NON-NLS art1)); return ProcessResult.OK; } catch (TskCoreException ex) { return ProcessResult.ERROR; + } catch (TskDataException ex) { + return ProcessResult.ERROR; } catch (BlackboardException ex) { return ProcessResult.ERROR; } @@ -82,10 +84,10 @@ public class UserArtifactIngestModule implements DataSourceIngestModule { public void startUp(IngestJobContext context) throws IngestModuleException { this.context = context; try { - type1 = Case.getCurrentCase().getServices().getBlackboard().addArtifactType("This is", "a test"); - type2 = Case.getCurrentCase().getServices().getBlackboard().addArtifactType("Another", "kinda test"); + type1 = Case.getCurrentCase().getServices().getBlackboard().addArtifactType("This is", "a test"); //NON-NLS + type2 = Case.getCurrentCase().getServices().getBlackboard().addArtifactType("Another", "kinda test"); //NON-NLS } catch (BlackboardException ex) { - Logger.logMsg(Logger.ERROR, "Startup failed"); + Logger.logMsg(Logger.ERROR, "Startup failed"); //NON-NLS } } } From 1347e489a46d1e60c200e9d5253ce6fb59a9239d Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 14:23:08 -0500 Subject: [PATCH 27/48] Ran searches. Tagged strings. Created empty Bundle_Ja. Extracted strings. --- .../modules/vmextractor/Bundle.properties | 6 +++- .../modules/vmextractor/Bundle_ja.properties | 0 .../vmextractor/VMExtractorIngestModule.java | 36 ++++++++++--------- .../vmextractor/VirtualMachineFinder.java | 6 ++-- 4 files changed, 27 insertions(+), 21 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/modules/vmextractor/Bundle_ja.properties diff --git a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/Bundle.properties b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/Bundle.properties index 3d27e2869b..7d56265f3d 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/Bundle.properties @@ -5,4 +5,8 @@ VMExtractorIngestModule.cannotCreateOutputDir.message=Unable to create output di VMExtractorIngestModule.addedVirtualMachineImage.message=Added virtual machine image {0} VMExtractorIngestModule.searchingImage.message=Searching image for virtual machine files VMExtractorIngestModule.exportingToDisk.message=Exporting virtual machine files to disk -VMExtractorIngestModule.queuingIngestJobs.message=Queuing ingest jobs for extracted virtual machines \ No newline at end of file +VMExtractorIngestModule.queuingIngestJobs.message=Queuing ingest jobs for extracted virtual machines +VMExtractorIngestModule.msgNotify.failedExtractVM.title.txt=Failed to extract virtual machine file +VMExtractorIngestModule.msgNotify.failedExtractVM.msg.txt=Failed to write virtual machine file {0} to disk. +VMExtractorIngestModule.msgNotify.failedIngestVM.title.txt=Failed to ingest virtual machine +VMExtractorIngestModule.msgNotify.failedIngestVM.msg.txt=Failed to ingest virtual machine file {0} \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/Bundle_ja.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java index 73fdf77989..c94dc2e2a8 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java @@ -81,7 +81,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { } } if (null == parentDataSourceId) { - throw new IngestModuleException(String.format("Data source %s missing unique id", context.getDataSource().getName())); + throw new IngestModuleException(String.format("Data source %s missing unique id", context.getDataSource().getName())); //NON-NLS } SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss"); String timeStamp = dateFormat.format(Calendar.getInstance().getTime()); @@ -108,19 +108,19 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { // Not sure how long it will take for search to complete. progressBar.switchToIndeterminate(); - logger.log(Level.INFO, "Looking for virtual machine files in data source {0}", dataSource.getName()); + logger.log(Level.INFO, "Looking for virtual machine files in data source {0}", dataSource.getName()); //NON-NLS try { // look for all VM files vmFiles = findVirtualMachineFiles(dataSource); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error querying case database", ex); + logger.log(Level.SEVERE, "Error querying case database", ex); //NON-NLS return ProcessResult.ERROR; } if (vmFiles.isEmpty()) { // no VM files found - logger.log(Level.INFO, "No virtual machine files found in data source {0}", dataSource.getName()); + logger.log(Level.INFO, "No virtual machine files found in data source {0}", dataSource.getName()); //NON-NLS return ProcessResult.OK; } // display progress for saving each VM file to disk @@ -133,7 +133,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { break; } - logger.log(Level.INFO, "Saving virtual machine file {0} to disk", vmFile.getName()); + logger.log(Level.INFO, "Saving virtual machine file {0} to disk", vmFile.getName()); //NON-NLS // get vmFolderPathInsideTheImage to the folder where VM is located String vmFolderPathInsideTheImage = vmFile.getParentPath(); @@ -155,15 +155,16 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { try { writeVirtualMachineToDisk(vmFile, outputFolderForThisVM); } catch (Exception ex) { - logger.log(Level.SEVERE, "Failed to write virtual machine file "+vmFile.getName()+" to folder "+outputFolderForThisVM, ex); - MessageNotifyUtil.Notify.error("Failed to extract virtual machine file", String.format("Failed to write virtual machine file %s to disk", vmFile.getName())); + logger.log(Level.SEVERE, "Failed to write virtual machine file "+vmFile.getName()+" to folder "+outputFolderForThisVM, ex); //NON-NLS + MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.msgNotify.failedExtractVM.title.txt"), + NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.msgNotify.failedExtractVM.msg.txt", vmFile.getName())); } // Update progress bar numFilesSaved++; progressBar.progress(NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.exportingToDisk.message"), numFilesSaved); } - logger.log(Level.INFO, "Finished saving virtual machine files to disk"); + logger.log(Level.INFO, "Finished saving virtual machine files to disk"); //NON-NLS // update progress bar progressBar.switchToDeterminate(imageFolderToOutputFolder.size()); @@ -180,26 +181,27 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { List vmFilesToIngest = VirtualMachineFinder.identifyVirtualMachines(Paths.get(folder)); for (String file : vmFilesToIngest) { try { - logger.log(Level.INFO, "Ingesting virtual machine file {0} in folder {1}", new Object[]{file, folder}); + logger.log(Level.INFO, "Ingesting virtual machine file {0} in folder {1}", new Object[]{file, folder}); //NON-NLS // for extracted virtual machines there is no manifest XML file to read data source ID from so we need to create one numDataSourcesQueued++; - String dataSourceID = parentDataSourceId + "-VM" + numDataSourcesQueued; + String dataSourceID = parentDataSourceId + "-VM" + numDataSourcesQueued; //NON-NLS // ingest the data sources ingestVirtualMachineImage(Paths.get(folder, file), dataSourceID); - logger.log(Level.INFO, "Ingest complete for virtual machine file {0} in folder {1}", new Object[]{file, folder}); + logger.log(Level.INFO, "Ingest complete for virtual machine file {0} in folder {1}", new Object[]{file, folder}); //NON-NLS } catch (InterruptedException ex) { - logger.log(Level.INFO, "Interrupted while ingesting virtual machine file "+file+" in folder "+folder, ex); + logger.log(Level.INFO, "Interrupted while ingesting virtual machine file "+file+" in folder "+folder, ex); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to ingest virtual machine file "+file+" in folder "+folder, ex); - MessageNotifyUtil.Notify.error("Failed to ingest virtual machine", String.format("Failed to ingest virtual machine file %s", file)); + logger.log(Level.SEVERE, "Failed to ingest virtual machine file "+file+" in folder "+folder, ex); //NON-NLS + MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.msgNotify.failedIngestVM.title.txt"), + NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.msgNotify.failedIngestVM.msg.txt", file)); } } // Update progress bar numJobsQueued++; progressBar.progress(NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.queuingIngestJobs.message"), numJobsQueued); } - logger.log(Level.INFO, "VMExtractorIngestModule completed processing of data source {0}", dataSource.getName()); + logger.log(Level.INFO, "VMExtractorIngestModule completed processing of data source {0}", dataSource.getName()); //NON-NLS return ProcessResult.OK; } @@ -278,7 +280,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { List dataSourceContent = new ArrayList<>(dspCallback.vmDataSources); IngestJobSettings ingestJobSettings = new IngestJobSettings(context.getExecutionContext()); for (String warning : ingestJobSettings.getWarnings()) { - logger.log(Level.WARNING, String.format("Ingest job settings warning for virtual machine file %s : %s", vmFile.toString(), warning)); + logger.log(Level.WARNING, String.format("Ingest job settings warning for virtual machine file %s : %s", vmFile.toString(), warning)); //NON-NLS } IngestServices.getInstance().postMessage(IngestMessage.createMessage(IngestMessage.MessageType.INFO, VMExtractorIngestModuleFactory.getModuleName(), @@ -333,7 +335,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { @Override public void done(DataSourceProcessorCallback.DataSourceProcessorResult result, List errList, List content) { for (String error : errList) { - String logMessage = String.format("Data source processor error for virtual machine file %s: %s", vmFile.toString(), error); + String logMessage = String.format("Data source processor error for virtual machine file %s: %s", vmFile.toString(), error); //NON-NLS if (DataSourceProcessorCallback.DataSourceProcessorResult.CRITICAL_ERRORS == result) { logger.log(Level.SEVERE, logMessage); } else { diff --git a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VirtualMachineFinder.java b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VirtualMachineFinder.java index c971d63392..19f51d8ab6 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VirtualMachineFinder.java +++ b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VirtualMachineFinder.java @@ -50,7 +50,7 @@ public final class VirtualMachineFinder { vmFiltersList.add(virtualMachineFilter); } - private static final List VMDK_EXTS = Arrays.asList(new String[]{".vmdk"}); + private static final List VMDK_EXTS = Arrays.asList(new String[]{".vmdk"}); //NON-NLS private static final GeneralFilter vmdkFilter = new GeneralFilter(VMDK_EXTS, ""); private static final List vmdkFiltersList = new ArrayList<>(); @@ -135,7 +135,7 @@ public final class VirtualMachineFinder { // line doesn't have enough fields, can't be an extent descriptor continue; } - if (splited[0].equals("RW") || splited[0].equals("RDONLY") || splited[0].equals("NOACCESS")) { + if (splited[0].equals("RW") || splited[0].equals("RDONLY") || splited[0].equals("NOACCESS")) { //NON-NLS // found an extent descriptor // remove quotation marks around the file name String extentFileName = splited[FILE_NAME_FIELD_INDX_IN_EXTENT_DESCRIPTOR].replace("\"", ""); @@ -145,7 +145,7 @@ public final class VirtualMachineFinder { } } } catch (Exception ex) { - logger.log(Level.WARNING, String.format("Error while parsing vmdk descriptor file %s", file.toString()), ex); + logger.log(Level.WARNING, String.format("Error while parsing vmdk descriptor file %s", file.toString()), ex); //NON-NLS } return extentFiles; } From dc30c3dd09be099b1b1ee2e71912586f21a1b5d0 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 14:26:33 -0500 Subject: [PATCH 28/48] Ran searches. Tagged strings. Created empty Bundle_Ja. --- Core/src/org/sleuthkit/autopsy/python/Bundle_ja.properties | 0 Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/python/Bundle_ja.properties diff --git a/Core/src/org/sleuthkit/autopsy/python/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/python/Bundle_ja.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java b/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java index 93bd39d5d9..c9175f3754 100755 --- a/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java +++ b/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java @@ -74,7 +74,7 @@ public final class JythonModuleLoader { // add python modules from 'autospy/build/cluster/InternalPythonModules' folder // which are copied from 'autopsy/*/release/InternalPythonModules' folders. - for (File f : InstalledFileLocator.getDefault().locateAll("InternalPythonModules", JythonModuleLoader.class.getPackage().getName(), false)) { + for (File f : InstalledFileLocator.getDefault().locateAll("InternalPythonModules", JythonModuleLoader.class.getPackage().getName(), false)) { //NON-NLS Collections.addAll(pythonModuleDirs, f.listFiles()); } // add python modules from 'testuserdir/python_modules' folder @@ -127,7 +127,7 @@ public final class JythonModuleLoader { interpreter.exec("reload(" + moduleName + ")"); //NON-NLS // Importing the appropriate class from the Py Script which contains multiple classes. - interpreter.exec("from " + moduleName + " import " + className); + interpreter.exec("from " + moduleName + " import " + className); //NON-NLS interpreter.exec("obj = " + className + "()"); //NON-NLS T obj = interpreter.get("obj", interfaceClass); //NON-NLS From 46326894d421f715082a7b95bbab85c4d7abef3c Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Fri, 29 Jan 2016 14:33:11 -0500 Subject: [PATCH 29/48] Ran searches. Tagged strings.Fixed fonts. --- Core/src/org/sleuthkit/autopsy/report/Bundle_ja.properties | 4 ---- .../org/sleuthkit/autopsy/report/ReportGenerationPanel.java | 2 +- .../src/org/sleuthkit/autopsy/report/ReportProgressPanel.java | 4 ++-- Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel1.java | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/report/Bundle_ja.properties index 254310d0c5..c6c931baad 100644 --- a/Core/src/org/sleuthkit/autopsy/report/Bundle_ja.properties +++ b/Core/src/org/sleuthkit/autopsy/report/Bundle_ja.properties @@ -11,11 +11,9 @@ ReportVisualPanel2.advancedButton.text=\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7 ArtifactSelectionDialog.deselectAllButton.text=\u3059\u3079\u3066\u9078\u629E\u89E3\u9664 ArtifactSelectionDialog.selectAllButton.text=\u3059\u3079\u3066\u9078\u629E ReportGenerationPanel.closeButton.text=\u9589\u3058\u308B -ReportGenerationPanel.cancelAllButton.text=\u3059\u3079\u3066\u30AD\u30E3\u30F3\u30BB\u30EB ReportProgressPanel.reportLabel.text=\u30EC\u30DD\u30FC\u30C8\u30E9\u30D9\u30EB ReportProgressPanel.pathLabel.text=\u30D1\u30B9\u30E9\u30D9\u30EB ReportProgressPanel.separationLabel.text=- -ReportProgressPanel.cancelButton.toolTipText=\u30AD\u30E5\u30FC\u30A4\u30F3\u30B0 ReportProgressPanel.processingLabel.text=\u30D7\u30ED\u30BB\u30B7\u30F3\u30B0\u30E9\u30D9\u30EB ReportGenerationPanel.titleLabel.text=\u30EC\u30DD\u30FC\u30C8\u751F\u6210\u30D7\u30ED\u30B0\u30EC\u30B9 ReportVisualPanel2.taggedResultsRadioButton.text=\u30BF\u30B0\u4ED8\u3051\u3055\u308C\u305F\u7D50\u679C @@ -59,7 +57,6 @@ ReportExcel.cellVal.examiner=\u8ABF\u67FB\u62C5\u5F53\u8005\uFF1A ReportExcel.cellVal.numImages=\u30A4\u30E1\u30FC\u30B8\u6570\uFF1A ReportGenerationPanel.confDlg.sureToClose.msg=\u3053\u306E\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u672C\u5F53\u306B\u9589\u3058\u307E\u3059\u304B\uFF1F\n\u5168\u3066\u306E\u30EC\u30DD\u30FC\u30C8\u304C\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3059\u3002 ReportGenerationPanel.confDlg.title.closing=\u9589\u3058\u3066\u3044\u307E\u3059 -ReportGenerationPanel.confDlg.cancelReports.msg=\u5168\u3066\u306E\u30EC\u30DD\u30FC\u30C8\u3092\u672C\u5F53\u306B\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3059\u304B\uFF1F ReportGenerator.displayProgress.title.text=\u30EC\u30DD\u30FC\u30C8\u751F\u6210\u30D7\u30ED\u30B0\u30EC\u30B9\u2026 ReportGenerator.progress.queryingDb.text=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u30AF\u30A8\u30EA\u3092\u5B9F\u884C\u4E2D\u2026 ReportGenerator.progress.processingFile.text={0}\u3092\u51E6\u7406\u4E2D @@ -180,7 +177,6 @@ ReportWizardPanel1.finishButton.text=\u7D42\u4E86 ReportWizardPanel2.finishButton.text=\u7D42\u4E86 ReportHTML.writeSum.reportGenOn.text={0}\u306BHTML\u30EC\u30DD\u30FC\u30C8\u306F\u751F\u6210\u3055\u308C\u307E\u3057\u305F ReportHTML.writeSum.noCaseNum=\u30B1\u30FC\u30B9\u756A\u53F7\u304C\u3042\u308A\u307E\u305B\u3093 -ReportProgressPanel.cancelButton.text=\u30AD\u30E3\u30F3\u30BB\u30EB ReportGenerator.errors.reportErrorTitle=\u30EC\u30DD\u30FC\u30C8\u751F\u6210\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F ReportGenerator.errors.reportErrorText=\u30EC\u30DD\u30FC\u30C8\u751F\u6210\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\uFF1A ReportKML.getDesc.text=\u95A2\u9023\u30D5\u30A1\u30A4\u30EB\u306E\u5EA7\u6A19\u3092\u542B\u3080KML\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u306E\u30EC\u30DD\u30FC\u30C8\u3002\u3053\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u306FGoogle Earth\u30D3\u30E5\u30FC\u306B\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java index f486cc5b50..064f39f044 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java @@ -157,7 +157,7 @@ class ReportGenerationPanel extends javax.swing.JPanel { reportScrollPane.setViewportView(reportPanel); - titleLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD, 11)); 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/ReportProgressPanel.java b/Core/src/org/sleuthkit/autopsy/report/ReportProgressPanel.java index 24baeafc0c..26776ee02e 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportProgressPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportProgressPanel.java @@ -308,12 +308,12 @@ public class ReportProgressPanel extends javax.swing.JPanel { setMinimumSize(new java.awt.Dimension(486, 68)); - reportLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + reportLabel.setFont(reportLabel.getFont().deriveFont(Font.BOLD, 11)); 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(processingLabel.getFont().deriveFont(Font.ITALIC, 10)); 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 diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel1.java b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel1.java index 9b6acfd092..7c2bc5193c 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel1.java @@ -143,7 +143,7 @@ final class ReportVisualPanel1 extends JPanel implements ListSelectionListener { private void popupWarning(ReportModule module) { String moduleClassName = module.getClass().getSimpleName(); - logger.log(Level.WARNING, "Invalid ReportModule: {0}", moduleClassName); // NON_NLS + logger.log(Level.WARNING, "Invalid ReportModule: {0}", moduleClassName); // NON_NLS NON-NLS DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message( NbBundle.getMessage(ReportVisualPanel1.class, "ReportVisualPanel1.invalidModuleWarning", moduleClassName), NotifyDescriptor.ERROR_MESSAGE)); From 37e6986b308ae974ae0c95350e878dc568a4cfa3 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sat, 30 Jan 2016 09:19:45 -0500 Subject: [PATCH 30/48] Tidy up user artifacts module and fix compiler error --- .../UserArtifactIngestModule.java | 36 +++++++++---------- .../UserArtifactIngestModuleFactory.java | 31 ++++++++++------ 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java index 35ae84f9ff..5b510519ed 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java @@ -1,14 +1,25 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Autopsy Forensic Browser + * + * Copyright 2011-2016 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.sleuthkit.autopsy.modules.UserArtifacts; import com.sun.media.jfxmedia.logging.Logger; import java.util.List; -import org.openide.util.Exceptions; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.services.Blackboard.BlackboardException; import org.sleuthkit.autopsy.casemodule.services.FileManager; @@ -17,24 +28,18 @@ import org.sleuthkit.autopsy.ingest.DataSourceIngestModuleProgress; import org.sleuthkit.autopsy.ingest.IngestJobContext; import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestServices; -import org.sleuthkit.autopsy.modules.hashdatabase.HashDbIngestModule; -import org.sleuthkit.autopsy.modules.hashdatabase.HashLookupModuleFactory; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; -import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE; import org.sleuthkit.datamodel.BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.TskCoreException; -import org.sleuthkit.datamodel.TskDataException; /** - * - * @author oliver + * Test module that creates new artifact and attribute types. */ public class UserArtifactIngestModule implements DataSourceIngestModule { - private IngestJobContext context = null; private BlackboardArtifact.Type type1, type2; @Override @@ -71,18 +76,13 @@ public class UserArtifactIngestModule implements DataSourceIngestModule { "Test", //NON-NLS art1)); return ProcessResult.OK; - } catch (TskCoreException ex) { - return ProcessResult.ERROR; - } catch (TskDataException ex) { - return ProcessResult.ERROR; - } catch (BlackboardException ex) { + } catch (TskCoreException | BlackboardException ex) { return ProcessResult.ERROR; } } @Override public void startUp(IngestJobContext context) throws IngestModuleException { - this.context = context; try { type1 = Case.getCurrentCase().getServices().getBlackboard().addArtifactType("This is", "a test"); //NON-NLS type2 = Case.getCurrentCase().getServices().getBlackboard().addArtifactType("Another", "kinda test"); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModuleFactory.java b/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModuleFactory.java index f7e6b010d7..b63d9f928a 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModuleFactory.java +++ b/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModuleFactory.java @@ -1,25 +1,35 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Autopsy Forensic Browser + * + * Copyright 2011-2016 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.sleuthkit.autopsy.modules.UserArtifacts; import org.openide.util.NbBundle; -import org.openide.util.lookup.ServiceProvider; import org.python.apache.xmlcommons.Version; import org.sleuthkit.autopsy.ingest.DataSourceIngestModule; -import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter; import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings; /** - * - * @author oliver + * Factory for test module that creates new artifact and attribute types. */ //@ServiceProvider(service = IngestModuleFactory.class) public class UserArtifactIngestModuleFactory extends IngestModuleFactoryAdapter { - + static String getModuleName() { return NbBundle.getMessage(UserArtifactIngestModuleFactory.class, "UserArtifactIngestModuleFactory.moduleName"); } @@ -33,16 +43,17 @@ public class UserArtifactIngestModuleFactory extends IngestModuleFactoryAdapter public String getModuleDescription() { return NbBundle.getMessage(UserArtifactIngestModuleFactory.class, "UserArtifactIngestModuleFactory.moduleDescription"); } - + @Override public String getModuleVersionNumber() { return Version.getVersion(); } - + @Override public DataSourceIngestModule createDataSourceIngestModule(IngestModuleIngestJobSettings ingestOptions) { return new UserArtifactIngestModule(); } + @Override public boolean isDataSourceIngestModuleFactory() { return true; From 94a7a4addd083c238bf860169f445f8548925709 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sat, 30 Jan 2016 09:42:45 -0500 Subject: [PATCH 31/48] Revert "1501 ja imagegallery" --- .../autopsy/imagegallery/Bundle.properties | 18 -- .../autopsy/imagegallery/Bundle_ja.properties | 0 .../autopsy/imagegallery/FXMLConstructor.java | 6 +- .../imagegallery/FileIDSelectionModel.java | 4 +- .../autopsy/imagegallery/FileTypeUtils.java | 50 ++-- .../imagegallery/ImageGalleryController.java | 81 +++--- .../imagegallery/ImageGalleryModule.java | 4 +- .../ImageGalleryOptionsPanel.java | 7 +- .../imagegallery/ImageGalleryPreferences.java | 2 +- .../ImageGalleryTopComponent.java | 41 +-- .../imagegallery/PerCaseProperties.java | 6 +- .../autopsy/imagegallery/ThumbnailCache.java | 12 +- .../actions/AddDrawableTagAction.java | 20 +- .../imagegallery/actions/AddTagAction.java | 10 +- .../autopsy/imagegallery/actions/Back.java | 5 +- .../imagegallery/actions/Bundle.properties | 24 -- .../imagegallery/actions/Bundle_ja.properties | 0 .../actions/CategorizeAction.java | 17 +- .../actions/DeleteFollowUpTagAction.java | 5 +- .../autopsy/imagegallery/actions/Forward.java | 5 +- .../imagegallery/actions/NextUnseenGroup.java | 9 +- .../imagegallery/actions/OpenAction.java | 12 +- .../actions/OpenExternalViewerAction.java | 6 +- .../imagegallery/actions/OpenHelpAction.java | 6 +- .../imagegallery/actions/RedoAction.java | 5 +- .../imagegallery/actions/UndoAction.java | 5 +- .../imagegallery/datamodel/Bundle.properties | 23 -- .../datamodel/Bundle_ja.properties | 0 .../imagegallery/datamodel/Category.java | 15 +- .../datamodel/CategoryManager.java | 14 +- .../datamodel/DrawableAttribute.java | 78 +++--- .../imagegallery/datamodel/DrawableDB.java | 254 +++++++++--------- .../imagegallery/datamodel/DrawableFile.java | 14 +- .../datamodel/DrawableTagsManager.java | 11 +- .../datamodel/HashSetManager.java | 2 +- .../imagegallery/datamodel/ImageFile.java | 2 +- .../imagegallery/datamodel/VideoFile.java | 7 +- .../datamodel/grouping/Bundle.properties | 7 - .../datamodel/grouping/Bundle_ja.properties | 0 .../datamodel/grouping/DrawableGroup.java | 6 +- .../datamodel/grouping/GroupKey.java | 2 +- .../datamodel/grouping/GroupManager.java | 37 ++- .../datamodel/grouping/GroupSortBy.java | 11 +- .../imagegallery/gui/Bundle.properties | 3 - .../imagegallery/gui/Bundle_ja.properties | 0 .../imagegallery/gui/NoGroupsDialog.java | 2 +- .../autopsy/imagegallery/gui/StatusBar.java | 9 +- .../imagegallery/gui/SummaryTablePane.java | 2 +- .../autopsy/imagegallery/gui/Toolbar.java | 4 +- .../autopsy/imagegallery/gui/VideoPlayer.java | 24 +- .../gui/drawableviews/Bundle.properties | 5 - .../gui/drawableviews/Bundle_ja.properties | 0 .../gui/drawableviews/DrawableTile.java | 4 +- .../gui/drawableviews/DrawableTileBase.java | 18 +- .../gui/drawableviews/DrawableUIBase.java | 4 +- .../gui/drawableviews/DrawableView.java | 2 +- .../gui/drawableviews/GroupPane.java | 14 +- .../gui/drawableviews/MetaDataPane.java | 5 +- .../gui/drawableviews/SlideShowView.java | 8 +- .../gui/navpanel/Bundle.properties | 7 - .../gui/navpanel/Bundle_ja.properties | 0 .../gui/navpanel/GroupComparators.java | 12 +- .../gui/navpanel/GroupListCell.java | 8 +- .../imagegallery/gui/navpanel/GroupTree.java | 7 +- .../gui/navpanel/GroupTreeCell.java | 8 +- .../gui/navpanel/HashHitGroupList.java | 7 +- 66 files changed, 425 insertions(+), 571 deletions(-) delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle_ja.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle_ja.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle_ja.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle_ja.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle_ja.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle_ja.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle.properties delete mode 100644 ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle_ja.properties diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties index 997f7045a8..b7d2ba3d30 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle.properties @@ -4,9 +4,6 @@ OpenIDE-Module-Long-Description=\ It is not available on the sleuthkit.org site and has been distributed to limited users. OpenIDE-Module-Name=ImageGallery OpenIDE-Module-Short-Description=Advanced image and video gallery -CTL_ImageGalleryAction=Image/Video Gallery -CTL_ImageGalleryTopComponent=Image/Video Gallery -HINT_ImageGalleryTopComponent=This is a Image/Video Gallery window ImageGalleryOptionsPanel.enabledForCaseBox.text=Enable Image Gallery updates for the current case. ImageGalleryOptionsPanel.enabledByDefaultBox.text=Enable Image Gallery for new cases by default. ImageGalleryOptionsPanel.enabledForCaseBox.toolTipText=If Image Gallery is disabled, only the fact that an update is needed is recorded. If Image Gallery is enabled after ingest, it will do one bulk update based on the results form ingest. If Image Gallery is disabled, you will be prompted to enable it when attempting to open its window. @@ -14,18 +11,3 @@ ImageGalleryOptionsPanel.descriptionLabel.text=To minimize its startup tim ImageGalleryOptionsPanel.furtherDescriptionArea.text=If Image Gallery is disabled, only the fact that an update is needed is recorded. If Image Gallery is enabled after ingest, it will do one bulk update based on the results form ingest. If Image Gallery is disabled, you will be prompted to enable it when attempting to open its window. ImageGalleryOptionsPanel.unavailableDuringInjestLabel.text=This setting is unavailable during ingest. ImageGalleryOptionsPanel.infoIconLabel.text= -ImageGalleryController.checkForGroups.noGroups1.txt=No groups are fully analyzed; but listening to ingest is disabled. No groups will be available until ingest is finished and listening is re-enabled. -ImageGalleryController.checkForGroups.noGroups2.txt=No groups are fully analyzed yet, but ingest is still ongoing. Please Wait. -ImageGalleryController.checkForGroups.noGroups3.txt=No groups are fully analyzed yet, but image / video data is still being populated. Please Wait. -ImageGalleryController.checkForGroups.noGroups4.txt=There are no images/videos available from the added datasources; but listening to ingest is disabled. No groups will be available until ingest is finished and listening is re-enabled. -ImageGalleryController.checkForGroups.noGroups5.txt=There are no images/videos in the added datasources. -ImageGalleryController.checkForGroups.noGroups6.txt=There are no fully analyzed groups to display\: the current Group By setting resulted in no groups, or no groups are fully analyzed but ingest is not running. -ImageGalleryController.innerTask.property.progress=progress -ImageGalleryController.innerTask.property.message=status -ImageGalleryController.copyAnalyzedFile.progress.txt=populating analyzed image/video database -ImageGalleryController.copyAnalyzedFile.progress2=commiting image/video database -ImageGalleryController.copyAnalyzedFile.progress.stop=Stopping copy to drawable db task. -ImageGalleryController.prePopulateDataSourceFiles.progress=prepopulating image/video database -ImageGalleryController.prePopulateDataSourceFiles.progress2=commiting image/video database -ImageGalleryModule.moduleName.txt=Image Gallery -ImageGalleryController.notifyMsg.errPopulatingDb.txt=There was an error populating Image Gallery database. diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/Bundle_ja.properties deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java index ec846c1f36..55d45ac5f5 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java @@ -39,7 +39,7 @@ public class FXMLConstructor { private static Logger logger = Logger.getLogger(FXMLConstructor.class.getName()); static public void construct(Object n, String fxmlFileName) { - final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; //NON-NLS + final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; try { FXMLLoader fxmlLoader = new FXMLLoader(new URL(name)); @@ -53,12 +53,12 @@ public class FXMLConstructor { fxmlLoader.setClassLoader(FXMLLoader.getDefaultClassLoader()); fxmlLoader.load(); } catch (IOException ex) { - String msg = String.format("Failed to load fxml file %s", fxmlFileName); //NON-NLS + String msg = String.format("Failed to load fxml file %s", fxmlFileName); logger.log(Level.SEVERE, msg, ex); } } } catch (MalformedURLException ex) { - String msg = String.format("Malformed URL %s", name); //NON-NLS + String msg = String.format("Malformed URL %s", name); logger.log(Level.SEVERE, msg, ex); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java index 812ace17e9..e2109389fd 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java @@ -72,7 +72,7 @@ public class FileIDSelectionModel { try { fileNodes.add(new FileNode(controller.getSleuthKitCase().getAbstractFileById(id))); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); } } FileNode[] fileNodeArray = fileNodes.stream().toArray(FileNode[]::new); @@ -84,7 +84,7 @@ public class FileIDSelectionModel { try { etc.getExplorerManager().setSelectedNodes(fileNodeArray); } catch (PropertyVetoException ex) { - LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); } }); }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java index fba07ee2a6..4498021484 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java @@ -93,31 +93,31 @@ public enum FileTypeUtils { .collect(Collectors.toList())); //add list of known image extensions imageExtensions.addAll(Arrays.asList( - "bmp" //Bitmap NON-NLS - , "gif" //gif NON-NLS - , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants NON-NLS - , "pbm", "pgm", "ppm" // Portable image format variants NON-NLS - , "png" //portable network graphic NON-NLS - , "tga" //targa NON-NLS - , "psd" //photoshop NON-NLS - , "tif", "tiff" //tiff variants NON-NLS - , "yuv", "ico" //icons NON-NLS - , "ai" //illustrator NON-NLS - , "svg" //scalable vector graphics NON-NLS - , "sn", "ras" //sun raster NON-NLS - , "ico" //windows icons NON-NLS - , "tga" //targa NON-NLS + "bmp" //Bitmap + , "gif" //gif + , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants + , "pbm", "pgm", "ppm" // Portable image format variants + , "png" //portable network graphic + , "tga" //targa + , "psd" //photoshop + , "tif", "tiff" //tiff variants + , "yuv", "ico" //icons + , "ai" //illustrator + , "svg" //scalable vector graphics + , "sn", "ras" //sun raster + , "ico" //windows icons + , "tga" //targa )); //add list of known video extensions - videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", // NON-NLS - "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", // NON-NLS - "rm", "wmv", "mpv", "flv", "swf")); // NON-NLS + videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", + "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", + "rm", "wmv", "mpv", "flv", "swf")); supportedExtensions = Sets.union(imageExtensions, videoExtensions); //add list of mimetypes to count as videos even though they aren't prefixed by video/ - videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); // NON-NLS + videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); supportedMimeTypes.addAll(videoMimeTypes); @@ -128,14 +128,14 @@ public enum FileTypeUtils { * fixed, we should remove application/x-123 from the list of supported * mime types. */ - supportedMimeTypes.addAll(Arrays.asList("application/x-123")); // NON-NLS + supportedMimeTypes.addAll(Arrays.asList("application/x-123")); //add list of mimetypes ImageIO claims to support supportedMimeTypes.addAll(Stream.of(ImageIO.getReaderMIMETypes()) .map(String::toLowerCase) .collect(Collectors.toList())); - supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rarely usefull NON-NLS + supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rarely usefull } public static Set getAllSupportedMimeTypes() { @@ -151,7 +151,7 @@ public enum FileTypeUtils { try { FILE_TYPE_DETECTOR = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); } } return FILE_TYPE_DETECTOR; @@ -196,8 +196,8 @@ public enum FileTypeUtils { return Optional.empty(); } else { mimeType = mimeType.toLowerCase(); - return Optional.of(mimeType.startsWith("image/") //NON-NLS - || mimeType.startsWith("video/") //NON-NLS + return Optional.of(mimeType.startsWith("image/") + || mimeType.startsWith("video/") || supportedMimeTypes.contains(mimeType)); } } @@ -221,11 +221,11 @@ public enum FileTypeUtils { String mimeType = fileTypeDetector.getFileType(file); if (nonNull(mimeType)) { mimeType = mimeType.toLowerCase(); - return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); //NON-NLS + return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); } } } catch (TskCoreException ex) { - LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); //NON-NLS + LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); } return FileTypeUtils.videoExtensions.contains(file.getNameExtension()); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index cacb068e16..b749c9cdde 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -58,7 +58,6 @@ import org.apache.commons.lang3.StringUtils; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Cancellable; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -295,29 +294,33 @@ public final class ImageGalleryController implements Executor { if (IngestManager.getInstance().isIngestRunning()) { if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups1.txt"))); + new NoGroupsDialog("No groups are fully analyzed; but listening to ingest is disabled. " + + " No groups will be available until ingest is finished and listening is re-enabled.")); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups2.txt"), + new NoGroupsDialog("No groups are fully analyzed yet, but ingest is still ongoing. Please Wait.", new ProgressIndicator())); } } else if (getFileUpdateQueueSizeProperty().get() > 0) { replaceNotification(fullUIStackPane, - new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups3.txt"), + new NoGroupsDialog("No groups are fully analyzed yet, but image / video data is still being populated. Please Wait.", new ProgressIndicator())); } else if (db != null && db.countAllFiles() <= 0) { // there are no files in db if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups4.txt"))); + new NoGroupsDialog("There are no images/videos available from the added datasources; but listening to ingest is disabled. " + + " No groups will be available until ingest is finished and listening is re-enabled.")); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups5.txt"))); + new NoGroupsDialog("There are no images/videos in the added datasources.")); } } else if (!groupManager.isRegrouping()) { replaceNotification(centralStackPane, - new NoGroupsDialog(NbBundle.getMessage(this.getClass(), "ImageGalleryController.checkForGroups.noGroups6.txt"))); + new NoGroupsDialog("There are no fully analyzed groups to display:" + + " the current Group By setting resulted in no groups, " + + "or no groups are fully analyzed but ingest is not running.")); } } else { @@ -396,7 +399,7 @@ public final class ImageGalleryController implements Executor { * reset the state of the controller (eg if the case is closed) */ public synchronized void reset() { - LOGGER.info("resetting ImageGalleryControler to initial state."); //NON-NLS + LOGGER.info("resetting ImageGalleryControler to initial state."); selectionModel.clearSelection(); setListeningEnabled(false); ThumbnailCache.getDefault().clearCache(); @@ -433,7 +436,7 @@ public final class ImageGalleryController implements Executor { @Nullable synchronized public DrawableFile getFileFromId(Long fileID) throws TskCoreException { if (Objects.isNull(db)) { - LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); //NON-NLS + LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); return null; } return db.getFileFromID(fileID); @@ -459,7 +462,7 @@ public final class ImageGalleryController implements Executor { */ void onStart() { Platform.setImplicitExit(false); - LOGGER.info("setting up ImageGallery listeners"); //NON-NLS + LOGGER.info("setting up ImageGallery listeners"); //TODO can we do anything usefull in an InjestJobEventListener? //IngestManager.getInstance().addIngestJobEventListener((PropertyChangeEvent evt) -> {}); IngestManager.getInstance().addIngestModuleEventListener(new IngestModuleEventListener()); @@ -543,7 +546,7 @@ public final class ImageGalleryController implements Executor { }); } catch (InterruptedException ex) { - LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); } } } @@ -574,8 +577,8 @@ public final class ImageGalleryController implements Executor { this.message.set(Status); } SimpleObjectProperty state = new SimpleObjectProperty<>(Worker.State.READY); - SimpleDoubleProperty progress = new SimpleDoubleProperty(this, NbBundle.getMessage(this.getClass(), "ImageGalleryController.innerTask.property.progress")); - SimpleStringProperty message = new SimpleStringProperty(this, NbBundle.getMessage(this.getClass(), "ImageGalleryController.innerTask.property.message")); + SimpleDoubleProperty progress = new SimpleDoubleProperty(this, "pregress"); + SimpleStringProperty message = new SimpleStringProperty(this, "status"); public SimpleDoubleProperty progressProperty() { return progress; @@ -656,7 +659,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); //NON-NLS + Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); } } } @@ -682,7 +685,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); //NON-NLS + Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); } } @@ -709,28 +712,28 @@ public final class ImageGalleryController implements Executor { } static private final String FILE_EXTENSION_CLAUSE = - "(name LIKE '%." // NON-NLS - + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") // NON-NLS + "(name LIKE '%." + + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "')"; static private final String MIMETYPE_CLAUSE = - "(mime_type LIKE '" // NON-NLS - + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), "' OR mime_type LIKE '") // NON-NLS + "(mime_type LIKE '" + + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), "' OR mime_type LIKE '") + "') "; static private final String DRAWABLE_QUERY = //grab files with supported extension FILE_EXTENSION_CLAUSE //grab files with supported mime-types - + " OR " + MIMETYPE_CLAUSE // NON-NLS + + " OR " + MIMETYPE_CLAUSE //grab files with image or video mime-types even if we don't officially support them - + " OR mime_type LIKE 'video/%' OR mime_type LIKE 'image/%'"; // NON-NLS - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress.txt")); + + " OR mime_type LIKE 'video/%' OR mime_type LIKE 'image/%'"; + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("populating analyzed image/video database"); @Override public void run() { progressHandle.start(); - updateMessage(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress.txt")); + updateMessage("populating analyzed image/video database"); try { //grab all files with supported extension or detected mime types @@ -744,7 +747,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "Task cancelled: not all contents may be transfered to drawable database."); // NON-NLS + LOGGER.log(Level.WARNING, "Task cancelled: not all contents may be transfered to drawable database."); progressHandle.finish(); break; } @@ -781,17 +784,17 @@ public final class ImageGalleryController implements Executor { progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress2")); - updateMessage(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress2")); + progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); + updateMessage("commiting image/video database"); updateProgress(1.0); progressHandle.start(); taskDB.commitTransaction(tr, true); } catch (TskCoreException ex) { - progressHandle.progress(NbBundle.getMessage(this.getClass(), "ImageGalleryController.copyAnalyzedFile.progress.stop")); - Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); //NON-NLS - MessageNotifyUtil.Notify.warn(NbBundle.getMessage(this.getClass(), "ImageGalleryController.notifyMsg.errPopulatingDb.txt"), ex.getMessage()); + progressHandle.progress("Stopping copy to drawable db task."); + Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); + MessageNotifyUtil.Notify.warn("There was an error populating Image Gallery database.", ex.getMessage()); progressHandle.finish(); updateMessage(""); updateProgress(-1.0); @@ -823,9 +826,9 @@ public final class ImageGalleryController implements Executor { * check for supported images */ // (name like '.jpg' or name like '.png' ...) - private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; //NON-NLS + private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "ImageGalleryController.prePopulateDataSourceFiles.progress"), this); + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("prepopulating image/video database", this); /** * @@ -845,10 +848,10 @@ public final class ImageGalleryController implements Executor { @Override public void run() { progressHandle.start(); - updateMessage(NbBundle.getMessage(this.getClass(), "ImageGalleryController.prePopulateDataSourceFiles.progress")); + updateMessage("prepopulating image/video database"); try { - String fsQuery = "(fs_obj_id IS NULL) "; //default clause NON-NLS + String fsQuery = "(fs_obj_id IS NULL) "; //default clause /* * NOTE: Logical files currently (Apr '15) have a null value for * fs_obj_id in DB. for them, we will not specify a fs_obj_id, @@ -869,10 +872,10 @@ public final class ImageGalleryController implements Executor { //use this clause to only grab files from the newly added filesystems. fsQuery = fileSystems.stream() .map(fileSystem -> String.valueOf(fileSystem.getId())) - .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); //NON-NLS + .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); } - final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); //NON-NLS + final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); progressHandle.switchToDeterminate(files.size()); //do in transaction @@ -880,7 +883,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); //NON-NLS + LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); progressHandle.finish(); break; } @@ -890,13 +893,13 @@ public final class ImageGalleryController implements Executor { } progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "ImageGalleryController.prePopulateDataSourceFiles.progress2")); + progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); progressHandle.start(); db.commitTransaction(tr, false); } catch (TskCoreException ex) { - Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); //NON-NLS + Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); } progressHandle.finish(); @@ -951,7 +954,7 @@ public final class ImageGalleryController implements Executor { } } catch (TskCoreException ex) { //TODO: What to do here? - LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); throw new RuntimeException(ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java index 372ac616bb..0a37825f54 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java @@ -22,8 +22,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.apache.commons.lang3.StringUtils; import static org.apache.commons.lang3.StringUtils.isNotBlank; - -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableDB; @@ -36,7 +34,7 @@ public class ImageGalleryModule { private static final Logger LOGGER = Logger.getLogger(ImageGalleryModule.class.getName()); - private static final String MODULE_NAME = NbBundle.getMessage(ImageGalleryModule.class, "ImageGalleryModule.moduleName.txt"); + private static final String MODULE_NAME = "Image Gallery"; static String getModuleName() { return MODULE_NAME; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java index bb44a60ec1..be83d9e236 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java @@ -18,7 +18,6 @@ */ package org.sleuthkit.autopsy.imagegallery; -import java.awt.*; import java.awt.event.ActionEvent; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; @@ -84,17 +83,17 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel { furtherDescriptionArea.setBackground(new java.awt.Color(240, 240, 240)); furtherDescriptionArea.setColumns(20); - furtherDescriptionArea.setFont(furtherDescriptionArea.getFont().deriveFont(Font.PLAIN, 11)); // NOI18N + furtherDescriptionArea.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N furtherDescriptionArea.setLineWrap(true); furtherDescriptionArea.setRows(5); furtherDescriptionArea.setText(NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.furtherDescriptionArea.text")); // NOI18N furtherDescriptionArea.setWrapStyleWord(true); furtherDescriptionArea.setPreferredSize(new java.awt.Dimension(378, 74)); - infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N NON-NLS + infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(infoIconLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.infoIconLabel.text")); // NOI18N - unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N NON-NLS + unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(unavailableDuringInjestLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.unavailableDuringInjestLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java index 51c0b5cb85..5a89b5f257 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java @@ -29,7 +29,7 @@ class ImageGalleryPreferences { private static final Preferences preferences = NbPreferences.forModule(ImageGalleryPreferences.class); /** key for the listening enabled for new cases setting */ - private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; //NON-NLS + private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; /** * Return setting of whether Image Analyzer should be automatically enabled diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java index bdd5a21f11..d1e8f3a236 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java @@ -32,7 +32,6 @@ import org.netbeans.api.settings.ConvertAsProperties; import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerUtils; import org.openide.util.Lookup; -import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.openide.windows.Mode; import org.openide.windows.TopComponent; @@ -50,7 +49,7 @@ import org.sleuthkit.autopsy.imagegallery.gui.navpanel.HashHitGroupList; * Top component which displays ImageGallery interface. * * Although ImageGallery doesn't currently use the explorer manager, this - * Topcomponent provides one through the getExplorerManager method. However, + * Topcomponenet provides one through the getExplorerManager method. However, * this does not seem to function correctly unless a Netbeans provided explorer * view is present in the TopComponenet, even if it is invisible/ zero sized */ @@ -62,18 +61,14 @@ import org.sleuthkit.autopsy.imagegallery.gui.navpanel.HashHitGroupList; //iconBase = "org/sleuthkit/autopsy/imagegallery/images/lightbulb.png" use this to put icon in window title area, persistenceType = TopComponent.PERSISTENCE_NEVER) @TopComponent.Registration(mode = "timeline", openAtStartup = false) -//@Messages({ -// "CTL_ImageGalleryAction=Image/Video Gallery", -// "CTL_ImageGalleryTopComponent=Image/Video Gallery", -// "HINT_ImageGalleryTopComponent=This is a Image/Video Gallery window" -//}) +@Messages({ + "CTL_ImageGalleryAction=Image/Video Gallery", + "CTL_ImageGalleryTopComponent=Image/Video Gallery", + "HINT_ImageGalleryTopComponent=This is a Image/Video Gallery window" +}) public final class ImageGalleryTopComponent extends TopComponent implements ExplorerManager.Provider, Lookup.Provider { - private final static String PREFERRED_ID = "ImageGalleryTopComponent"; //NON-NLS - private static final String DEFAULT_NAME = NbBundle.getMessage(ImageGalleryTopComponent.class, "CTL_ImageGalleryTopComponent"); - private static final String TOOLTIP_TEXT = NbBundle.getMessage(ImageGalleryTopComponent.class, "HINT_ImageGalleryTopComponent"); - - + public final static String PREFERRED_ID = "ImageGalleryTopComponent"; private static final Logger LOGGER = Logger.getLogger(ImageGalleryTopComponent.class.getName()); private static boolean topComponentInitialized = false; @@ -86,11 +81,11 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl // } // } // timeLineController.openTimeLine(); - final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent(PREFERRED_ID); + final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); if (tc != null) { topComponentInitialized = true; WindowManager.getDefault().isTopComponentFloating(tc); - Mode mode = WindowManager.getDefault().findMode("timeline"); //NON-NLS + Mode mode = WindowManager.getDefault().findMode("timeline"); if (mode != null) { mode.dockInto(tc); } @@ -101,12 +96,12 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl public static void closeTopComponent() { if (topComponentInitialized) { - final TopComponent etc = WindowManager.getDefault().findTopComponent(PREFERRED_ID); + final TopComponent etc = WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); if (etc != null) { try { etc.close(); } catch (Exception e) { - LOGGER.log(Level.SEVERE, "failed to close ImageGalleryTopComponent", e); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to close ImageGalleryTopComponent", e); } } } @@ -139,8 +134,8 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl public ImageGalleryTopComponent() { - setName(DEFAULT_NAME); - setToolTipText(TOOLTIP_TEXT); + setName(Bundle.CTL_ImageGalleryTopComponent()); + setToolTipText(Bundle.HINT_ImageGalleryTopComponent()); initComponents(); @@ -232,14 +227,4 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl public Lookup getLookup() { return lookup; } - - /** - * Returns the unique ID of this TopComponent - * - * @return PREFERRED_ID the unique ID of this TopComponent - */ - @Override - protected String preferredID() { - return PREFERRED_ID; - } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java index 89a40977f3..75a35fc798 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java @@ -37,9 +37,9 @@ import org.sleuthkit.autopsy.coreutils.Logger; */ class PerCaseProperties { - public static final String ENABLED = "enabled"; //NON-NLS + public static final String ENABLED = "enabled"; - public static final String STALE = "stale"; //NON-NLS + public static final String STALE = "stale"; private final Case theCase; @@ -88,7 +88,7 @@ class PerCaseProperties { * @return true if the config exists, false otherwise. */ public synchronized boolean configExists(String moduleName) { - Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); //NON-NLS + Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); return Files.exists(get); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java index a0c962c775..67c4a10dfa 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java @@ -101,7 +101,7 @@ public enum ThumbnailCache { try { return cache.get(file.getId(), () -> load(file)); } catch (UncheckedExecutionException | CacheLoader.InvalidCacheLoadException | ExecutionException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); return null; } } @@ -111,7 +111,7 @@ public enum ThumbnailCache { try { return get(ImageGalleryController.getDefault().getFileFromId(fileID)); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); return null; } } @@ -142,9 +142,9 @@ public enum ThumbnailCache { return cachedThumbnail; } } catch (MalformedURLException ex) { - LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); } catch (IOException ex) { - LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); } } return null; @@ -176,7 +176,7 @@ public enum ThumbnailCache { return Optional.of(ImageUtils.getCachedThumbnailFile(file.getAbstractFile(), MAX_THUMBNAIL_SIZE)); } catch (Exception e) { - LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); return Optional.empty(); } } @@ -193,7 +193,7 @@ public enum ThumbnailCache { try { cache.put(Long.MIN_VALUE, newGetThumbnailTask.get()); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); } } }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java index e3340a4aa8..28a377aade 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java @@ -28,8 +28,6 @@ import javafx.application.Platform; import javafx.scene.control.Alert; import javafx.scene.control.Menu; import javax.swing.SwingWorker; - -import org.openide.util.NbBundle; import org.openide.util.Utilities; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -62,11 +60,7 @@ public class AddDrawableTagAction extends AddTagAction { @Override protected String getActionDisplayName() { - if (Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1) { - return NbBundle.getMessage(this.getClass(), "AddDrawableTagAction.pluralTagFile"); - } else { - return NbBundle.getMessage(this.getClass(), "AddDrawableTagAction.singularTagFile"); - } + return Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1 ? "Tag Files" : "Tag File"; } @Override @@ -84,7 +78,7 @@ public class AddDrawableTagAction extends AddTagAction { for (Long fileID : selectedFiles) { try { final DrawableFile file = controller.getFileFromId(fileID); - LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); //NON-NLS + LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); // check if the same tag is being added for the same abstract file. DrawableTagsManager tagsManager = controller.getTagsManager(); @@ -95,16 +89,16 @@ public class AddDrawableTagAction extends AddTagAction { .findAny(); if (duplicateTagName.isPresent()) { - LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS + LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); } else { - LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS + LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); controller.getTagsManager().addContentTag(file, tagName, comment); } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); //NON-NLS + LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); Platform.runLater(() -> { - new Alert(Alert.AlertType.ERROR, NbBundle.getMessage(this.getClass(), "AddDrawableTagAction.addTagsToFiles.unableToTag.alert.msg", fileID)).show(); + new Alert(Alert.AlertType.ERROR, "Unable to tag file " + fileID + ".").show(); }); } } @@ -117,7 +111,7 @@ public class AddDrawableTagAction extends AddTagAction { try { get(); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); } } }.execute(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java index e6abd16f6a..91c2af6503 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java @@ -25,8 +25,6 @@ import javafx.event.ActionEvent; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javax.swing.SwingUtilities; - -import org.openide.util.NbBundle; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.actions.GetTagNameAndCommentDialog; @@ -79,7 +77,7 @@ abstract class AddTagAction { super(getActionDisplayName()); // Create a "Quick Tag" sub-menu. - Menu quickTagMenu = new Menu(NbBundle.getMessage(this.getClass(), "AddTagAction.tagMenu.quickTag")); + Menu quickTagMenu = new Menu("Quick Tag"); getItems().add(quickTagMenu); /* @@ -89,7 +87,7 @@ abstract class AddTagAction { */ Collection tagNames = controller.getTagsManager().getNonCategoryTagNames(); if (tagNames.isEmpty()) { - MenuItem empty = new MenuItem(NbBundle.getMessage(this.getClass(), "AddTagAction.tagMenu.noTags")); + MenuItem empty = new MenuItem("No tags"); empty.setDisable(true); quickTagMenu.getItems().add(empty); } else { @@ -107,7 +105,7 @@ abstract class AddTagAction { * Selecting this item initiates a dialog that can be used to create * or select a tag name and adds a tag with the resulting name. */ - MenuItem newTagMenuItem = new MenuItem(NbBundle.getMessage(this.getClass(), "AddTagAction.tagMenu.newTag")); + MenuItem newTagMenuItem = new MenuItem("New Tag..."); newTagMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TagName tagName = GetTagNameDialog.doDialog(getIGWindow()); @@ -124,7 +122,7 @@ abstract class AddTagAction { * name with an optional comment and adds a tag with the resulting * name. */ - MenuItem tagAndCommentItem = new MenuItem(NbBundle.getMessage(this.getClass(), "AddTagAction.tagMenu.tagAndComment")); + MenuItem tagAndCommentItem = new MenuItem("Tag and Comment..."); tagAndCommentItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { GetTagNameAndCommentDialog.TagNameAndComment tagNameAndComment = GetTagNameAndCommentDialog.doDialog(getIGWindow()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java index 21f5191b39..4488d94967 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java @@ -24,7 +24,6 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -33,12 +32,12 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm public class Back extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); //NON-NLS + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); private final ImageGalleryController controller; public Back(ImageGalleryController controller) { - super(NbBundle.getMessage(Back.class, "Back.txt")); + super("Back"); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.LEFT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties deleted file mode 100644 index bcdd268818..0000000000 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle.properties +++ /dev/null @@ -1,24 +0,0 @@ -CTL_OpenAction=View Images/Videos -CTL_OpenHelpAction=Image / Video Gallery Help -AddDrawableTagAction.addTagsToFiles.unableToTag.alert.msg=Unable to tag file {0}. -AddDrawableTagAction.pluralTagFile=Tag Files -AddDrawableTagAction.singularTagFile=Tag File -AddTagAction.tagMenu.newTag=New Tag... -AddTagAction.tagMenu.noTags=No tags -AddTagAction.tagMenu.quickTag=Quick Tag -AddTagAction.tagMenu.tagAndComment=Tag and Comment... -Back.txt=Back -CategorizeAction.displayName.txt=Categorize -DeleteFollwUpTagAction.displayName.txt=Delete Follow Up Tag -Forward.forward.txt=Forward -NextUnseenGroup.markGroupSeen.txt=Mark Group Seen -NextUnseenGroup.nextUnseenGroup.txt=Next Unseen group -OpenAction.performAction.answer.txt=The image / video database may be out of date. Do you want to update and listen for further ingest results?\ -Choosing ''yes'' will update the database and enable listening to future ingests. Choosing ''no'' will display the out of date results. Choosing ''cancel'' will close the image /video gallery -OpenAction.moduleName.text=Image Gallery -OpenExternalViewerAction.displayName.text=External Viewer -OpenExternalViewerAction.externalViewerButton.text=Open in External Viewer -RedoAction.displayName.text=Redo -UndoAction.displayName.text=Undo -CategorizeAction.caterror.displayTitle.txt=Categorizing Error -CategorizeAction.caterror.errMsg.txt=Unable to categorize {0}. diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Bundle_ja.properties deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java index aa7b8e6374..9d89b4fb1b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java @@ -35,8 +35,6 @@ import javafx.scene.input.KeyCodeCombination; import javax.annotation.Nonnull; import javax.annotation.concurrent.Immutable; import javax.swing.JOptionPane; - -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.Category; @@ -73,7 +71,7 @@ public class CategorizeAction extends AddTagAction { @Override protected String getActionDisplayName() { - return NbBundle.getMessage(this.getClass(), "CategorizeAction.displayName.txt"); + return "Categorize"; } @Override @@ -88,7 +86,7 @@ public class CategorizeAction extends AddTagAction { } public void addTagsToFiles(TagName tagName, String comment, Set selectedFiles, boolean createUndo) { - Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); //NON-NLS + Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); controller.queueDBWorkerTask(new CategorizeTask(selectedFiles, tagName, comment, createUndo)); } @@ -99,7 +97,7 @@ public class CategorizeAction extends AddTagAction { static private class CategoryMenu extends Menu { CategoryMenu(ImageGalleryController controller) { - super(NbBundle.getMessage(CategorizeAction.class, "CategorizeAction.displayName.txt")); + super("Categorize"); // Each category get an item in the sub-menu. Selecting one of these menu items adds // a tag with the associated category. @@ -159,7 +157,7 @@ public class CategorizeAction extends AddTagAction { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); } }); } else { @@ -172,11 +170,8 @@ public class CategorizeAction extends AddTagAction { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error categorizing result", ex); //NON-NLS - JOptionPane.showMessageDialog(null, - NbBundle.getMessage(this.getClass(), "CategorizeAction.caterror.errMsg.txt", fileID), - NbBundle.getMessage(this.getClass(), "CategorizeAction.caterror.displayTitle.txt"), - JOptionPane.ERROR_MESSAGE); + LOGGER.log(Level.SEVERE, "Error categorizing result", ex); + JOptionPane.showMessageDialog(null, "Unable to categorize " + fileID + ".", "Categorizing Error", JOptionPane.ERROR_MESSAGE); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java index 531bc5fafb..27ab1cd8b1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java @@ -23,7 +23,6 @@ import java.util.logging.Level; import javafx.event.ActionEvent; import javax.swing.SwingWorker; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; @@ -40,7 +39,7 @@ public class DeleteFollowUpTagAction extends Action { private static final Logger LOGGER = Logger.getLogger(DeleteFollowUpTagAction.class.getName()); public DeleteFollowUpTagAction(final ImageGalleryController controller, final DrawableFile file) { - super(NbBundle.getMessage(DeleteFollowUpTagAction.class, "DeleteFollwUpTagAction.displayName.txt")); + super("Delete Follow Up Tag"); setEventHandler((ActionEvent t) -> { new SwingWorker() { @@ -58,7 +57,7 @@ public class DeleteFollowUpTagAction extends Action { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); } return null; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java index 107a73adbc..c94cfc5ffb 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java @@ -24,7 +24,6 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -33,12 +32,12 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm public class Forward extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); //NON-NLS + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); private final ImageGalleryController controller; public Forward(ImageGalleryController controller) { - super(NbBundle.getMessage(Forward.class, "Forward.forward.txt")); + super("Forward"); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.RIGHT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java index 90007c3cff..0d446cda84 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java @@ -26,7 +26,6 @@ import javafx.event.ActionEvent; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; @@ -38,12 +37,12 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; public class NextUnseenGroup extends Action { private static final Image END = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); //NON-NLS + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); private static final Image ADVANCE = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); //NON-NLS + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); - private static final String MARK_GROUP_SEEN = NbBundle.getMessage(NextUnseenGroup.class, "NextUnseenGroup.markGroupSeen.txt"); - private static final String NEXT_UNSEEN_GROUP = NbBundle.getMessage(NextUnseenGroup.class, "NextUnseenGroup.nextUnseenGroup.txt"); + private static final String MARK_GROUP_SEEN = "Mark Group Seen"; + private static final String NEXT_UNSEEN_GROUP = "Next Unseen group"; private final ImageGalleryController controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java index 1134c494fd..b1f1f651b7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java @@ -25,7 +25,6 @@ import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.openide.util.actions.CallableSystemAction; import org.openide.windows.WindowManager; @@ -42,10 +41,10 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryTopComponent; @ActionRegistration( // iconBase = "org/sleuthkit/autopsy/imagegallery/images/lightbulb.png", lazy = false, displayName = "#CTL_OpenAction") -//@Messages("CTL_OpenAction=View Images/Videos") +@Messages("CTL_OpenAction=View Images/Videos") public final class OpenAction extends CallableSystemAction { - private static final String VIEW_IMAGES_VIDEOS = NbBundle.getMessage(OpenAction.class, "CTL_OpenAction"); + private static final String VIEW_IMAGES_VIDEOS = "View Images/Videos"; private static final boolean fxInited = Installer.isJavaFxInited(); @@ -84,8 +83,11 @@ public final class OpenAction extends CallableSystemAction { if (ImageGalleryModule.isDrawableDBStale(currentCase)) { //drawable db is stale, ask what to do - int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(this.getClass(), "OpenAction.performAction.answer.txt"), - NbBundle.getMessage(this.getClass(), "OpenAction.moduleName.text"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), "The image / video database may be out of date. " + "Do you want to update and listen for further ingest results?\n" + + "Choosing 'yes' will update the database and enable listening to future ingests." + + " Choosing 'no' will display the out of date results." + + " Choosing 'cancel' will close the image /video gallery", + "Image Gallery", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); switch (answer) { case JOptionPane.YES_OPTION: diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java index 7e14774d53..ba33d077ba 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java @@ -32,14 +32,14 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; * Wraps {@link ExternalViewerAction} in a ControlsFX {@link Action} with * appropriate text and graphic */ -//@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer"}) +@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer"}) public class OpenExternalViewerAction extends Action { - private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); //NON-NLS + private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); private static final ActionEvent ACTION_EVENT = new ActionEvent(OpenExternalViewerAction.class, ActionEvent.ACTION_PERFORMED, ""); //Swing ActionEvent //NOI18N public OpenExternalViewerAction(DrawableFile file) { - super(NbBundle.getMessage(OpenExternalViewerAction.class, "OpenExternalViewerAction.displayName.text")); + super("External Viewer"); /** * TODO: why is the name passed to the action? it means we duplicate diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java index c9745f7ed8..a75a786317 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java @@ -38,15 +38,15 @@ import org.sleuthkit.autopsy.coreutils.Logger; displayName = "#CTL_OpenHelpAction" ) @ActionReference(path = "Menu/Help", position = 350) -//@Messages("CTL_OpenHelpAction=Image / Video Gallery Help") +@Messages("CTL_OpenHelpAction=Image / Video Gallery Help") public final class OpenHelpAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { try { - Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); //NON-NLS + Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); } catch (IOException ex) { - Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); //NON-NLS + Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); } } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java index e79341ce1c..e3ce54cd7c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java @@ -23,7 +23,6 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -31,10 +30,10 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; */ public class RedoAction extends Action { - private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); //NON-NLS + private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); public RedoAction(ImageGalleryController controller) { - super(NbBundle.getMessage(RedoAction.class, "RedoAction.displayName.text")); + super("Redo"); setGraphic(new ImageView(REDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Y, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().redo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java index cd5b0db175..0285c57bb7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java @@ -23,7 +23,6 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -31,10 +30,10 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; */ public class UndoAction extends Action { - private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); //NON-NLS + private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); public UndoAction(ImageGalleryController controller) { - super(NbBundle.getMessage(UndoAction.class, "UndoAction.displayName.text")); + super("Undo"); setGraphic(new ImageView(UNDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Z, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().undo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties deleted file mode 100644 index a913cf0d3d..0000000000 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle.properties +++ /dev/null @@ -1,23 +0,0 @@ -Category.cat0.uncategorized.displayName=CAT-0\: Uncategorized -Category.cat1.childExploitationIllegal.displayName=CAT-1\: Child Exploitation (Illegal) -Category.cat2.childExploitationNonIllegalAgeDifficult.displayName=CAT-2\: Child Exploitation (Non-Illegal/Age Difficult) -Category.cat3.cgiAnimationChildExploitive.displayName=CAT-3\: CGI/Animation (Child Exploitive) -Category.cat4.exemplarComparisonInternalUseOnly.displayName=CAT-4\: Exemplar/Comparison (Internal Use Only) -Category.cat5.nonPertinent.displayName=CAT-5\: Non-pertinent -DrawableAttribute.analyzed.txt=Analyzed -DrawableAttribute.cameraMake.txt=Camera Make -DrawableAttribute.cameraModel.txt=Camera Model -DrawableAttribute.category.txt=Category -DrawableAttribute.createdTime.txt=Created Time -DrawableAttribute.hashset.txt=Hashset -DrawableAttribute.height.txt=Height -DrawableAttribute.internalObjectId.txt=Internal Object ID -DrawableAttribute.md5Hash.txt=MD5 Hash -DrawableAttribute.mimeType.txt=MIME type -DrawableAttribute.modifiedTime.txt=Modified Time -DrawableAttribute.name.txt=Name -DrawableAttribute.path.txt=Path -DrawableAttribute.tags.txt=Tags -DrawableAttribute.width.txt=Width -DrawableTagsManager.followUp.tagName.txt=Follow Up -VideoFile.progress.text=writing temporary file to disk \ No newline at end of file diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Bundle_ja.properties deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java index fc82a44580..1567a1b2b4 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java @@ -24,7 +24,6 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import javafx.scene.paint.Color; -import org.openide.util.NbBundle; /** * Enum to represent the six categories in the DHS image categorization scheme. @@ -33,15 +32,15 @@ public enum Category { /* * This order of declaration is required so that Enum's compareTo method - * preserves the fact that lower category numbers are first/most severe, + * preserves the fact that lower category numbers are first/most sever, * except 0 which is last */ - ONE(Color.RED, 1, NbBundle.getMessage(Category.class, "Category.cat1.childExploitationIllegal.displayName")), - TWO(Color.ORANGE, 2, NbBundle.getMessage(Category.class, "Category.cat2.childExploitationNonIllegalAgeDifficult.displayName")), - THREE(Color.YELLOW, 3, NbBundle.getMessage(Category.class, "Category.cat3.cgiAnimationChildExploitive.displayName")), - FOUR(Color.BISQUE, 4, NbBundle.getMessage(Category.class, "Category.cat4.exemplarComparisonInternalUseOnly.displayName")), - FIVE(Color.GREEN, 5, NbBundle.getMessage(Category.class, "Category.cat5.nonPertinent.displayName")), - ZERO(Color.LIGHTGREY, 0, NbBundle.getMessage(Category.class, "Category.cat0.uncategorized.displayName")); + ONE(Color.RED, 1, "CAT-1: Child Exploitation (Illegal)"), + TWO(Color.ORANGE, 2, "CAT-2: Child Exploitation (Non-Illegal/Age Difficult)"), + THREE(Color.YELLOW, 3, "CAT-3: CGI/Animation (Child Exploitive)"), + FOUR(Color.BISQUE, 4, "CAT-4: Exemplar/Comparison (Internal Use Only)"), + FIVE(Color.GREEN, 5, "CAT-5: Non-pertinent"), + ZERO(Color.LIGHTGREY, 0, "CAT-0: Uncategorized"); public static ImmutableList getNonZeroCategories() { return nonZeroCategories; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java index 464c2492b0..d2018d422c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java @@ -68,8 +68,8 @@ public class CategoryManager { * Used to distribute {@link CategoryChangeEvent}s */ private final EventBus categoryEventBus = new AsyncEventBus(Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS - LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); //NON-NLS + new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { + LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); }).build() )); @@ -176,7 +176,7 @@ public class CategoryManager { longAdder.add(db.getCategoryCount(cat)); longAdder.increment(); } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS + LOGGER.log(Level.WARNING, "Case closed while getting files"); } return longAdder; } @@ -210,8 +210,8 @@ public class CategoryManager { try { categoryEventBus.unregister(listener); } catch (IllegalArgumentException e) { - if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { //NON-NLS - LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); //NON-NLS + if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { + LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); } else { throw e; } @@ -254,12 +254,12 @@ public class CategoryManager { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); } } } } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); } Category newCat = CategoryManager.categoryFromTagName(addedTag.getName()); if (newCat != Category.ZERO) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java index 490588e07a..eb3a7ed64d 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java @@ -27,7 +27,6 @@ import javafx.beans.property.ReadOnlyStringWrapper; import javafx.beans.property.StringProperty; import javafx.scene.image.Image; import org.apache.commons.lang3.StringUtils; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.datamodel.ContentUtils; import org.sleuthkit.datamodel.TagName; @@ -41,22 +40,19 @@ import org.sleuthkit.datamodel.TagName; public class DrawableAttribute> { public final static DrawableAttribute MD5_HASH = - new DrawableAttribute<>(AttributeName.MD5_HASH, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.md5Hash.txt"), + new DrawableAttribute<>(AttributeName.MD5_HASH, "MD5 Hash", false, - "icon-hashtag.png", // NON-NLS + "icon-hashtag.png", f -> Collections.singleton(f.getMd5Hash())); public final static DrawableAttribute NAME = - new DrawableAttribute<>(AttributeName.NAME, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.name.txt"), + new DrawableAttribute<>(AttributeName.NAME, "Name", true, - "folder-rename.png", // NON-NLS + "folder-rename.png", f -> Collections.singleton(f.getName())); public final static DrawableAttribute ANALYZED = - new DrawableAttribute<>(AttributeName.ANALYZED, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.analyzed.txt"), + new DrawableAttribute<>(AttributeName.ANALYZED, "Analyzed", true, "", f -> Collections.singleton(f.isAnalyzed())); @@ -70,87 +66,75 @@ public class DrawableAttribute> { * advantage. move categories into DrawableDB? */ public final static DrawableAttribute CATEGORY = - new DrawableAttribute<>(AttributeName.CATEGORY, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.category.txt"), + new DrawableAttribute<>(AttributeName.CATEGORY, "Category", false, - "category-icon.png", // NON-NLS + "category-icon.png", f -> Collections.singleton(f.getCategory())); public final static DrawableAttribute TAGS = - new DrawableAttribute<>(AttributeName.TAGS, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.tags.txt"), + new DrawableAttribute<>(AttributeName.TAGS, "Tags", false, - "tag_red.png", // NON-NLS + "tag_red.png", DrawableFile::getTagNames); public final static DrawableAttribute PATH = - new DrawableAttribute<>(AttributeName.PATH, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.path.txt"), + new DrawableAttribute<>(AttributeName.PATH, "Path", true, - "folder_picture.png", // NON-NLS + "folder_picture.png", f -> Collections.singleton(f.getDrawablePath())); public final static DrawableAttribute CREATED_TIME = - new DrawableAttribute<>(AttributeName.CREATED_TIME, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.createdTime.txt"), + new DrawableAttribute<>(AttributeName.CREATED_TIME, "Created Time", true, - "clock--plus.png", // NON-NLS + "clock--plus.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getCrtime(), f))); public final static DrawableAttribute MODIFIED_TIME = - new DrawableAttribute<>(AttributeName.MODIFIED_TIME, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.modifiedTime.txt"), + new DrawableAttribute<>(AttributeName.MODIFIED_TIME, "Modified Time", true, - "clock--pencil.png", // NON-NLS + "clock--pencil.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getMtime(), f))); public final static DrawableAttribute MAKE = - new DrawableAttribute<>(AttributeName.MAKE, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.cameraMake.txt"), + new DrawableAttribute<>(AttributeName.MAKE, "Camera Make", true, - "camera.png", // NON-NLS + "camera.png", f -> Collections.singleton(f.getMake())); public final static DrawableAttribute MODEL = - new DrawableAttribute<>(AttributeName.MODEL, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.cameraModel.txt"), + new DrawableAttribute<>(AttributeName.MODEL, "Camera Model", true, - "camera.png", // NON-NLS + "camera.png", f -> Collections.singleton(f.getModel())); public final static DrawableAttribute HASHSET = - new DrawableAttribute<>(AttributeName.HASHSET, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.hashset.txt"), + new DrawableAttribute<>(AttributeName.HASHSET, "Hashset", true, - "hashset_hits.png", // NON-NLS + "hashset_hits.png", DrawableFile::getHashSetNamesUnchecked); public final static DrawableAttribute OBJ_ID = - new DrawableAttribute<>(AttributeName.OBJ_ID, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.internalObjectId.txt"), + new DrawableAttribute<>(AttributeName.OBJ_ID, "Internal Object ID", true, "", f -> Collections.singleton(f.getId())); public final static DrawableAttribute WIDTH = - new DrawableAttribute<>(AttributeName.WIDTH, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.width.txt"), - true, - "arrow-resize.png", // NON-NLS + new DrawableAttribute<>(AttributeName.WIDTH, "Width", + false, + "arrow-resize.png", f -> Collections.singleton(f.getWidth())); public final static DrawableAttribute HEIGHT = - new DrawableAttribute<>(AttributeName.HEIGHT, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.height.txt"), - true, - "arrow-resize-090.png", // NON-NLS + new DrawableAttribute<>(AttributeName.HEIGHT, "Height", + false, + "arrow-resize-090.png", f -> Collections.singleton(f.getHeight())); public final static DrawableAttribute MIME_TYPE = - new DrawableAttribute<>(AttributeName.MIME_TYPE, - NbBundle.getMessage(DrawableAttribute.class, "DrawableAttribute.mimeType.txt"), + new DrawableAttribute<>(AttributeName.MIME_TYPE, "MIME type", false, - "mime_types.png", // NON-NLS + "mime_types.png", f -> Collections.singleton(f.getMIMEType())); final private static List< DrawableAttribute> groupables = @@ -186,7 +170,7 @@ public class DrawableAttribute> { * time they are needed */ if (null == icon && StringUtils.isNotBlank(imageName)) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); // NON-NLS + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); } return icon; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java index 079be33ff4..61ef672bc2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java @@ -77,11 +77,11 @@ public final class DrawableDB { private static final org.sleuthkit.autopsy.coreutils.Logger LOGGER = Logger.getLogger(DrawableDB.class.getName()); //column name constants////////////////////// - private static final String ANALYZED = "analyzed"; //NON-NLS + private static final String ANALYZED = "analyzed"; - private static final String OBJ_ID = "obj_id"; //NON-NLS + private static final String OBJ_ID = "obj_id"; - private static final String HASH_SET_NAME = "hash_set_name"; //NON-NLS + private static final String HASH_SET_NAME = "hash_set_name"; private final PreparedStatement insertHashSetStmt; @@ -140,7 +140,7 @@ public final class DrawableDB { try { Class.forName("org.sqlite.JDBC"); } catch (ClassNotFoundException ex) { - LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); } } private final SleuthkitCase tskCase; @@ -201,33 +201,33 @@ public final class DrawableDB { Files.createDirectories(dbPath.getParent()); if (initializeDBSchema()) { updateFileStmt = prepareStatement( - "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS - + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS + "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " + + "VALUES (?,?,?,?,?,?,?,?)"); insertFileStmt = prepareStatement( - "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS - + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS + "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " + + "VALUES (?,?,?,?,?,?,?,?)"); - removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); //NON-NLS + removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); - pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); //NON-NLS - nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); //NON-NLS - created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); //NON-NLS - modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); //NON-NLS - makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); //NON-NLS - modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); //NON-NLS - analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); //NON-NLS - hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); //NON-NLS + pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); + nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); + created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); + modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); + makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); + modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); + analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); + hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); - updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); //NON-NLS - insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); //NON-NLS + updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); + insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); - groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); //NON-NLS + groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); - selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); //NON-NLS - insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); //NON-NLS - selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); //NON-NLS + selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); + insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); + selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); - insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); //NON-NLS + insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); for (Category cat : Category.values()) { insertGroup(cat.getDisplayName(), DrawableAttribute.CATEGORY); @@ -289,12 +289,12 @@ public final class DrawableDB { public static DrawableDB getDrawableDB(Path dbPath, ImageGalleryController controller) { try { - return new DrawableDB(dbPath.resolve("drawable.db"), controller); //NON-NLS + return new DrawableDB(dbPath.resolve("drawable.db"), controller); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); return null; } catch (ExceptionInInitializerError | IOException ex) { - LOGGER.log(Level.SEVERE, "error creating database connection", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "error creating database connection", ex); return null; } } @@ -304,33 +304,33 @@ public final class DrawableDB { //this should match Sleuthkit db setupt try (Statement statement = con.createStatement()) { //reduce i/o operations, we have no OS crash recovery anyway - statement.execute("PRAGMA synchronous = OFF;"); //NON-NLS + statement.execute("PRAGMA synchronous = OFF;"); //allow to query while in transaction - no need read locks - statement.execute("PRAGMA read_uncommitted = True;"); //NON-NLS + statement.execute("PRAGMA read_uncommitted = True;"); //TODO: do we need this? - statement.execute("PRAGMA foreign_keys = ON"); //NON-NLS + statement.execute("PRAGMA foreign_keys = ON"); //TODO: test this - statement.execute("PRAGMA journal_mode = MEMORY"); //NON-NLS + statement.execute("PRAGMA journal_mode = MEMORY"); // //we don't use this feature, so turn it off for minimal speed up on queries //this is deprecated and not recomended - statement.execute("PRAGMA count_changes = OFF;"); //NON-NLS + statement.execute("PRAGMA count_changes = OFF;"); //this made a big difference to query speed - statement.execute("PRAGMA temp_store = MEMORY"); //NON-NLS + statement.execute("PRAGMA temp_store = MEMORY"); //this made a modest improvement in query speeds - statement.execute("PRAGMA cache_size = 50000"); //NON-NLS + statement.execute("PRAGMA cache_size = 50000"); //we never delete anything so... - statement.execute("PRAGMA auto_vacuum = 0"); //NON-NLS + statement.execute("PRAGMA auto_vacuum = 0"); } try { - LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", //NON-NLS + LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", SQLiteJDBCLoader.getVersion(), SQLiteJDBCLoader.isNativeMode() - ? "native" : "pure-java")); //NON-NLS + ? "native" : "pure-java")); } catch (Exception exception) { - LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); //NON-NLS + LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); } } @@ -349,92 +349,92 @@ public final class DrawableDB { setPragmas(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem accessing database", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem accessing database", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists drawable_files " //NON-NLS - + "( obj_id INTEGER PRIMARY KEY, " //NON-NLS - + " path VARCHAR(255), " //NON-NLS - + " name VARCHAR(255), " //NON-NLS - + " created_time integer, " //NON-NLS - + " modified_time integer, " //NON-NLS - + " make VARCHAR(255), " //NON-NLS - + " model VARCHAR(255), " //NON-NLS - + " analyzed integer DEFAULT 0)"; //NON-NLS + String sql = "CREATE TABLE if not exists drawable_files " + + "( obj_id INTEGER PRIMARY KEY, " + + " path VARCHAR(255), " + + " name VARCHAR(255), " + + " created_time integer, " + + " modified_time integer, " + + " make VARCHAR(255), " + + " model VARCHAR(255), " + + " analyzed integer DEFAULT 0)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists groups " //NON-NLS - + "(group_id INTEGER PRIMARY KEY, " //NON-NLS - + " value VARCHAR(255) not null, " //NON-NLS - + " attribute VARCHAR(255) not null, " //NON-NLS - + " seen integer DEFAULT 0, " //NON-NLS - + " UNIQUE(value, attribute) )"; //NON-NLS + String sql = "CREATE TABLE if not exists groups " + + "(group_id INTEGER PRIMARY KEY, " + + " value VARCHAR(255) not null, " + + " attribute VARCHAR(255) not null, " + + " seen integer DEFAULT 0, " + + " UNIQUE(value, attribute) )"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating groups table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating groups table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_sets " //NON-NLS - + "( hash_set_id INTEGER primary key," //NON-NLS - + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; //NON-NLS + String sql = "CREATE TABLE if not exists hash_sets " + + "( hash_set_id INTEGER primary key," + + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_set_hits " //NON-NLS - + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " //NON-NLS - + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " //NON-NLS - + " PRIMARY KEY (hash_set_id, obj_id))"; //NON-NLS + String sql = "CREATE TABLE if not exists hash_set_hits " + + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " + + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " + + " PRIMARY KEY (hash_set_id, obj_id))"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; //NON-NLS + String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating path_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating path_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; //NON-NLS + String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating name_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating name_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; //NON-NLS + String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating make_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating make_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; //NON-NLS + String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating model_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating model_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; //NON-NLS + String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); } return true; @@ -455,7 +455,7 @@ public final class DrawableDB { closeStatements(); con.close(); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); } } con = null; @@ -464,10 +464,10 @@ public final class DrawableDB { public void openDBCon() { try { if (con == null || con.isClosed()) { - con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); //NON-NLS + con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); } } @@ -518,7 +518,7 @@ public final class DrawableDB { names.add(rs.getString(HASH_SET_NAME)); } } catch (SQLException sQLException) { - LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); } finally { dbReadUnlock(); } @@ -533,11 +533,11 @@ public final class DrawableDB { groupSeenQueryStmt.setString(2, groupKey.getAttribute().attrName.toString()); try (ResultSet rs = groupSeenQueryStmt.executeQuery()) { while (rs.next()) { - return rs.getBoolean("seen"); //NON-NLS + return rs.getBoolean("seen"); } } } catch (SQLException ex) { - String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); //NON-NLS + String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -555,7 +555,7 @@ public final class DrawableDB { updateGroupStmt.setString(3, gk.getAttribute().attrName.toString()); updateGroupStmt.execute(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); } finally { dbWriteUnlock(); } @@ -623,7 +623,7 @@ public final class DrawableDB { selectHashSetStmt.setString(1, name); try (ResultSet rs = selectHashSetStmt.executeQuery()) { while (rs.next()) { - int hashsetID = rs.getInt("hash_set_id"); //NON-NLS + int hashsetID = rs.getInt("hash_set_id"); //"insert or ignore into hash_set_hits (hash_set_id, obj_id) values (?,?)"; insertHashHitStmt.setInt(1, hashsetID); insertHashHitStmt.setLong(2, f.getId()); @@ -633,7 +633,7 @@ public final class DrawableDB { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); } //and update all groups this file is in @@ -650,7 +650,7 @@ public final class DrawableDB { // This is one of the places where we get an error if the case is closed during processing, // which doesn't need to be reported here. if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); } } finally { @@ -676,12 +676,12 @@ public final class DrawableDB { public Boolean isFileAnalyzed(long fileId) { dbReadLock(); try (Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { while (analyzedQuery.next()) { return analyzedQuery.getBoolean(ANALYZED); } } catch (SQLException ex) { - String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); //NON-NLS + String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -695,12 +695,12 @@ public final class DrawableDB { dbReadLock(); try (Statement stmt = con.createStatement(); //Can't make this a preprared statement because of the IN ( ... ) - ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { while (analyzedQuery.next()) { return analyzedQuery.getInt(ANALYZED) == fileIds.size(); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); } finally { dbReadUnlock(); } @@ -717,7 +717,7 @@ public final class DrawableDB { // In testing, this method appears to be a lot faster than doing one large select statement for (Long fileID : fileIDsInGroup) { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); while (analyzedQuery.next()) { if (analyzedQuery.getInt(ANALYZED) == 0) { return false; @@ -727,10 +727,10 @@ public final class DrawableDB { } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); //NON-NLS + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); } finally { dbReadUnlock(); } @@ -756,7 +756,7 @@ public final class DrawableDB { dbReadLock(); try { statement = con.createStatement(); - rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); //NON-NLS + rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); while (rs.next()) { ret.add(rs.getLong(1)); } @@ -767,14 +767,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); } } dbReadUnlock(); @@ -808,14 +808,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); } } dbReadUnlock(); @@ -845,14 +845,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); } } dbReadUnlock(); @@ -883,15 +883,15 @@ public final class DrawableDB { default: dbReadLock(); //TODO: convert this to prepared statement - StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); //NON-NLS + StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); String orderByClause = ""; switch (sortBy) { case GROUP_BY_VALUE: - orderByClause = " ORDER BY " + groupBy.attrName.toString(); //NON-NLS + orderByClause = " ORDER BY " + groupBy.attrName.toString(); break; case FILE_COUNT: - orderByClause = " ORDER BY COUNT(*)"; //NON-NLS + orderByClause = " ORDER BY COUNT(*)"; break; case NONE: // case PRIORITY: @@ -905,10 +905,10 @@ public final class DrawableDB { switch (sortOrder) { case DESCENDING: - sortOrderClause = " DESC"; //NON-NLS + sortOrderClause = " DESC"; break; case ASCENDING: - sortOrderClause = " ASC"; //NON-NLS + sortOrderClause = " ASC"; break; default: orderByClause = ""; @@ -930,7 +930,7 @@ public final class DrawableDB { vals.add(value); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); } finally { dbReadUnlock(); } @@ -951,7 +951,7 @@ public final class DrawableDB { } catch (SQLException sQLException) { // Don't need to report it if the case was closed if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); //NON-NLS + LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); } } finally { dbWriteUnlock(); @@ -972,7 +972,7 @@ public final class DrawableDB { AbstractFile f = tskCase.getAbstractFileById(id); return DrawableFile.create(f, analyzed, isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); //NON-NLS + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); return null; } } @@ -991,7 +991,7 @@ public final class DrawableDB { return DrawableFile.create(f, areFilesAnalyzed(Collections.singleton(id)), isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); //NON-NLS + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); return null; } } @@ -1020,7 +1020,7 @@ public final class DrawableDB { } } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); } finally { dbReadUnlock(); } @@ -1042,14 +1042,14 @@ public final class DrawableDB { public int countAllFiles() { int result = -1; dbReadLock(); - try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { //NON-NLS + try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { while (rs.next()) { result = rs.getInt("COUNT"); break; } } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); //NON-NLS + LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); } finally { dbReadUnlock(); } @@ -1081,7 +1081,7 @@ public final class DrawableDB { //TODO: delete from hash_set_hits table also... } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); //NON-NLS + LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); } finally { dbWriteUnlock(); } @@ -1093,7 +1093,7 @@ public final class DrawableDB { public class MultipleTransactionException extends IllegalStateException { - private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; //NON-NLS + private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; public MultipleTransactionException() { super(CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO); @@ -1137,12 +1137,12 @@ public final class DrawableDB { dbReadLock(); try { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); while (analyzedQuery.next()) { addImageFileToList(analyzedQuery.getLong(OBJ_ID)); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); } finally { dbReadUnlock(); } @@ -1194,9 +1194,9 @@ public final class DrawableDB { .count(); } } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS + LOGGER.log(Level.WARNING, "Case closed while getting files"); } catch (TskCoreException ex1) { - LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); } return -1; @@ -1231,15 +1231,15 @@ public final class DrawableDB { //count the fileids that are in the given list and don't have a non-zero category assigned to them. String name = - "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList //NON-NLS - + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; //NON-NLS + "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList + + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(name); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - return resultSet.getLong("count(obj_id)"); //NON-NLS + return resultSet.getLong("count(obj_id)"); } } catch (SQLException | TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error getting category count.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error getting category count.", ex); } return -1; @@ -1274,7 +1274,7 @@ public final class DrawableDB { con.setAutoCommit(false); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); } } @@ -1285,7 +1285,7 @@ public final class DrawableDB { con.rollback(); updatedFiles.clear(); } catch (SQLException ex1) { - LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); //NON-NLS + LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); } finally { close(); } @@ -1307,9 +1307,9 @@ public final class DrawableDB { } } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); } else { - LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); //NON-NLS + LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); } rollback(); } @@ -1322,9 +1322,9 @@ public final class DrawableDB { con.setAutoCommit(true); } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); } else { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); //NON-NLS + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); } } finally { closed = true; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java index 979429b880..14fbf4265c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java @@ -186,9 +186,9 @@ public abstract class DrawableFile extends AbstractFile .map(Tag::getName) .collect(Collectors.toSet()); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); } catch (IllegalStateException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); } return Collections.emptySet(); } @@ -223,7 +223,7 @@ public abstract class DrawableFile extends AbstractFile } } } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); } return ""; } @@ -255,7 +255,7 @@ public abstract class DrawableFile extends AbstractFile .orElse(Category.ZERO) ); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); //NON-NLS + LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); } catch (IllegalStateException ex) { // We get here many times if the case is closed during ingest, so don't print out a ton of warnings. } @@ -333,7 +333,7 @@ public abstract class DrawableFile extends AbstractFile drawablePath = StringUtils.removeEnd(getUniquePath(), getName()); return drawablePath; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); return ""; } } @@ -344,7 +344,7 @@ public abstract class DrawableFile extends AbstractFile try { return getHashSetNames(); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); return Collections.emptySet(); } } @@ -362,7 +362,7 @@ public abstract class DrawableFile extends AbstractFile return this.getUniquePath(); } catch (TskCoreException tskCoreException) { String contentName = this.getName(); - LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N return contentName; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java index d9600dcdf4..0d122a6219 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java @@ -28,7 +28,6 @@ import java.util.logging.Level; import java.util.stream.Collectors; import javax.annotation.Nonnull; import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.casemodule.services.TagsManager; @@ -46,7 +45,7 @@ public class DrawableTagsManager { private static final Logger LOGGER = Logger.getLogger(DrawableTagsManager.class.getName()); - private static final String FOLLOW_UP = NbBundle.getMessage(DrawableTagsManager.class, "DrawableTagsManager.followUp.tagName.txt"); + private static final String FOLLOW_UP = "Follow Up"; final private Object autopsyTagsManagerLock = new Object(); private TagsManager autopsyTagsManager; @@ -54,8 +53,8 @@ public class DrawableTagsManager { /** Used to distribute {@link TagsChangeEvent}s */ private final EventBus tagsEventBus = new AsyncEventBus( Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS - LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); //NON-NLS + new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { + LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); }).build() )); @@ -148,7 +147,7 @@ public class DrawableTagsManager { .distinct().sorted() .collect(Collectors.toList()); } catch (TskCoreException | IllegalStateException ex) { - LOGGER.log(Level.WARNING, "couldn't access case", ex); //NON-NLS + LOGGER.log(Level.WARNING, "couldn't access case", ex); } return Collections.emptyList(); } @@ -184,7 +183,7 @@ public class DrawableTagsManager { throw new TskCoreException("tagame exists but wasn't found", ex); } } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); throw new TskCoreException("Case was closed out from underneath", ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java index 9b3b3218f1..a04646c310 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java @@ -46,7 +46,7 @@ public class HashSetManager { try { return db.getHashSetsForFile(fileID); } catch (TskCoreException ex) { - Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); //NON-NLS + Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); return Collections.emptySet(); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java index 01e5cfd983..4249fe3c24 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java @@ -46,7 +46,7 @@ public class ImageFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to read image {0}: " + exception.toString(); //NON-NLS + return "Failed to read image {0}: " + exception.toString(); } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java index a45480bcae..20724ef0bc 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java @@ -29,7 +29,6 @@ import javafx.scene.media.Media; import javafx.scene.media.MediaException; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.VideoUtils; @@ -40,7 +39,7 @@ public class VideoFile extends DrawableFile { private static final Logger LOGGER = Logger.getLogger(VideoFile.class.getName()); - private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); //NON-NLS + private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); VideoFile(T file, Boolean analyzed) { super(file, analyzed); @@ -54,7 +53,7 @@ public class VideoFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to get image preview for video {0}: " + exception.toString(); //NON-NLS + return "Failed to get image preview for video {0}: " + exception.toString(); } @Override @@ -74,7 +73,7 @@ public class VideoFile extends DrawableFile { if (cacheFile.exists() == false || cacheFile.length() < getAbstractFile().getSize()) { Files.createParentDirs(cacheFile); - ProgressHandle progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "VideoFile.progress.text")); + ProgressHandle progressHandle = ProgressHandleFactory.createHandle("writing temporary file to disk"); progressHandle.start(100); ContentUtils.writeToFile(this.getAbstractFile(), cacheFile, progressHandle, null, true); progressHandle.finish(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle.properties deleted file mode 100644 index 7ef8ab2dab..0000000000 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle.properties +++ /dev/null @@ -1,7 +0,0 @@ -GroupManager.progress.regroupingFiles.txt=regrouping files by {0} \: {1} -GroupManager.reGroupTask.displayName.txt=regrouping files by {0} sorted by {1} in {2} order -GroupManager.updateMessage.regroupingFiles.txt=regrouping files by {0} \: {1} -GroupSortBy.fileCount.groupSize.txt=Group Size -GroupSortBy.groupByValue.groupName.txt=Group Name -GroupSortBy.none.txt=None -GroupSortBy.priority.txt=Priority \ No newline at end of file diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/Bundle_ja.properties deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java index 1b8b7d72c8..f3020830a9 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java @@ -126,7 +126,7 @@ public class DrawableGroup implements Comparable { .filter(Boolean::booleanValue) .count()); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); } } @@ -145,7 +145,7 @@ public class DrawableGroup implements Comparable { uncatCount.set(ImageGalleryController.getDefault().getDatabase().getCategoryCount(Category.ZERO, fileIDs)); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); } } @@ -202,7 +202,7 @@ public class DrawableGroup implements Comparable { @Override public String toString() { - return "Grouping{ keyProp=" + groupKey + '}'; //NON-NLS + return "Grouping{ keyProp=" + groupKey + '}'; } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java index 1073d587da..79cbb1fba2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java @@ -57,7 +57,7 @@ public class GroupKey> implements Comparable @Override public String toString() { - return "GroupKey: " + getAttribute().attrName + " = " + getValue(); //NON-NLS + return "GroupKey: " + getAttribute().attrName + " = " + getValue(); } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java index f0b9192f78..200ef32a16 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java @@ -62,7 +62,6 @@ import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Exceptions; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -196,10 +195,10 @@ public class GroupManager { DrawableFile file = db.getFileFromID(fileID); return getGroupKeysForFile(file); } else { - Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); //NON-NLS + Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); } } catch (TskCoreException ex) { - Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); //NON-NLS + Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); } return Collections.emptySet(); } @@ -348,11 +347,11 @@ public class GroupManager { break; case MIME_TYPE: HashSet types = new HashSet<>(); - try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); //NON-NLS + try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final String mimeType = resultSet.getString("mime_type"); // NON-NLS - String objIds = resultSet.getString("group_concat(obj_id)"); // NON-NLS + final String mimeType = resultSet.getString("mime_type"); + String objIds = resultSet.getString("group_concat(obj_id)"); Pattern.compile(",").splitAsStream(objIds) .map(Long::valueOf) @@ -371,7 +370,7 @@ public class GroupManager { return values; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); //NON-NLS + LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); return Collections.emptyList(); } @@ -417,7 +416,7 @@ public class GroupManager { } } - return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); //NON-NLS + return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); } else { List contentTags = tagsManager.getContentTagsByTagName(tagsManager.getTagName(category)); @@ -429,7 +428,7 @@ public class GroupManager { } } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); throw ex; } } @@ -445,7 +444,7 @@ public class GroupManager { } return files; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); throw ex; } } @@ -532,7 +531,7 @@ public class GroupManager { /** * an executor to submit async ui related background tasks to. */ - final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); //NON-NLS + final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); public ReadOnlyDoubleProperty regroupProgress() { return regroupProgress.getReadOnlyProperty(); @@ -683,7 +682,7 @@ public class GroupManager { return group; } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); } } } @@ -694,13 +693,13 @@ public class GroupManager { HashSet hashSet = new HashSet<>(); String query = (null == mimeType) - ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" //NON-NLS - : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; //NON-NLS + ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" + : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(query); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final long fileID = resultSet.getLong("obj_id"); //NON-NLS + final long fileID = resultSet.getLong("obj_id"); if (db.isInDB(fileID)) { hashSet.add(fileID); } @@ -729,7 +728,7 @@ public class GroupManager { private final SortOrder sortOrder; public ReGroupTask(DrawableAttribute groupBy, GroupSortBy sortBy, SortOrder sortOrder) { - super(NbBundle.getMessage(GroupManager.class, "GroupManager.reGroupTask.displayName.txt", groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), true); + super("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", true); this.groupBy = groupBy; this.sortBy = sortBy; @@ -748,7 +747,7 @@ public class GroupManager { return null; } - groupProgress = ProgressHandleFactory.createHandle(NbBundle.getMessage(this.getClass(), "GroupManager.reGroupTask.displayName.txt", groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), this); + groupProgress = ProgressHandleFactory.createHandle("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", this); Platform.runLater(() -> { analyzedGroups.clear(); unSeenGroups.clear(); @@ -766,9 +765,9 @@ public class GroupManager { return null;//abort } p++; - updateMessage(NbBundle.getMessage(this.getClass(), "GroupManager.updateMessage.regroupingFiles.txt", groupBy.attrName.toString(), val)); + updateMessage("regrouping files by " + groupBy.attrName.toString() + " : " + val); updateProgress(p, vals.size()); - groupProgress.progress(NbBundle.getMessage(this.getClass(), "GroupManager.progress.regroupingFiles.txt", groupBy.attrName.toString(), val), p); + groupProgress.progress("regrouping files by " + groupBy.attrName.toString() + " : " + val, p); popuplateIfAnalyzed(new GroupKey(groupBy, val), this); } Platform.runLater(() -> FXCollections.sort(analyzedGroups, sortBy.getGrpComparator(sortOrder))); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java index 7b780697c0..53f464dbb0 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java @@ -27,7 +27,6 @@ import javax.swing.SortOrder; import static javax.swing.SortOrder.ASCENDING; import static javax.swing.SortOrder.DESCENDING; import org.apache.commons.lang3.StringUtils; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; @@ -42,7 +41,7 @@ public enum GroupSortBy implements ComparatorProvider { * sort the groups by the number of files in each sort the groups by the * number of files in each */ - FILE_COUNT(NbBundle.getMessage(GroupSortBy.class, "GroupSortBy.fileCount.groupSize.txt"), true, "folder-open-image.png") { // NON-NLS + FILE_COUNT("Group Size", true, "folder-open-image.png") { @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparingInt(DrawableGroup::getSize)); @@ -57,7 +56,7 @@ public enum GroupSortBy implements ComparatorProvider { * sort the groups by the natural order of the grouping value ( eg group * them by path alphabetically ) */ - GROUP_BY_VALUE(NbBundle.getMessage(GroupSortBy.class, "GroupSortBy.groupByValue.groupName.txt"), true, "folder-rename.png") { // NON-NLS + GROUP_BY_VALUE("Group Name", true, "folder-rename.png") { @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparing(t -> t.getGroupByValueDislpayName())); @@ -72,7 +71,7 @@ public enum GroupSortBy implements ComparatorProvider { * don't sort the groups just use what ever order they come in (ingest * order) */ - NONE(NbBundle.getMessage(GroupSortBy.class, "GroupSortBy.none.txt"), false, "prohibition.png") { // NON-NLS + NONE("None", false, "prohibition.png") { @Override public Comparator getGrpComparator(SortOrder sortOrder) { return new NoOpComparator<>(); @@ -86,7 +85,7 @@ public enum GroupSortBy implements ComparatorProvider { /** * sort the groups by some priority metric to be determined and implemented */ - PRIORITY(NbBundle.getMessage(GroupSortBy.class, "GroupSortBy.priority.txt"), false, "hashset_hits.png") { //NON-NLS + PRIORITY("Priority", false, "hashset_hits.png") { @Override public Comparator getGrpComparator(SortOrder sortOrder) { return Comparator.nullsLast(Comparator.comparingDouble(DrawableGroup::getHashHitDensity).thenComparingInt(DrawableGroup::getSize).reversed()); @@ -129,7 +128,7 @@ public enum GroupSortBy implements ComparatorProvider { public Image getIcon() { if (icon == null) { if (StringUtils.isBlank(imageName) == false) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); } } return icon; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle.properties deleted file mode 100644 index c3840e3376..0000000000 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle.properties +++ /dev/null @@ -1,3 +0,0 @@ -StatusBar.bgTaskLabel.text=Regrouping -StatusBar.fileUpdateTaskLabel.msg=\ File Update Tasks -StatusBar.toolTip.text=Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data. \ No newline at end of file diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Bundle_ja.properties deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java index 872a2afc6b..402694bd07 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java @@ -53,7 +53,7 @@ public class NoGroupsDialog extends GridPane { } private NoGroupsDialog() { - FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); //NON-NLS + FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); } public NoGroupsDialog(String message) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java index b98b0a918f..c1d2fe7a7b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java @@ -28,7 +28,6 @@ import javafx.scene.control.Label; import javafx.scene.control.ProgressBar; import javafx.scene.control.Tooltip; import javafx.scene.layout.AnchorPane; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -70,7 +69,7 @@ public class StatusBar extends AnchorPane { assert bgTaskLabel != null : "fx:id=\"bgTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'."; assert bgTaskProgressBar != null : "fx:id=\"bgTaskProgressBar\" was not injected: check your FXML file 'StatusBar.fxml'."; - fileUpdateTaskLabel.textProperty().bind(controller.getFileUpdateQueueSizeProperty().asString().concat(NbBundle.getMessage(this.getClass(), "StatusBar.fileUpdateTaskLabel.msg")));//;setText(newSize.toString() + " File Update Tasks"); + fileUpdateTaskLabel.textProperty().bind(controller.getFileUpdateQueueSizeProperty().asString().concat(" File Update Tasks"));//;setText(newSize.toString() + " File Update Tasks"); fileTaskProgresBar.progressProperty().bind(controller.getFileUpdateQueueSizeProperty().negate()); // controller.getFileUpdateQueueSizeProperty().addListener((ov, oldSize, newSize) -> { // Platform.runLater(() -> { @@ -84,7 +83,7 @@ public class StatusBar extends AnchorPane { if(controller.regroupProgress().lessThan(1.0).get()){ // Regrouping in progress bgTaskProgressBar.progressProperty().setValue(-1.0); - bgTaskLabel.setText(NbBundle.getMessage(this.getClass(), "StatusBar.bgTaskLabel.text")); + bgTaskLabel.setText("Regrouping"); } else{ // Clear the progress bar bgTaskProgressBar.progressProperty().setValue(0.0); @@ -95,14 +94,14 @@ public class StatusBar extends AnchorPane { Platform.runLater(() -> { - staleLabel.setTooltip(new Tooltip(NbBundle.getMessage(this.getClass(), "StatusBar.toolTip.text"))); + staleLabel.setTooltip(new Tooltip("Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data.")); }); staleLabel.visibleProperty().bind(controller.stale()); } public StatusBar(ImageGalleryController controller) { this.controller = controller; - FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); //NON-NLS + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); fxmlLoader.setRoot(this); fxmlLoader.setController(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java index b9b1c04813..6fe4ce9b44 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java @@ -79,7 +79,7 @@ public class SummaryTablePane extends AnchorPane { public SummaryTablePane(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "SummaryTablePane.fxml"); //NON-NLS + FXMLConstructor.construct(this, "SummaryTablePane.fxml"); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java index 5c68a94436..91ca4a142c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java @@ -142,7 +142,7 @@ public class Toolbar extends ToolBar { try { new TagGroupAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); } }); @@ -213,7 +213,7 @@ public class Toolbar extends ToolBar { private Toolbar(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "Toolbar.fxml"); //NON-NLS + FXMLConstructor.construct(this, "Toolbar.fxml"); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java index b1c675b1cc..9b60278865 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java @@ -46,13 +46,13 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.VideoFile; public class VideoPlayer extends BorderPane { - private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); //NON-NLS - private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); //NON-NLS - private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); //NON-NLS - private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); //NON-NLS + private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); + private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); + private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); + private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); - private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); //NON-NLS - private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); //NON-NLS + private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); + private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); private final MediaPlayer mp; @@ -114,14 +114,14 @@ public class VideoPlayer extends BorderPane { final MediaException ex = mp.getError(); if (ex != null) { Platform.runLater(() -> { - Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); //NON-NLS - setCenter(new Text(ex.getType() + "\nSee the logs for details.")); //NON-NLS + Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); + setCenter(new Text(ex.getType() + "\nSee the logs for details.")); setBottom(null); }); } }); mp.statusProperty().addListener((observableStatus, oldStatus, newStatus) -> { - Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); //NON-NLS + Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); }); mediaView.setMediaPlayer(mp); mediaView.fitHeightProperty().bind(this.heightProperty().subtract(playControlBar.heightProperty())); @@ -236,7 +236,7 @@ public class VideoPlayer extends BorderPane { public VideoPlayer(MediaPlayer mp, VideoFile file) { this.file = file; this.mp = mp; - FXMLConstructor.construct(this, "MediaControl.fxml"); //NON-NLS + FXMLConstructor.construct(this, "MediaControl.fxml"); } protected void updateTime() { @@ -277,10 +277,10 @@ public class VideoPlayer extends BorderPane { int elapsedSeconds = totalSeconds - elapsedMinutes * 60; if (elapsedHours > 0) { - return String.format("%d:%02d:%02d", elapsedHours, //NON-NLS + return String.format("%d:%02d:%02d", elapsedHours, elapsedMinutes, elapsedSeconds); } else { - return String.format("%02d:%02d", elapsedMinutes, //NON-NLS + return String.format("%02d:%02d", elapsedMinutes, elapsedSeconds); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle.properties deleted file mode 100644 index 2b92fdc585..0000000000 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle.properties +++ /dev/null @@ -1,5 +0,0 @@ -DrawableTileBase.menuItem.extractFiles.text=Extract File(s) -DrawableTileBase.menuItem.showContentViewer.txt=Show Content Viewer -GroupPane.headerString.txt={0} -- {1} hash set hits / {2} files -GroupPane.menuItem.extractFiles.text=Extract File(s) -MetaDataPane.tableView.placeholder.text=Select a file to show its details here. \ No newline at end of file diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/Bundle_ja.properties deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java index badfc20b92..674aad0260 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java @@ -54,7 +54,7 @@ public class DrawableTile extends DrawableTileBase { try { setEffect(Objects.equals(newValue, getFileID()) ? LAST_SELECTED_EFFECT : null); } catch (java.lang.IllegalStateException ex) { - Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); //NON-NLS + Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); } }; @@ -78,7 +78,7 @@ public class DrawableTile extends DrawableTileBase { public DrawableTile(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "DrawableTile.fxml"); //NON-NLS + FXMLConstructor.construct(this, "DrawableTile.fxml"); } /** diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java index d2c9f58b90..2058737b3c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java @@ -95,8 +95,8 @@ public abstract class DrawableTileBase extends DrawableUIBase { private static final Border SELECTED_BORDER = new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, new CornerRadii(2), new BorderWidths(3))); //TODO: do this in CSS? -jm - protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); //NON-NLS - protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); //NON-NLS + protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); + protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); protected final FileIDSelectionModel selectionModel; private static ContextMenu contextMenu; @@ -204,7 +204,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { menuItems.add(new AddDrawableTagAction(getController()).getPopupMenu()); - final MenuItem extractMenuItem = new MenuItem(NbBundle.getMessage(this.getClass(), "DrawableTileBase.menuItem.extractFiles.text")); + final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -213,10 +213,10 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); menuItems.add(extractMenuItem); - MenuItem contentViewer = new MenuItem(NbBundle.getMessage(this.getClass(), "DrawableTileBase.menuItem.showContentViewer.txt")); + MenuItem contentViewer = new MenuItem("Show Content Viewer"); contentViewer.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { - new NewWindowViewAction(NbBundle.getMessage(this.getClass(), "DrawableTileBase.menuItem.showContentViewer.txt"), new FileNode(file.getAbstractFile())).actionPerformed(null); + new NewWindowViewAction("Show Content Viewer", new FileNode(file.getAbstractFile())).actionPerformed(null); }); }); menuItems.add(contentViewer); @@ -260,7 +260,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { selectionModel.clearAndSelect(file.getId()); new AddDrawableTagAction(getController()).addTag(getController().getTagsManager().getFollowUpTagName(), ""); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); } } else { new DeleteFollowUpTagAction(getController(), file).handle(event); @@ -276,7 +276,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { return DrawableAttribute.TAGS.getValue(getFile().get()).stream() .anyMatch(followUpTagName::equals); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); return true; } } else { @@ -363,7 +363,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); } }); } @@ -380,7 +380,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { updateFollowUpIcon(); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); } }); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java index 1a6bfd227e..d77eee7f44 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java @@ -102,7 +102,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView try { fileOpt = Optional.ofNullable(getController().getFileFromId(fileIDOpt.get())); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); fileOpt = Optional.empty(); } return fileOpt; @@ -147,7 +147,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView myTask.setOnFailed(failed -> { Throwable exception = myTask.getException(); if (exception instanceof OutOfMemoryError - && exception.getMessage().contains("Java heap space")) { //NON-NLS + && exception.getMessage().contains("Java heap space")) { showErrorNode(Bundle.DrawableUIBase_errorLabel_OOMText(), file); } else { showErrorNode(Bundle.DrawableUIBase_errorLabel_text(), file); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java index 1219e2d1a8..96d30afd93 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java @@ -92,7 +92,7 @@ public interface DrawableView { } catch (NullPointerException ex) { // I think this happens when we're in the process of removing images from the view while // also trying to update it? - Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); //NON-NLS + Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); return false; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java index 87a671f86d..a31001fd2f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java @@ -97,7 +97,6 @@ import org.controlsfx.control.GridView; import org.controlsfx.control.SegmentedButton; import org.controlsfx.control.action.ActionUtils; import org.openide.util.Lookup; -import org.openide.util.NbBundle; import org.openide.util.actions.Presenter; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; @@ -274,7 +273,7 @@ public class GroupPane extends BorderPane { undoAction = new UndoAction(controller); redoAction = new RedoAction(controller); - FXMLConstructor.construct(this, "GroupPane.fxml"); //NON-NLS + FXMLConstructor.construct(this, "GroupPane.fxml"); } @ThreadConfined(type = ThreadType.JFX) @@ -333,7 +332,8 @@ public class GroupPane extends BorderPane { */ protected String getHeaderString() { return isNull(getGroup()) ? "" - : NbBundle.getMessage(this.getClass(), "GroupPane.headerString.txt", StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()), getGroup().getHashSetHitsCount(), getGroup().getSize()); + : StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()) + " -- " + + getGroup().getHashSetHitsCount() + " hash set hits / " + getGroup().getSize() + " files"; } ContextMenu getContextMenu() { @@ -451,13 +451,13 @@ public class GroupPane extends BorderPane { try { tagSelectedSplitMenu.setText(controller.getTagsManager().getFollowUpTagName().getDisplayName()); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); } tagSelectedSplitMenu.setOnAction(actionEvent -> { try { new TagSelectedFilesAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); } }); @@ -528,7 +528,7 @@ public class GroupPane extends BorderPane { } } } - final MenuItem extractMenuItem = new MenuItem(NbBundle.getMessage(this.getClass(), "GroupPane.menuItem.extractFiles.text")); + final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -730,7 +730,7 @@ public class GroupPane extends BorderPane { if (gridView == null || gridView.getSkin() == null) { return Optional.empty(); } - return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); //NON-NLS + return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); } void makeSelection(Boolean shiftDown, Long newFileID) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java index 1da350a189..32b8b8c71f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java @@ -50,7 +50,6 @@ import javafx.scene.input.KeyEvent; import javafx.scene.layout.Region; import javafx.scene.text.Text; import javafx.util.Pair; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.coreutils.Logger; @@ -85,7 +84,7 @@ public class MetaDataPane extends DrawableUIBase { public MetaDataPane(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "MetaDataPane.fxml"); //NON-NLS + FXMLConstructor.construct(this, "MetaDataPane.fxml"); } @FXML @@ -117,7 +116,7 @@ public class MetaDataPane extends DrawableUIBase { }); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(NbBundle.getMessage(this.getClass(), "MetaDataPane.tableView.placeholder.text"))); + tableView.setPlaceholder(new Label("Select a file to show its details here.")); tableView.getColumns().setAll(Arrays.asList(attributeColumn, valueColumn)); attributeColumn.setPrefWidth(USE_COMPUTED_SIZE); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java index a73e84b7fc..59d747a655 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java @@ -77,7 +77,7 @@ public class SlideShowView extends DrawableTileBase { SlideShowView(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "SlideShowView.fxml"); //NON-NLS + FXMLConstructor.construct(this, "SlideShowView.fxml"); } @FXML @@ -137,7 +137,7 @@ public class SlideShowView extends DrawableTileBase { }); } catch (NullPointerException ex) { // The case has likely been closed - LOGGER.log(Level.WARNING, "Error accessing groupPane"); //NON-NLS + LOGGER.log(Level.WARNING, "Error accessing groupPane"); } } @@ -280,7 +280,7 @@ public class SlideShowView extends DrawableTileBase { */ private String getSupplementalText() { final ObservableList fileIds = getGroupPane().getGroup().getFileIDs(); - return getFileID().map(fileID -> " ( " + (fileIds.indexOf(fileID) + 1) + " of " + fileIds.size() + " in group )") // NON-NLS + return getFileID().map(fileID -> " ( " + (fileIds.indexOf(fileID) + 1) + " of " + fileIds.size() + " in group )") .orElse(""); } @@ -324,7 +324,7 @@ public class SlideShowView extends DrawableTileBase { final Media media = file.getMedia(); return new VideoPlayer(new MediaPlayer(media), file); } catch (MediaException | IOException | OutOfMemoryError ex) { - LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); return doReadImageTask(file); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle.properties deleted file mode 100644 index 895855c779..0000000000 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle.properties +++ /dev/null @@ -1,7 +0,0 @@ -GroupComparators.groupName.txt=Group Name -GroupComparators.groupSize.txt=Group Size -GroupComparators.hitCount.txt=Hit Count -GroupComparators.hitDensity.txt=Hit Density -GroupComparators.uncategorizedCount.txt=Uncategorized Count -GroupTree.allGroups.txt=All Groups -HashHitGroupList.onlyHashHits.txt=Only Hash Hits \ No newline at end of file diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle_ja.properties b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/Bundle_ja.properties deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java index 26c88c05b1..c7bce311c4 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java @@ -21,8 +21,6 @@ package org.sleuthkit.autopsy.imagegallery.gui.navpanel; import com.google.common.collect.ImmutableList; import java.util.Comparator; import java.util.function.Function; - -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup; /** @@ -31,19 +29,19 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup; final class GroupComparators> implements Comparator { static final GroupComparators UNCATEGORIZED_COUNT = - new GroupComparators<>(NbBundle.getMessage(GroupComparators.class, "GroupComparators.uncategorizedCount.txt"), DrawableGroup::getUncategorizedCount, String::valueOf, false); + new GroupComparators<>("Uncategorized Count", DrawableGroup::getUncategorizedCount, String::valueOf, false); static final GroupComparators ALPHABETICAL = - new GroupComparators<>(NbBundle.getMessage(GroupComparators.class, "GroupComparators.groupName.txt"), DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); + new GroupComparators<>("Group Name", DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); static final GroupComparators HIT_COUNT = - new GroupComparators<>(NbBundle.getMessage(GroupComparators.class, "GroupComparators.hitCount.txt"), DrawableGroup::getHashSetHitsCount, String::valueOf, true); + new GroupComparators<>("Hit Count", DrawableGroup::getHashSetHitsCount, String::valueOf, true); static final GroupComparators FILE_COUNT = - new GroupComparators<>(NbBundle.getMessage(GroupComparators.class, "GroupComparators.groupSize.txt"), DrawableGroup::getSize, String::valueOf, true); + new GroupComparators<>("Group Size", DrawableGroup::getSize, String::valueOf, true); static final GroupComparators HIT_FILE_RATIO = - new GroupComparators<>(NbBundle.getMessage(GroupComparators.class, "GroupComparators.hitDensity.txt"), DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); // NON-NLS + new GroupComparators<>("Hit Density", DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); private final static ImmutableList> values = ImmutableList.of(UNCATEGORIZED_COUNT, ALPHABETICAL, HIT_COUNT, FILE_COUNT, HIT_FILE_RATIO); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java index 37caa8bd78..6951d67997 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java @@ -42,7 +42,7 @@ class GroupListCell extends ListCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); /** * reference to group files listener that allows us to remove it from a @@ -70,8 +70,8 @@ class GroupListCell extends ListCell { GroupListCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -145,7 +145,7 @@ class GroupListCell extends ListCell { private String getSeenStyleClass() { return Optional.ofNullable(getItem()) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS + .map(seen -> seen ? "" : "-fx-font-weight:bold;") .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java index ffb33a5452..e371644944 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java @@ -32,7 +32,6 @@ import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; import javafx.scene.image.ImageView; import org.apache.commons.lang3.StringUtils; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -54,15 +53,15 @@ final public class GroupTree extends NavPanel> { public GroupTree(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS + FXMLConstructor.construct(this, "NavPanel.fxml"); } @FXML @Override void initialize() { super.initialize(); - setText(NbBundle.getMessage(this.getClass(), "GroupTree.allGroups.txt")); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); //NON-NLS + setText("All Groups"); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); getBorderPane().setCenter(groupTree); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java index a26ec693c7..917aa35084 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java @@ -47,7 +47,7 @@ class GroupTreeCell extends TreeCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); /** * reference to group files listener that allows us to remove it from a @@ -75,8 +75,8 @@ class GroupTreeCell extends TreeCell { GroupTreeCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -161,7 +161,7 @@ class GroupTreeCell extends TreeCell { return Optional.ofNullable(getItem()) .map(GroupTreeNode::getGroup) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS + .map(seen -> seen ? "" : "-fx-font-weight:bold;") .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java index 6c8fffce1d..71f8aa026f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java @@ -24,7 +24,6 @@ import javafx.fxml.FXML; import javafx.scene.control.ListView; import javafx.scene.control.SelectionModel; import javafx.scene.image.ImageView; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -48,7 +47,7 @@ final public class HashHitGroupList extends NavPanel { public HashHitGroupList(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS + FXMLConstructor.construct(this, "NavPanel.fxml"); } @ThreadConfined(type = ThreadConfined.ThreadType.JFX) @@ -72,8 +71,8 @@ final public class HashHitGroupList extends NavPanel { void initialize() { super.initialize(); - setText(NbBundle.getMessage(this.getClass(), "HashHitGroupList.onlyHashHits.txt")); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); //NON-NLS + setText("Only Hash Hits"); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); getBorderPane().setCenter(groupList); sorted = getController().getGroupManager().getAnalyzedGroups().filtered((DrawableGroup t) -> t.getHashSetHitsCount() > 0).sorted(getDefaultComparator()); From 518eccb7e9c9331bae8c669577c5aa94e9a18406 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sat, 30 Jan 2016 13:48:20 -0500 Subject: [PATCH 32/48] Make CaseMetadata handle XMLCaseManagement NPEs --- .../autopsy/casemodule/CaseMetadata.java | 56 +++++++++++---- .../casemodule/OpenRecentCasePanel.java | 72 ++++++++++--------- 2 files changed, 81 insertions(+), 47 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseMetadata.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseMetadata.java index c43b981db2..81e53a1fc9 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseMetadata.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseMetadata.java @@ -59,25 +59,53 @@ public final class CaseMetadata { try { /* * TODO (RC): This class should eventually replace the non-public - * XMLCaseManagement class altogether. + * and unsafe XMLCaseManagement class altogether. */ XMLCaseManagement metadata = new XMLCaseManagement(); metadata.open(metadataFilePath.toString()); - caseType = metadata.getCaseType(); - caseName = metadata.getCaseName(); - if (caseName.isEmpty()) { - throw new CaseMetadataException("Case name missing"); + try { + caseType = metadata.getCaseType(); + } catch (NullPointerException unused) { + throw new CaseMetadataException("Case type element missing"); } - caseNumber = metadata.getCaseNumber(); - examiner = metadata.getCaseExaminer(); - caseDirectory = metadata.getCaseDirectory(); - if (caseDirectory.isEmpty()) { - throw new CaseMetadataException("Case directory missing"); + try { + caseName = metadata.getCaseName(); + if (caseName.isEmpty()) { + throw new CaseMetadataException("Case name missing"); + } + } catch (NullPointerException unused) { + throw new CaseMetadataException("Case name element missing"); } - caseDatabaseName = metadata.getDatabaseName(); - caseTextIndexName = metadata.getTextIndexName(); - if (Case.CaseType.MULTI_USER_CASE == caseType && caseDatabaseName.isEmpty()) { - throw new CaseMetadataException("Case database name missing"); + try { + caseNumber = metadata.getCaseNumber(); + } catch (NullPointerException unused) { + throw new CaseMetadataException("Case number element missing"); + } + try { + examiner = metadata.getCaseExaminer(); + } catch (NullPointerException unused) { + throw new CaseMetadataException("Examiner element missing"); + } + try { + caseDirectory = metadata.getCaseDirectory(); + if (caseDirectory.isEmpty()) { + throw new CaseMetadataException("Case directory missing"); + } + } catch (NullPointerException unused) { + throw new CaseMetadataException("Case directory element missing"); + } + try { + caseDatabaseName = metadata.getDatabaseName(); + } catch (NullPointerException unused) { + throw new CaseMetadataException("Case database element missing"); + } + try { + caseTextIndexName = metadata.getTextIndexName(); + if (Case.CaseType.MULTI_USER_CASE == caseType && caseDatabaseName.isEmpty()) { + throw new CaseMetadataException("Case keyword search index name missing"); + } + } catch (NullPointerException unused) { + throw new CaseMetadataException("Case keyword search index name missing"); } } catch (CaseActionException ex) { throw new CaseMetadataException(ex.getLocalizedMessage(), ex); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java index df588ab42e..6a0c0742eb 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java @@ -32,22 +32,38 @@ import org.openide.windows.WindowManager; import java.awt.Cursor; /** - * Panel show from the splash dialog that shows recent cases and allows them to - * be opened. + * Panel used by the the open recent case option of the start window. */ -final class OpenRecentCasePanel extends javax.swing.JPanel { +class OpenRecentCasePanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; + private static final Logger logger = Logger.getLogger(OpenRecentCasePanel.class.getName()); private static OpenRecentCasePanel instance; private static String[] caseNames; private static String[] casePaths; - private static final Logger logger = Logger.getLogger(OpenRecentCasePanel.class.getName()); private RecentCasesTableModel model; private OpenRecentCasePanel() { initComponents(); } + static OpenRecentCasePanel getInstance() { + if (instance == null) { + instance = new OpenRecentCasePanel(); + } + instance.generateRecentCases(); // refresh the case list + return instance; + } + + /** + * Sets the Close button action listener. + * + * @param e the action listener + */ + public void setCloseButtonActionListener(ActionListener e) { + this.cancelButton.addActionListener(e); + } + /** * Retrieves all the recent cases and adds them to the table. */ @@ -69,43 +85,35 @@ final class OpenRecentCasePanel extends javax.swing.JPanel { openButton.setEnabled(false); } } - - static OpenRecentCasePanel getInstance() { - if (instance == null) { - instance = new OpenRecentCasePanel(); - } - instance.generateRecentCases(); // refresh the case list - return instance; - } - + // Open the selected case private void openCase() { if (casePaths.length < 1) { - logger.log(Level.INFO, "No Case paths exist, cannot open the case"); //NON-NLS return; } final String casePath = casePaths[imagesTable.getSelectedRow()]; final String caseName = caseNames[imagesTable.getSelectedRow()]; if (!casePath.equals("")) { - // Close the startup menu try { StartupWindowProvider.getInstance().close(); CueBannerPanel.closeOpenRecentCasesWindow(); } catch (Exception ex) { - logger.log(Level.WARNING, "Error: couldn't open case: " + caseName, ex); //NON-NLS + logger.log(Level.SEVERE, "Error closing start up window", ex); //NON-NLS } - // Open the recent cases + + /* + * Verify the case name and metadata file path. + */ if (caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())) { JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), - NbBundle.getMessage(this.getClass(), - "OpenRecentCasePanel.openCase.msgDlg.caseDoesntExist.msg", - caseName), - NbBundle.getMessage(this.getClass(), - "OpenRecentCasePanel.openCase.msgDlg.err"), + NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.text", caseName), + NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); RecentCases.getInstance().removeRecentCase(caseName, casePath); // remove the recent case if it doesn't exist anymore - //if case is not opened, open the start window + /* + * If a case was not already open, pop up the start window. + */ if (Case.isCaseOpen() == false) { StartupWindowProvider.getInstance().open(); } @@ -119,9 +127,16 @@ final class OpenRecentCasePanel extends javax.swing.JPanel { Case.open(casePath); } catch (CaseActionException ex) { SwingUtilities.invokeLater(() -> { + logger.log(Level.SEVERE, String.format("Error opening case with metadata file path %s", casePath), ex); //NON-NLS WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getMessage(), + JOptionPane.showMessageDialog( + WindowManager.getDefault().getMainWindow(), + ex.getMessage(), NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); //NON-NLS + /* + * If a case was not already open, pop up the start + * window. + */ if (!Case.isCaseOpen()) { StartupWindowProvider.getInstance().open(); } @@ -132,15 +147,6 @@ final class OpenRecentCasePanel extends javax.swing.JPanel { } } - /** - * Sets the Close button action listener. - * - * @param e the action listener - */ - public void setCloseButtonActionListener(ActionListener e) { - this.cancelButton.addActionListener(e); - } - /** * Table model to keep track of recent cases. */ From 1a908d109f9d9f657d5df53f0cd666d6ac6b0d0b Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sat, 30 Jan 2016 15:00:03 -0500 Subject: [PATCH 33/48] Accurate user-friendly case create/open error dialogs --- .../autopsy/casemodule/Bundle.properties | 17 +- .../autopsy/casemodule/Bundle_ja.properties | 3 - .../sleuthkit/autopsy/casemodule/Case.java | 228 +++++++++--------- .../autopsy/casemodule/CaseOpenAction.java | 47 ++-- .../casemodule/NewCaseWizardAction.java | 68 +++--- .../casemodule/OpenRecentCasePanel.java | 69 ++++-- .../autopsy/casemodule/RecentItems.java | 76 +++--- 7 files changed, 281 insertions(+), 227 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 2232085c5b..9a711047a8 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -108,11 +108,11 @@ AddImageWizardIterator.stepXofN=Step {0} of {1} AddLocalFilesTask.localFileAdd.progress.text=Adding\: {0}/{1} Case.getCurCase.exception.noneOpen=Cannot get the current case; there is no case open\! Case.create.exception.msg=Error creating a case\: {0} in dir {1} -Case.databaseConnectionInfo.error.msg=Error accessing case database connection info +Case.databaseConnectionInfo.error.msg=Error accessing database server connection info. See Tools, Options, Multi-user. Case.open.exception.blankCase.msg=Case name is blank. Case.open.msgDlg.updated.msg=Updated case database schema.\nA backup copy of the database with the following path has been made\:\n {0} Case.open.msgDlg.updated.title=Case Database Schema Update -Case.open.exception.checkFile.msg=Check that you selected the correct case file (usually with {0} extension) +Case.open.exception.checkFile.msg=Case file must have {0} extension. Case.open.exception.multiUserCaseNotEnabled=Cannot open a multi-user case if multi-user cases are not enabled. See Tools, Options, Multi-user. Case.checkImgExist.confDlg.doesntExist.msg={0} has detected that one of the images associated with \n\ this case are missing. Would you like to search for them now?\n\ @@ -139,6 +139,9 @@ Case.createCaseDir.exception.gen=Could not create case directory\: {0} Case.CollaborationSetup.FailNotify.ErrMsg=Failed to connect to any other nodes that may be collaborating on this case. Case.CollaborationSetup.FailNotify.Title=Connection Failure Case.GetCaseTypeGivenPath.Failure=Unable to get case type +Case.metaDataFileCorrupt.exception.msg=The case metadata file (.aut) is corrupted. +Case.deleteReports.deleteFromDiskException.log.msg=Unable to delete the report from the disk. +Case.deleteReports.deleteFromDiskException.msg=Unable to delete the report {0} from the disk.\nYou may manually delete it from {1} CaseDeleteAction.closeConfMsg.text=Are you sure want to close and delete this case? \n\ Case Name\: {0}\n\ Case Directory\: {1} @@ -208,14 +211,11 @@ NewCaseWizardPanel1.validate.errMsg.cantCreateDir=Error\: Could not create direc NewCaseWizardPanel1.validate.errMsg.invalidBaseDir.msg=ERROR\: The Base Directory that you entered is not valid.\nPlease enter a valid Base Directory. NewCaseWizardPanel1.createDir.errMsg.cantCreateDir.msg=ERROR\: Could not create the case directory. \nPlease enter a valid Case Name and Directory. NewCaseWizardPanel2.validate.errCreateCase.msg=Error creating case -OpenRecentCasePanel.openCase.msgDlg.caseDoesntExist.msg=Error\: Case {0} does not exist. -OpenRecentCasePanel.openCase.msgDlg.err=Error OpenRecentCasePanel.colName.caseName=Case Name OpenRecentCasePanel.colName.path=Path RecentCases.exception.caseIdxOutOfRange.msg=Recent case index {0} is out of range. RecentCases.getName.text=Clear Recent Cases -RecentItems.openRecentCase.msgDlg.text=Error\: Case {0} does not exist. -RecentItems.openRecentCase.msgDlg.err=Error +RecentItems.openRecentCase.msgDlg.text=Case {0} no longer exists. StartupWindow.title.text=Welcome UpdateRecentCases.menuItem.clearRecentCases.text=Clear Recent Cases UpdateRecentCases.menuItem.empty=-Empty- @@ -240,17 +240,14 @@ NewCaseVisualPanel1.caseParentDirWarningLabel.text= NewCaseVisualPanel1.multiUserCaseRadioButton.text=Multi-user NewCaseVisualPanel1.singleUserCaseRadioButton.text=Single-user NewCaseVisualPanel1.caseTypeLabel.text=Case Type: -Case.deleteReports.deleteFromDiskException.log.msg=Unable to delete the report from the disk. -Case.deleteReports.deleteFromDiskException.msg=Unable to delete the report {0} from the disk.\nYou may manually delete it from {1} CasePropertiesForm.lbDbType.text=Case Type: CasePropertiesForm.tbDbType.text= CasePropertiesForm.lbDbName.text=Database Name: CasePropertiesForm.tbDbName.text= -CaseExceptionWarning.CheckMultiUserOptions=Check Multi-user options. SingleUserCaseConverter.BadDatabaseFileName=Database file does not exist! SingleUserCaseConverter.AlreadyMultiUser=Case is already multi-user! SingleUserCaseConverter.NonUniqueDatabaseName=Database name not unique. SingleUserCaseConverter.UnableToCopySourceImages=Unable to copy source images SingleUserCaseConverter.CanNotOpenDatabase=Unable to open database CloseCaseWhileIngesting.Warning=Ingest is running. Are you sure you want to close the case? -CloseCaseWhileIngesting.Warning.title=Warning\: This will close the current case +CloseCaseWhileIngesting.Warning.title=Warning\: This will close the current case \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties index 6895817f35..e61c8bf1cb 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties @@ -192,14 +192,11 @@ NewCaseWizardPanel1.validate.errMsg.cantCreateDir=\u30a8\u30e9\u30fc\uff1a\u30c7 NewCaseWizardPanel1.validate.errMsg.invalidBaseDir.msg=\u30a8\u30e9\u30fc\uff1a\u5165\u529b\u3057\u305f\u30d9\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\n\u6709\u52b9\u306a\u30d9\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002 NewCaseWizardPanel1.createDir.errMsg.cantCreateDir.msg=\u30a8\u30e9\u30fc\uff1a\u30b1\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\n\u6709\u52b9\u306a\u30b1\u30fc\u30b9\u540d\u304a\u3088\u3073\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002 NewCaseWizardPanel2.validate.errCreateCase.msg=\u30b1\u30fc\u30b9\u4f5c\u6210\u30a8\u30e9\u30fc -OpenRecentCasePanel.openCase.msgDlg.caseDoesntExist.msg=\u30a8\u30e9\u30fc\uff1a\u30b1\u30fc\u30b9{0}\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002 -OpenRecentCasePanel.openCase.msgDlg.err=\u30a8\u30e9\u30fc OpenRecentCasePanel.colName.caseName=\u30b1\u30fc\u30b9\u540d OpenRecentCasePanel.colName.path=\u30d1\u30b9 RecentCases.exception.caseIdxOutOfRange.msg=\u6700\u8fd1\u306e\u30b1\u30fc\u30b9\u30a4\u30f3\u30c7\u30c3\u30af\u30b9{0}\u306f\u7bc4\u56f2\u5916\u3067\u3059\u3002 RecentCases.getName.text=\u6700\u8fd1\u958b\u3044\u305f\u30b1\u30fc\u30b9\u3092\u30af\u30ea\u30a2 RecentItems.openRecentCase.msgDlg.text=\u30a8\u30e9\u30fc\uff1a\u30b1\u30fc\u30b9{0}\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002 -RecentItems.openRecentCase.msgDlg.err=\u30a8\u30e9\u30fc StartupWindow.title.text=\u3088\u3046\u3053\u305d UpdateRecentCases.menuItem.clearRecentCases.text=\u6700\u8fd1\u958b\u3044\u305f\u30b1\u30fc\u30b9\u3092\u30af\u30ea\u30a2 UpdateRecentCases.menuItem.empty=-\u7a7a\u767d- diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index fbf53a99fc..b9d67f8746 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -384,7 +384,8 @@ public class Case implements SleuthkitCase.ErrorObserver { @Override public void receiveError(String context, String errorMessage) { - /* NOTE: We are accessing tskErrorReporter from two different threads. + /* + * NOTE: We are accessing tskErrorReporter from two different threads. * This is ok as long as we only read the value of tskErrorReporter * because tskErrorReporter is declared as volatile. */ @@ -398,63 +399,87 @@ public class Case implements SleuthkitCase.ErrorObserver { } /** - * Creates a new case (create the XML config file and database). Overload - * for API consistency, defaults to a single-user case. + * Creates a single-user new case. * - * @param caseDir The directory to store case data in. Will be created if - * it doesn't already exist. If it exists, it should have - * all of the needed sub dirs that createCaseDirectory() - * will create. - * @param caseName the name of case - * @param caseNumber the case number - * @param examiner the examiner for this case + * @param caseDir The full path of the case directory. It will be created + * if it doesn't already exist; if it exists, it should + * have been created using Case.createCaseDirectory() to + * ensure that the required sub-directories aere created. + * @param caseName The name of case. + * @param caseNumber The case number, can be the empty string. + * @param examiner The examiner to associate with the case, can be the + * empty string. * - * @throws org.sleuthkit.autopsy.casemodule.CaseActionException + * @throws CaseActionException if there is a problem creating the case. The + * exception will have a user-friendly message + * and may be a wrapper for a lower-level + * exception. If so, + * CaseActionException.getCause will return a + * Throwable (null otherwise). */ public static void create(String caseDir, String caseName, String caseNumber, String examiner) throws CaseActionException { create(caseDir, caseName, caseNumber, examiner, CaseType.SINGLE_USER_CASE); } /** - * Creates a new case (create the XML config file and database) + * Creates a new case. * - * @param caseDir The directory to store case data in. Will be created if - * it doesn't already exist. If it exists, it should have - * all of the needed sub dirs that createCaseDirectory() - * will create. - * @param caseName the name of case - * @param caseNumber the case number - * @param examiner the examiner for this case - * @param caseType the type of case, single-user or multi-user + * @param caseDir The full path of the case directory. It will be created + * if it doesn't already exist; if it exists, it should + * have been created using Case.createCaseDirectory() to + * ensure that the required sub-directories aere created. + * @param caseName The name of case. + * @param caseNumber The case number, can be the empty string. + * @param examiner The examiner to associate with the case, can be the + * empty string. + * @param caseType The type of case (single-user or multi-user). The + * exception will have a user-friendly message and may be + * a wrapper for a lower-level exception. If so, + * CaseActionException.getCause will return a Throwable + * (null otherwise). + * + * @throws CaseActionException if there is a problem creating the case. */ public static void create(String caseDir, String caseName, String caseNumber, String examiner, CaseType caseType) throws CaseActionException { - logger.log(Level.INFO, "Creating new case.\ncaseDir: {0}\ncaseName: {1}", new Object[]{caseDir, caseName}); //NON-NLS + logger.log(Level.INFO, "Creating case with case directory {0}, caseName {1}", new Object[]{caseDir, caseName}); //NON-NLS - // create case directory if it doesn't already exist. + /* + * Create case directory if it doesn't already exist. + */ if (new File(caseDir).exists() == false) { Case.createCaseDirectory(caseDir, caseType); } - String configFilePath = caseDir + File.separator + caseName + CASE_DOT_EXTENSION; - - XMLCaseManagement xmlcm = new XMLCaseManagement(); - + /* + * Sanitize the case name, create a unique keyword search index name, + * and create a standard (single-user) or unique (multi-user) case + * database name. + */ + String santizedCaseName = sanitizeCaseName(caseName); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss"); Date date = new Date(); - String santizedCaseName = sanitizeCaseName(caseName); String indexName = santizedCaseName + "_" + dateFormat.format(date); String dbName = null; - - // figure out the database name and index name for text extraction if (caseType == CaseType.SINGLE_USER_CASE) { dbName = caseDir + File.separator + "autopsy.db"; //NON-NLS } else if (caseType == CaseType.MULTI_USER_CASE) { dbName = indexName; } - xmlcm.create(caseDir, caseName, examiner, caseNumber, caseType, dbName, indexName); // create a new XML config file + /* + * Create the case metadata (.aut) file. + * + * TODO (AUT-1885): Replace use of obsolete and unsafe XMLCaseManagement + * class with use of CaseMetadata class. + */ + String configFilePath = caseDir + File.separator + caseName + CASE_DOT_EXTENSION; + XMLCaseManagement xmlcm = new XMLCaseManagement(); + xmlcm.create(caseDir, caseName, examiner, caseNumber, caseType, dbName, indexName); xmlcm.writeFile(); + /* + * Create the case database. + */ SleuthkitCase db = null; try { if (caseType == CaseType.SINGLE_USER_CASE) { @@ -463,24 +488,23 @@ public class Case implements SleuthkitCase.ErrorObserver { db = SleuthkitCase.newCase(dbName, UserPreferences.getDatabaseConnectionInfo(), caseDir); } } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error creating a case: " + caseName + " in dir " + caseDir + " " + ex.getMessage(), ex); //NON-NLS + logger.log(Level.SEVERE, String.format("Error creating a case %s in %s ", caseName, caseDir), ex); //NON-NLS SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); + /* + * SleuthkitCase.newCase throws TskCoreExceptions with user-friendly + * messages, so propagate the exception message. + */ throw new CaseActionException(ex.getMessage(), ex); //NON-NLS } catch (UserPreferencesException ex) { logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); - throw new CaseActionException( - NbBundle.getMessage(Case.class, "Case.databaseConnectionInfo.error.msg"), ex); + throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.databaseConnectionInfo.error.msg"), ex); } - /** - * Two-stage initialization to avoid leaking reference to "this" in - * constructor. - */ Case newCase = new Case(caseName, caseNumber, examiner, configFilePath, xmlcm, db, caseType); changeCase(newCase); } @@ -549,20 +573,28 @@ public class Case implements SleuthkitCase.ErrorObserver { /** * Opens an existing case. * - * @param caseMetadataFilePath The path of the case metadata file for the - * case to be opened. + * @param caseMetadataFilePath The path of the case metadata file. * - * @throws CaseActionException + * @throws CaseActionException if there is a problem opening the case. The + * exception will have a user-friendly message + * and may be a wrapper for a lower-level + * exception. If so, + * CaseActionException.getCause will return a + * Throwable (null otherwise). */ public static void open(String caseMetadataFilePath) throws CaseActionException { + logger.log(Level.INFO, "Opening case with metadata file path {0}", caseMetadataFilePath); //NON-NLS + + /* + * Verify the extension of the case metadata file. + */ if (!caseMetadataFilePath.endsWith(CASE_DOT_EXTENSION)) { throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.checkFile.msg", CASE_DOT_EXTENSION)); } - logger.log(Level.INFO, "Opening case, case metadata file path: {0}", caseMetadataFilePath); //NON-NLS try { - /** - * Get the case metadata from the file. + /* + * Get the case metadata required to open the case database. */ CaseMetadata metadata = new CaseMetadata(Paths.get(caseMetadataFilePath)); String caseName = metadata.getCaseName(); @@ -571,7 +603,7 @@ public class Case implements SleuthkitCase.ErrorObserver { CaseType caseType = metadata.getCaseType(); String caseDir = metadata.getCaseDirectory(); - /** + /* * Open the case database. */ SleuthkitCase db; @@ -585,40 +617,57 @@ public class Case implements SleuthkitCase.ErrorObserver { try { db = SleuthkitCase.openCase(metadata.getCaseDatabaseName(), UserPreferences.getDatabaseConnectionInfo(), caseDir); } catch (UserPreferencesException ex) { - logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.databaseConnectionInfo.error.msg"), ex); } } - /** - * Do things that require a UI. + /* + * Check for the presence of the UI and do things that can only be + * done with user interaction. */ if (RuntimeProperties.coreComponentsAreActive()) { - /** + /* * If the case database was upgraded for a new schema, notify * the user. */ if (null != db.getBackupDatabasePath()) { SwingUtilities.invokeLater(() -> { - JOptionPane.showMessageDialog(null, - NbBundle.getMessage(Case.class, "Case.open.msgDlg.updated.msg", - db.getBackupDatabasePath()), + JOptionPane.showMessageDialog( + WindowManager.getDefault().getMainWindow(), + NbBundle.getMessage(Case.class, "Case.open.msgDlg.updated.msg", db.getBackupDatabasePath()), NbBundle.getMessage(Case.class, "Case.open.msgDlg.updated.title"), JOptionPane.INFORMATION_MESSAGE); }); } - /** - * TODO: This currently has no value if it there is no user to - * interact with a fid missing images dialog. + /* + * Look for the files for the data sources listed in the case + * database and give the user the opportunity to locate any that + * are missing. */ - checkImagesExist(db); + Map imgPaths = getImagePaths(db); + for (Map.Entry entry : imgPaths.entrySet()) { + long obj_id = entry.getKey(); + String path = entry.getValue(); + boolean fileExists = (pathExists(path) || driveExists(path)); + if (!fileExists) { + int ret = JOptionPane.showConfirmDialog( + WindowManager.getDefault().getMainWindow(), + NbBundle.getMessage(Case.class, "Case.checkImgExist.confDlg.doesntExist.msg", getAppName(), path), + NbBundle.getMessage(Case.class, "Case.checkImgExist.confDlg.doesntExist.title"), + JOptionPane.YES_NO_OPTION); + if (ret == JOptionPane.YES_OPTION) { + MissingImageDialog.makeDialog(obj_id, db); + } else { + logger.log(Level.WARNING, "Selected image files don't match old files!"); //NON-NLS + } + } + } } - /** - * Two-stage initialization to avoid leaking reference to "this" in - * constructor. TODO: Remove use of obsolete XMLCaseManagement - * class. + /* + * TODO (AUT-1885): Replace use of obsolete and unsafe + * XMLCaseManagement class with use of CaseMetadata class. */ XMLCaseManagement xmlcm = new XMLCaseManagement(); xmlcm.open(caseMetadataFilePath); @@ -626,28 +675,16 @@ public class Case implements SleuthkitCase.ErrorObserver { changeCase(openedCase); } catch (CaseMetadataException ex) { - /** - * Attempt clean up. - */ - try { - Case badCase = Case.getCurrentCase(); - badCase.closeCase(); - } catch (IllegalStateException ignored) { - } - throw new CaseActionException(ex.getMessage(), ex); //NON-NLS + throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.metaDataFileCorrupt.exception.msg"), ex); //NON-NLS } catch (TskCoreException ex) { - /** - * Attempt clean up. - */ - try { - Case badCase = Case.getCurrentCase(); - badCase.closeCase(); - } catch (IllegalStateException ignored) { - } SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); - throw new CaseActionException(ex.getMessage(), ex); //NON-NLS + /* + * SleuthkitCase.openCase throws TskCoreExceptions with + * user-friendly messages, so propagate the exception message. + */ + throw new CaseActionException(ex.getMessage(), ex); } } @@ -666,35 +703,6 @@ public class Case implements SleuthkitCase.ErrorObserver { return imgPaths; } - /** - * Ensure that all image paths point to valid image files - */ - private static void checkImagesExist(SleuthkitCase db) { - Map imgPaths = getImagePaths(db); - for (Map.Entry entry : imgPaths.entrySet()) { - long obj_id = entry.getKey(); - String path = entry.getValue(); - boolean fileExists = (pathExists(path) || driveExists(path)); - if (!fileExists) { - int ret = JOptionPane.showConfirmDialog(null, - NbBundle.getMessage(Case.class, - "Case.checkImgExist.confDlg.doesntExist.msg", - getAppName(), path), - NbBundle.getMessage(Case.class, - "Case.checkImgExist.confDlg.doesntExist.title"), - JOptionPane.YES_NO_OPTION); - if (ret == JOptionPane.YES_OPTION) { - - MissingImageDialog.makeDialog(obj_id, db); - - } else { - logger.log(Level.WARNING, "Selected image files don't match old files!"); //NON-NLS - } - - } - } - } - /** * Adds the image to the current case after it has been added to the DB. * Sends out event and reopens windows if needed. @@ -1585,10 +1593,10 @@ public class Case implements SleuthkitCase.ErrorObserver { if (RuntimeProperties.coreComponentsAreActive()) { // enable these menus - CallableSystemAction.get(AddImageAction.class).setEnabled(true); - CallableSystemAction.get(CaseCloseAction.class).setEnabled(true); - CallableSystemAction.get(CasePropertiesAction.class).setEnabled(true); - CallableSystemAction.get(CaseDeleteAction.class).setEnabled(true); // Delete Case menu + CallableSystemAction.get(AddImageAction.class).setEnabled(true); + CallableSystemAction.get(CaseCloseAction.class).setEnabled(true); + CallableSystemAction.get(CasePropertiesAction.class).setEnabled(true); + CallableSystemAction.get(CaseDeleteAction.class).setEnabled(true); // Delete Case menu if (toChangeTo.hasData()) { // open all top components diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index 5ea268adf4..f879393558 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -65,7 +65,7 @@ public final class CaseOpenAction implements ActionListener { } /** - * Pops up a file chooser to allow the user to select a case meta data file + * Pops up a file chooser to allow the user to select a case metadata file * (.aut file) and attempts to open the case described by the file. * * @param e The action event. @@ -73,21 +73,28 @@ public final class CaseOpenAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { /* - * If ingest is running, do a dialog to warn the user and confirm - * abandoning the ingest. + * If ingest is running, do a dialog to warn the user and confirm the + * intent to close the current case and leave the ingest process + * incomplete. */ if (IngestManager.getInstance().isIngestRunning()) { - String closeCurrentCase = NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"); - NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(closeCurrentCase, + NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation( + NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"), NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning.title"), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE); descriptor.setValue(NotifyDescriptor.NO_OPTION); Object res = DialogDisplayer.getDefault().notify(descriptor); if (res != null && res == DialogDescriptor.YES_OPTION) { + Case currentCase = null; try { - Case.getCurrentCase().closeCase(); - } catch (Exception ex) { - logger.log(Level.SEVERE, "Error closing case", ex); //NON-NLS + currentCase = Case.getCurrentCase(); + currentCase.closeCase(); + } catch (IllegalStateException ignored) { + /* + * No current case. + */ + } catch (CaseActionException ex) { + logger.log(Level.SEVERE, String.format("Error closing case at %s while ingest was running", (null != currentCase ? currentCase.getCaseDirectory() : "?")), ex); //NON-NLS } } else { return; @@ -100,17 +107,13 @@ public final class CaseOpenAction implements ActionListener { */ int retval = fileChooser.showOpenDialog(WindowManager.getDefault().getMainWindow()); if (retval == JFileChooser.APPROVE_OPTION) { - /** - * This is a bit of a hack, but close the startup window, if it was - * the source of the action invocation. + /* + * Close the startup window, if it is open. */ - try { - StartupWindowProvider.getInstance().close(); - } catch (Exception unused) { - } + StartupWindowProvider.getInstance().close(); - /** - * Try to open the case associated with the case meta data file the + /* + * Try to open the case associated with the case metadata file the * user selected. */ final String path = fileChooser.getSelectedFile().getPath(); @@ -121,12 +124,14 @@ public final class CaseOpenAction implements ActionListener { try { Case.open(path); } catch (CaseActionException ex) { - logger.log(Level.SEVERE, String.format("Could not open case at %s", path), ex); + logger.log(Level.SEVERE, String.format("Error opening case with metadata file path %s", path), ex); //NON-NLS SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), - ex.getMessage(), - NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); //NON-NLS + JOptionPane.showMessageDialog( + WindowManager.getDefault().getMainWindow(), + ex.getMessage(), // Should be user-friendly + NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), //NON-NLS + JOptionPane.ERROR_MESSAGE); if (!Case.isCaseOpen()) { StartupWindowProvider.getInstance().open(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 9b6c29a7c5..39f831c5a1 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -39,10 +39,11 @@ import javax.swing.JOptionPane; import org.sleuthkit.autopsy.casemodule.Case.CaseType; import org.openide.windows.WindowManager; import java.awt.Cursor; +import java.util.concurrent.ExecutionException; import org.sleuthkit.autopsy.ingest.IngestManager; /** - * An action that runs the new case wizard. + * An action that creates and runs the new case wizard. */ final class NewCaseWizardAction extends CallableSystemAction { @@ -53,32 +54,39 @@ final class NewCaseWizardAction extends CallableSystemAction { @Override public void performAction() { /* - * If ingest is running, do a dialog to warn the user and confirm - * abandoning the ingest. + * If ingest is running, do a dialog to warn the user and confirm the + * intent to close the current case and leave the ingest process + * incomplete. */ if (IngestManager.getInstance().isIngestRunning()) { - String closeCurrentCase = NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"); - NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(closeCurrentCase, + NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation( + NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"), NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning.title"), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE); descriptor.setValue(NotifyDescriptor.NO_OPTION); Object res = DialogDisplayer.getDefault().notify(descriptor); if (res != null && res == DialogDescriptor.YES_OPTION) { + Case currentCase = null; try { - Case.getCurrentCase().closeCase(); - } catch (Exception ex) { - Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case", ex); //NON-NLS + currentCase = Case.getCurrentCase(); + currentCase.closeCase(); + } catch (IllegalStateException ignored) { + /* + * No current case. + */ + } catch (CaseActionException ex) { + logger.log(Level.SEVERE, String.format("Error closing case at %s while ingest was running", (null != currentCase ? currentCase.getCaseDirectory() : "?")), ex); //NON-NLS } } else { return; } } WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - newCaseAction(); + runNewCaseWizard(); } - private void newCaseAction() { - final WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels()); + private void runNewCaseWizard() { + final WizardDescriptor wizardDescriptor = new WizardDescriptor(getNewCaseWizardPanels()); wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); wizardDescriptor.setTitle(NbBundle.getMessage(this.getClass(), "NewCaseWizardAction.newCase.windowTitle.text")); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); @@ -104,21 +112,14 @@ final class NewCaseWizardAction extends CallableSystemAction { AddImageAction addImageAction = SystemAction.get(AddImageAction.class); addImageAction.actionPerformed(null); } catch (Exception ex) { - logger.log(Level.SEVERE, "Error creating case", ex); //NON-NLS + logger.log(Level.SEVERE, String.format("Error creating case %s", wizardDescriptor.getProperty("caseName")), ex); //NON-NLS SwingUtilities.invokeLater(() -> { - JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getCause().getMessage() + " " - + NbBundle.getMessage(this.getClass(), "CaseExceptionWarning.CheckMultiUserOptions"), - NbBundle.getMessage(this.getClass(), "CaseCreateAction.msgDlg.cantCreateCase.msg"), - JOptionPane.ERROR_MESSAGE); //NON-NLS - /** - * This is a bit of a hack, but close the startup - * window, if it was the source of the action - * invocation. - */ - try { - StartupWindowProvider.getInstance().close(); - } catch (Exception unused) { - } + JOptionPane.showMessageDialog( + WindowManager.getDefault().getMainWindow(), + (ex instanceof ExecutionException ? ex.getCause().getMessage() : ex.getMessage()), + NbBundle.getMessage(this.getClass(), "CaseCreateAction.msgDlg.cantCreateCase.msg"), //NON-NLS + JOptionPane.ERROR_MESSAGE); + StartupWindowProvider.getInstance().close(); // RC: Why close and open? if (!Case.isCaseOpen()) { StartupWindowProvider.getInstance().open(); } @@ -137,7 +138,6 @@ final class NewCaseWizardAction extends CallableSystemAction { private void doFailedCaseCleanup(WizardDescriptor wizardDescriptor) { String createdDirectory = (String) wizardDescriptor.getProperty("createdDirectory"); //NON-NLS if (createdDirectory != null) { - logger.log(Level.INFO, "Deleting a created case directory due to an error, dir: {0}", createdDirectory); //NON-NLS Case.deleteCaseDirectory(new File(createdDirectory)); } SwingUtilities.invokeLater(() -> { @@ -146,10 +146,10 @@ final class NewCaseWizardAction extends CallableSystemAction { } /** - * Initializes the new case wizard panels. + * Creates the new case wizard panels. */ @SuppressWarnings({"unchecked", "rawtypes"}) - private WizardDescriptor.Panel[] getPanels() { + private WizardDescriptor.Panel[] getNewCaseWizardPanels() { if (panels == null) { panels = new WizardDescriptor.Panel[]{ new NewCaseWizardPanel1(), @@ -180,21 +180,33 @@ final class NewCaseWizardAction extends CallableSystemAction { return panels; } + /** + * @inheritDoc + */ @Override public String getName() { return NbBundle.getMessage(this.getClass(), "NewCaseWizardAction.getName.text"); } + /** + * @inheritDoc + */ @Override public String iconResource() { return null; } + /** + * @inheritDoc + */ @Override public HelpCtx getHelpCtx() { return HelpCtx.DEFAULT_HELP; } + /** + * @inheritDoc + */ @Override protected boolean asynchronous() { return false; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java index 6a0c0742eb..07706cc798 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java @@ -43,31 +43,39 @@ class OpenRecentCasePanel extends javax.swing.JPanel { private static String[] casePaths; private RecentCasesTableModel model; + /** + * Constructs a panel used by the the open recent case option of the start + * window. + */ private OpenRecentCasePanel() { initComponents(); } + /* + * Gets the singleton instance of the panel used by the the open recent case + * option of the start window. + */ static OpenRecentCasePanel getInstance() { if (instance == null) { instance = new OpenRecentCasePanel(); } - instance.generateRecentCases(); // refresh the case list + instance.refreshRecentCasesTable(); return instance; } /** - * Sets the Close button action listener. + * Adds an action listener to the cancel button. * - * @param e the action listener + * @param listener An action listener. */ - public void setCloseButtonActionListener(ActionListener e) { - this.cancelButton.addActionListener(e); + void setCloseButtonActionListener(ActionListener listener) { + this.cancelButton.addActionListener(listener); } - + /** * Retrieves all the recent cases and adds them to the table. */ - private void generateRecentCases() { + private void refreshRecentCasesTable() { caseNames = RecentCases.getInstance().getRecentCaseNames(); casePaths = RecentCases.getInstance().getRecentCasePaths(); model = new RecentCasesTableModel(); @@ -85,8 +93,10 @@ class OpenRecentCasePanel extends javax.swing.JPanel { openButton.setEnabled(false); } } - - // Open the selected case + + /* + * Opens the selected case. + */ private void openCase() { if (casePaths.length < 1) { return; @@ -102,7 +112,7 @@ class OpenRecentCasePanel extends javax.swing.JPanel { } /* - * Verify the case name and metadata file path. + * Open the case. */ if (caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())) { JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), @@ -110,14 +120,9 @@ class OpenRecentCasePanel extends javax.swing.JPanel { NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); RecentCases.getInstance().removeRecentCase(caseName, casePath); // remove the recent case if it doesn't exist anymore - - /* - * If a case was not already open, pop up the start window. - */ if (Case.isCaseOpen() == false) { StartupWindowProvider.getInstance().open(); } - } else { SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); @@ -131,12 +136,9 @@ class OpenRecentCasePanel extends javax.swing.JPanel { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); JOptionPane.showMessageDialog( WindowManager.getDefault().getMainWindow(), - ex.getMessage(), - NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); //NON-NLS - /* - * If a case was not already open, pop up the start - * window. - */ + ex.getMessage(), // Should be user-friendly + NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), //NON-NLS + JOptionPane.ERROR_MESSAGE); if (!Case.isCaseOpen()) { StartupWindowProvider.getInstance().open(); } @@ -154,6 +156,9 @@ class OpenRecentCasePanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; + /** + * @inheritDoc + */ @Override public int getRowCount() { int count = 0; @@ -165,11 +170,17 @@ class OpenRecentCasePanel extends javax.swing.JPanel { return count; } + /** + * @inheritDoc + */ @Override public int getColumnCount() { return 2; } + /** + * @inheritDoc + */ @Override public String getColumnName(int column) { String colName = null; @@ -186,6 +197,9 @@ class OpenRecentCasePanel extends javax.swing.JPanel { return colName; } + /** + * @inheritDoc + */ @Override public Object getValueAt(int rowIndex, int columnIndex) { Object ret = null; @@ -203,15 +217,28 @@ class OpenRecentCasePanel extends javax.swing.JPanel { return ret; } + /** + * @inheritDoc + */ @Override public boolean isCellEditable(int rowIndex, int columnIndex) { return false; } + /** + * @inheritDoc + */ @Override public void setValueAt(Object aValue, int rowIndex, int columnIndex) { } + /** + * Shortens a path to fit the display. + * + * @param path The path to shorten. + * + * @return The shortened path. + */ private String shortenPath(String path) { String shortenedPath = path; if (shortenedPath.length() > 50) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java index 8e9c989d5a..2df4401ad9 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2015 Basis Technology Corp. + * Copyright 2011-2016 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import javax.swing.JOptionPane; -import javax.swing.JPanel; import javax.swing.SwingUtilities; import org.openide.util.NbBundle; import org.openide.windows.WindowManager; @@ -36,21 +35,23 @@ import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.ingest.IngestManager; /** - * This class is used to add the action to the recent case menu item. When the - * the recent case menu is pressed, it should open that selected case. + * An action listener that opens a recent case. */ class RecentItems implements ActionListener { - final String caseName; - final String casePath; - private JPanel caller; // for error handling + private static final Logger logger = Logger.getLogger(RecentItems.class.getName()); + private final String caseName; + private final String caseMetaDataFilePath; /** - * the constructor + * Constructs an action listener that opens a recent case. + * + * @param caseName The name of the case. + * @param caseMetaDataFilePath The path to the case metadata file. */ - public RecentItems(String caseName, String casePath) { + public RecentItems(String caseName, String caseMetaDataFilePath) { this.caseName = caseName; - this.casePath = casePath; + this.caseMetaDataFilePath = caseMetaDataFilePath; } /** @@ -60,58 +61,65 @@ class RecentItems implements ActionListener { */ @Override public void actionPerformed(ActionEvent e) { - - // if ingest is ongoing, warn and get confirmaion before opening a different case + /* + * If ingest is running, do a dialog to warn the user and confirm the + * intent to close the current case and leave the ingest process + * incomplete. + */ if (IngestManager.getInstance().isIngestRunning()) { - // show the confirmation first to close the current case and open the "New Case" wizard panel - String closeCurrentCase = NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"); - NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(closeCurrentCase, + NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation( + NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"), NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning.title"), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE); descriptor.setValue(NotifyDescriptor.NO_OPTION); - Object res = DialogDisplayer.getDefault().notify(descriptor); if (res != null && res == DialogDescriptor.YES_OPTION) { + Case currentCase = null; try { - Case.getCurrentCase().closeCase(); // close the current case - } catch (Exception ex) { - Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS + currentCase = Case.getCurrentCase(); + currentCase.closeCase(); + } catch (IllegalStateException ignored) { + /* + * No current case. + */ + } catch (CaseActionException ex) { + logger.log(Level.SEVERE, String.format("Error closing case at %s while ingest was running", (null!= currentCase ? currentCase.getCaseDirectory() : "?")),ex); //NON-NLS } } else { return; } } - // check if the file exists - if (caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())) { - // throw an error here - JOptionPane.showMessageDialog(caller, - NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.text", - caseName), - NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.err"), + /* + * Open the case. + */ + if (caseName.equals("") || caseMetaDataFilePath.equals("") || (!new File(caseMetaDataFilePath).exists())) { + JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), + NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.text", caseName), + NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); - RecentCases.getInstance().removeRecentCase(caseName, casePath); // remove the recent case if it doesn't exist anymore - - //if case is not opened, open the start window + RecentCases.getInstance().removeRecentCase(caseName, caseMetaDataFilePath); if (Case.isCaseOpen() == false) { EventQueue.invokeLater(() -> { StartupWindowProvider.getInstance().open(); }); - } } else { SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); }); new Thread(() -> { - // Create case. try { - Case.open(casePath); + Case.open(caseMetaDataFilePath); } catch (CaseActionException ex) { SwingUtilities.invokeLater(() -> { + logger.log(Level.SEVERE, String.format("Error opening case with metadata file path %s", caseMetaDataFilePath), ex); //NON-NLS WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getMessage(), - NbBundle.getMessage(RecentItems.this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); //NON-NLS + JOptionPane.showMessageDialog( + WindowManager.getDefault().getMainWindow(), + ex.getMessage(), // Should be user-friendly + NbBundle.getMessage(RecentItems.this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), //NON-NLS + JOptionPane.ERROR_MESSAGE); if (!Case.isCaseOpen()) { StartupWindowProvider.getInstance().open(); } From d0683fa0ee4a8f6f65370f900cf592156ac2ff6f Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sat, 30 Jan 2016 15:01:26 -0500 Subject: [PATCH 34/48] Improve Core Installer error handling --- .../autopsy/corecomponents/Installer.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java index ce1fceda24..9121ad4d23 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java @@ -83,14 +83,14 @@ public class Installer extends ModuleInstall { try { Case.open(caseFile); } catch (Exception ex) { - logger.log(Level.SEVERE, "Error opening case", ex); //NON-NLS + logger.log(Level.SEVERE, String.format("Error opening case with metadata file path %s", caseFile), ex); //NON-NLS } }).start(); return; } } } - Case.invokeStartupDialog(); // bring up the startup dialog + Case.invokeStartupDialog(); }); } @@ -103,12 +103,19 @@ public class Installer extends ModuleInstall { @Override public void close() { new Thread(() -> { + String caseDirName = null; try { if (Case.isCaseOpen()) { - Case.getCurrentCase().closeCase(); + Case currentCase = Case.getCurrentCase(); + caseDirName = currentCase.getCaseDirectory(); + currentCase.closeCase(); } - } catch (CaseActionException | IllegalStateException ex) { - logger.log(Level.SEVERE, "Error closing case", ex); //NON-NLS + } catch (CaseActionException ex) { + logger.log(Level.SEVERE, String.format("Error closing case with case directory %s", (null != caseDirName ? caseDirName : "?")), ex); //NON-NLS + } catch (IllegalStateException ignored) { + /* + * No current case. Case.isCaseOpen is not reliable. + */ } }).start(); } @@ -128,7 +135,7 @@ public class Installer extends ModuleInstall { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { - logger.log(Level.WARNING, "Unable to set theme. ", ex); //NON-NLS + logger.log(Level.WARNING, "Error setting OS-X look-and-feel", ex); //NON-NLS } // Store the keys that deal with menu items @@ -138,20 +145,19 @@ public class Installer extends ModuleInstall { uiEntries.put(key, UIManager.get(key)); } - // Use Metal if available + // Use Metal if available. for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { //NON-NLS try { UIManager.setLookAndFeel(info.getClassName()); - } catch (ClassNotFoundException | InstantiationException | - IllegalAccessException | UnsupportedLookAndFeelException ex) { - logger.log(Level.WARNING, "Unable to set theme. ", ex); //NON-NLS + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { + logger.log(Level.WARNING, "Error setting OS-X look-and-feel", ex); //NON-NLS } break; } } - // Overwrite the Metal menu item keys to use the Aqua versions + // Overwrite the Metal menu item keys to use the Aqua versions. uiEntries.entrySet().stream().forEach((entry) -> { UIManager.put(entry.getKey(), entry.getValue()); }); From 5695b05871ff69630c9c52dc22e6efc3326388d2 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sat, 30 Jan 2016 15:02:16 -0500 Subject: [PATCH 35/48] Update source level to 1.8 for lagging NBMs --- CoreLibs/nbproject/project.properties | 2 +- KeywordSearch/nbproject/project.properties | 2 +- RecentActivity/nbproject/project.properties | 2 +- ScalpelCarver/nbproject/platform.properties | 1 + ScalpelCarver/nbproject/project.properties | 2 +- Testing/nbproject/project.properties | 2 +- thunderbirdparser/nbproject/project.properties | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CoreLibs/nbproject/project.properties b/CoreLibs/nbproject/project.properties index 6b1c4edae5..35f2e8e8c6 100644 --- a/CoreLibs/nbproject/project.properties +++ b/CoreLibs/nbproject/project.properties @@ -68,7 +68,7 @@ file.reference.slf4j-simple-1.6.1.jar=release/modules/ext/slf4j-simple-1.6.1.jar file.reference.stax-api-1.0.1.jar=release/modules/ext/stax-api-1.0.1.jar file.reference.xml-apis-1.0.b2.jar=release/modules/ext/xml-apis-1.0.b2.jar file.reference.xmlbeans-2.3.0.jar=release/modules/ext/xmlbeans-2.3.0.jar -javac.source=1.7 +javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial javadoc.reference.controlsfx-8.40.10.jar=release/modules/ext/controlsfx-8.40.10-javadoc.jar javadoc.reference.guava-18.0.jar=release/modules/ext/guava-18.0-javadoc.jar diff --git a/KeywordSearch/nbproject/project.properties b/KeywordSearch/nbproject/project.properties index 999c6bd7ac..cb50270b3e 100644 --- a/KeywordSearch/nbproject/project.properties +++ b/KeywordSearch/nbproject/project.properties @@ -1,4 +1,4 @@ -javac.source=1.7 +javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial license.file=../LICENSE-2.0.txt nbm.homepage=http://www.sleuthkit.org/autopsy/ diff --git a/RecentActivity/nbproject/project.properties b/RecentActivity/nbproject/project.properties index a31b0c2f01..bc09675c9d 100644 --- a/RecentActivity/nbproject/project.properties +++ b/RecentActivity/nbproject/project.properties @@ -1,5 +1,5 @@ file.reference.gson-2.1.jar=release/modules/ext/gson-2.1.jar -javac.source=1.7 +javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial license.file=../LICENSE-2.0.txt nbm.homepage=http://www.sleuthkit.org/autopsy/ diff --git a/ScalpelCarver/nbproject/platform.properties b/ScalpelCarver/nbproject/platform.properties index d19032bb98..6894d213d1 100755 --- a/ScalpelCarver/nbproject/platform.properties +++ b/ScalpelCarver/nbproject/platform.properties @@ -1,4 +1,5 @@ branding.token=autopsy +nbplatform.active=default # Version of platform that is automatically downloaded # Note build.xml has similar definitions that should be kept in sync (manually) netbeans-plat-version=7.3.1 diff --git a/ScalpelCarver/nbproject/project.properties b/ScalpelCarver/nbproject/project.properties index cafb7bf34e..815054aa0d 100644 --- a/ScalpelCarver/nbproject/project.properties +++ b/ScalpelCarver/nbproject/project.properties @@ -1,4 +1,4 @@ -javac.source=1.7 +javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial license.file=../LICENSE-2.0.txt nbm.homepage=http://www.sleuthkit.org/autopsy/ diff --git a/Testing/nbproject/project.properties b/Testing/nbproject/project.properties index 0735c621fa..7ec0a803eb 100644 --- a/Testing/nbproject/project.properties +++ b/Testing/nbproject/project.properties @@ -1,4 +1,4 @@ -javac.source=1.7 +javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial license.file=../LICENSE-2.0.txt nbm.homepage=http://www.sleuthkit.org/autopsy/ diff --git a/thunderbirdparser/nbproject/project.properties b/thunderbirdparser/nbproject/project.properties index 0fd53bef25..fbdabd0fc1 100644 --- a/thunderbirdparser/nbproject/project.properties +++ b/thunderbirdparser/nbproject/project.properties @@ -3,7 +3,7 @@ file.reference.apache-mime4j-core-0.8.0-SNAPSHOT.jar=release/modules/ext/apache- file.reference.apache-mime4j-mbox-iterator-0.8.0-SNAPSHOT-sources.jar=release/modules/ext/apache-mime4j-mbox-iterator-0.8.0-SNAPSHOT-sources.jar file.reference.apache-mime4j-mbox-iterator-0.8.0-SNAPSHOT.jar=release/modules/ext/apache-mime4j-mbox-iterator-0.8.0-SNAPSHOT.jar file.reference.java-libpst-1.0-SNAPSHOT.jar=release/modules/ext/java-libpst-1.0-SNAPSHOT.jar -javac.source=1.7 +javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial license.file=../LICENSE-2.0.txt nbm.homepage=http://www.sleuthkit.org/autopsy/ From ee516a45d5dbad4674833acf9a8a9c1386757f02 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Sat, 30 Jan 2016 16:48:14 -0500 Subject: [PATCH 36/48] Ran searches. Tagged strings. Moved hard coded strings into @NbBundle.Messages() annotations. --- .../autopsy/imagegallery/FXMLConstructor.java | 6 +- .../imagegallery/FileIDSelectionModel.java | 4 +- .../autopsy/imagegallery/FileTypeUtils.java | 50 ++-- .../imagegallery/ImageGalleryController.java | 100 ++++--- .../imagegallery/ImageGalleryModule.java | 5 +- .../ImageGalleryOptionsPanel.java | 7 +- .../imagegallery/ImageGalleryPreferences.java | 2 +- .../ImageGalleryTopComponent.java | 10 +- .../imagegallery/PerCaseProperties.java | 6 +- .../autopsy/imagegallery/ThumbnailCache.java | 12 +- .../actions/AddDrawableTagAction.java | 22 +- .../imagegallery/actions/AddTagAction.java | 14 +- .../autopsy/imagegallery/actions/Back.java | 6 +- .../actions/CategorizeAction.java | 22 +- .../actions/DeleteFollowUpTagAction.java | 6 +- .../autopsy/imagegallery/actions/Forward.java | 6 +- .../imagegallery/actions/NextUnseenGroup.java | 11 +- .../imagegallery/actions/OpenAction.java | 15 +- .../actions/OpenExternalViewerAction.java | 7 +- .../imagegallery/actions/OpenHelpAction.java | 4 +- .../imagegallery/actions/RedoAction.java | 6 +- .../imagegallery/actions/UndoAction.java | 6 +- .../imagegallery/datamodel/Category.java | 19 +- .../datamodel/CategoryManager.java | 14 +- .../datamodel/DrawableAttribute.java | 74 +++-- .../imagegallery/datamodel/DrawableDB.java | 254 +++++++++--------- .../imagegallery/datamodel/DrawableFile.java | 14 +- .../datamodel/DrawableTagsManager.java | 12 +- .../datamodel/HashSetManager.java | 2 +- .../imagegallery/datamodel/ImageFile.java | 2 +- .../imagegallery/datamodel/VideoFile.java | 8 +- .../datamodel/grouping/DrawableGroup.java | 6 +- .../datamodel/grouping/GroupKey.java | 2 +- .../datamodel/grouping/GroupManager.java | 44 +-- .../datamodel/grouping/GroupSortBy.java | 15 +- .../imagegallery/gui/NoGroupsDialog.java | 2 +- .../autopsy/imagegallery/gui/StatusBar.java | 13 +- .../imagegallery/gui/SummaryTablePane.java | 2 +- .../autopsy/imagegallery/gui/Toolbar.java | 4 +- .../autopsy/imagegallery/gui/VideoPlayer.java | 27 +- .../gui/drawableviews/DrawableTile.java | 4 +- .../gui/drawableviews/DrawableTileBase.java | 20 +- .../gui/drawableviews/DrawableUIBase.java | 4 +- .../gui/drawableviews/DrawableView.java | 2 +- .../gui/drawableviews/GroupPane.java | 22 +- .../gui/drawableviews/MetaDataPane.java | 6 +- .../gui/drawableviews/SlideShowView.java | 11 +- .../gui/navpanel/GroupComparators.java | 17 +- .../gui/navpanel/GroupListCell.java | 8 +- .../imagegallery/gui/navpanel/GroupTree.java | 9 +- .../gui/navpanel/GroupTreeCell.java | 8 +- .../gui/navpanel/HashHitGroupList.java | 8 +- 52 files changed, 547 insertions(+), 413 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java index 55d45ac5f5..ec846c1f36 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java @@ -39,7 +39,7 @@ public class FXMLConstructor { private static Logger logger = Logger.getLogger(FXMLConstructor.class.getName()); static public void construct(Object n, String fxmlFileName) { - final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; + final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; //NON-NLS try { FXMLLoader fxmlLoader = new FXMLLoader(new URL(name)); @@ -53,12 +53,12 @@ public class FXMLConstructor { fxmlLoader.setClassLoader(FXMLLoader.getDefaultClassLoader()); fxmlLoader.load(); } catch (IOException ex) { - String msg = String.format("Failed to load fxml file %s", fxmlFileName); + String msg = String.format("Failed to load fxml file %s", fxmlFileName); //NON-NLS logger.log(Level.SEVERE, msg, ex); } } } catch (MalformedURLException ex) { - String msg = String.format("Malformed URL %s", name); + String msg = String.format("Malformed URL %s", name); //NON-NLS logger.log(Level.SEVERE, msg, ex); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java index e2109389fd..812ace17e9 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java @@ -72,7 +72,7 @@ public class FileIDSelectionModel { try { fileNodes.add(new FileNode(controller.getSleuthKitCase().getAbstractFileById(id))); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); + LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); //NON-NLS } } FileNode[] fileNodeArray = fileNodes.stream().toArray(FileNode[]::new); @@ -84,7 +84,7 @@ public class FileIDSelectionModel { try { etc.getExplorerManager().setSelectedNodes(fileNodeArray); } catch (PropertyVetoException ex) { - LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); + LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); //NON-NLS } }); }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java index 4498021484..83dc067ac6 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java @@ -93,31 +93,31 @@ public enum FileTypeUtils { .collect(Collectors.toList())); //add list of known image extensions imageExtensions.addAll(Arrays.asList( - "bmp" //Bitmap - , "gif" //gif - , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants - , "pbm", "pgm", "ppm" // Portable image format variants - , "png" //portable network graphic - , "tga" //targa - , "psd" //photoshop - , "tif", "tiff" //tiff variants - , "yuv", "ico" //icons - , "ai" //illustrator - , "svg" //scalable vector graphics - , "sn", "ras" //sun raster - , "ico" //windows icons - , "tga" //targa + "bmp" //Bitmap NON-NLS + , "gif" //gif NON-NLS + , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants NON-NLS + , "pbm", "pgm", "ppm" // Portable image format variants NON-NLS + , "png" //portable network graphic NON-NLS + , "tga" //targa NON-NLS + , "psd" //photoshop NON-NLS + , "tif", "tiff" //tiff variants NON-NLS + , "yuv", "ico" //icons NON-NLS + , "ai" //illustrator NON-NLS + , "svg" //scalable vector graphics NON-NLS + , "sn", "ras" //sun raster NON-NLS + , "ico" //windows icons NON-NLS + , "tga" //targa NON-NLS )); //add list of known video extensions - videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", - "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", - "rm", "wmv", "mpv", "flv", "swf")); + videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", //NON-NLS + "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", //NON-NLS + "rm", "wmv", "mpv", "flv", "swf")); //NON-NLS supportedExtensions = Sets.union(imageExtensions, videoExtensions); //add list of mimetypes to count as videos even though they aren't prefixed by video/ - videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); + videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); //NON-NLS supportedMimeTypes.addAll(videoMimeTypes); @@ -128,14 +128,14 @@ public enum FileTypeUtils { * fixed, we should remove application/x-123 from the list of supported * mime types. */ - supportedMimeTypes.addAll(Arrays.asList("application/x-123")); + supportedMimeTypes.addAll(Arrays.asList("application/x-123")); //NON-NLS //add list of mimetypes ImageIO claims to support supportedMimeTypes.addAll(Stream.of(ImageIO.getReaderMIMETypes()) .map(String::toLowerCase) .collect(Collectors.toList())); - supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rarely usefull + supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rarely usefull NON-NLS } public static Set getAllSupportedMimeTypes() { @@ -151,7 +151,7 @@ public enum FileTypeUtils { try { FILE_TYPE_DETECTOR = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); + LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); //NON-NLS } } return FILE_TYPE_DETECTOR; @@ -196,8 +196,8 @@ public enum FileTypeUtils { return Optional.empty(); } else { mimeType = mimeType.toLowerCase(); - return Optional.of(mimeType.startsWith("image/") - || mimeType.startsWith("video/") + return Optional.of(mimeType.startsWith("image/") //NON-NLS + || mimeType.startsWith("video/") //NON-NLS || supportedMimeTypes.contains(mimeType)); } } @@ -221,11 +221,11 @@ public enum FileTypeUtils { String mimeType = fileTypeDetector.getFileType(file); if (nonNull(mimeType)) { mimeType = mimeType.toLowerCase(); - return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); + return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); //NON-NLS } } } catch (TskCoreException ex) { - LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); + LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); //NON-NLS } return FileTypeUtils.videoExtensions.contains(file.getNameExtension()); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index b749c9cdde..22dbf04457 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -58,6 +58,7 @@ import org.apache.commons.lang3.StringUtils; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Cancellable; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -289,38 +290,44 @@ public final class ImageGalleryController implements Executor { * aren't, add a blocking progress spinner with appropriate message. */ @ThreadConfined(type = ThreadConfined.ThreadType.JFX) + @NbBundle.Messages({"ImageGalleryController.noGroupsDlg.msg1=No groups are fully analyzed; but listening to ingest is disabled. " + + " No groups will be available until ingest is finished and listening is re-enabled.", + "ImageGalleryController.noGroupsDlg.msg2=No groups are fully analyzed yet, but ingest is still ongoing. Please Wait.", + "ImageGalleryController.noGroupsDlg.msg3=No groups are fully analyzed yet, but image / video data is still being populated. Please Wait.", + "ImageGalleryController.noGroupsDlg.msg4=There are no images/videos available from the added datasources; but listening to ingest is disabled. " + + " No groups will be available until ingest is finished and listening is re-enabled.", + "ImageGalleryController.noGroupsDlg.msg5=There are no images/videos in the added datasources.", + "ImageGalleryController.noGroupsDlg.msg6=There are no fully analyzed groups to display:" + + " the current Group By setting resulted in no groups, " + + "or no groups are fully analyzed but ingest is not running."}) public void checkForGroups() { if (groupManager.getAnalyzedGroups().isEmpty()) { if (IngestManager.getInstance().isIngestRunning()) { if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog("No groups are fully analyzed; but listening to ingest is disabled. " - + " No groups will be available until ingest is finished and listening is re-enabled.")); + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg1())); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog("No groups are fully analyzed yet, but ingest is still ongoing. Please Wait.", + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg2(), new ProgressIndicator())); } } else if (getFileUpdateQueueSizeProperty().get() > 0) { replaceNotification(fullUIStackPane, - new NoGroupsDialog("No groups are fully analyzed yet, but image / video data is still being populated. Please Wait.", + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg3(), new ProgressIndicator())); } else if (db != null && db.countAllFiles() <= 0) { // there are no files in db if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog("There are no images/videos available from the added datasources; but listening to ingest is disabled. " - + " No groups will be available until ingest is finished and listening is re-enabled.")); + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg4())); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog("There are no images/videos in the added datasources.")); + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg5())); } } else if (!groupManager.isRegrouping()) { replaceNotification(centralStackPane, - new NoGroupsDialog("There are no fully analyzed groups to display:" - + " the current Group By setting resulted in no groups, " - + "or no groups are fully analyzed but ingest is not running.")); + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg6())); } } else { @@ -399,7 +406,7 @@ public final class ImageGalleryController implements Executor { * reset the state of the controller (eg if the case is closed) */ public synchronized void reset() { - LOGGER.info("resetting ImageGalleryControler to initial state."); + LOGGER.info("resetting ImageGalleryControler to initial state."); //NON-NLS selectionModel.clearSelection(); setListeningEnabled(false); ThumbnailCache.getDefault().clearCache(); @@ -436,7 +443,7 @@ public final class ImageGalleryController implements Executor { @Nullable synchronized public DrawableFile getFileFromId(Long fileID) throws TskCoreException { if (Objects.isNull(db)) { - LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); + LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); //NON-NLS return null; } return db.getFileFromID(fileID); @@ -462,7 +469,7 @@ public final class ImageGalleryController implements Executor { */ void onStart() { Platform.setImplicitExit(false); - LOGGER.info("setting up ImageGallery listeners"); + LOGGER.info("setting up ImageGallery listeners"); //NON-NLS //TODO can we do anything usefull in an InjestJobEventListener? //IngestManager.getInstance().addIngestJobEventListener((PropertyChangeEvent evt) -> {}); IngestManager.getInstance().addIngestModuleEventListener(new IngestModuleEventListener()); @@ -546,7 +553,7 @@ public final class ImageGalleryController implements Executor { }); } catch (InterruptedException ex) { - LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); + LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); //NON-NLS } } } @@ -559,6 +566,8 @@ public final class ImageGalleryController implements Executor { /** * Abstract base class for task to be done on {@link DBWorkerThread} */ + @NbBundle.Messages({"ImageGalleryController.InnerTask.progress.name=progress", + "ImageGalleryController.InnerTask.progress.name=status"}) static public abstract class InnerTask implements Runnable, Cancellable { public double getProgress() { @@ -577,8 +586,8 @@ public final class ImageGalleryController implements Executor { this.message.set(Status); } SimpleObjectProperty state = new SimpleObjectProperty<>(Worker.State.READY); - SimpleDoubleProperty progress = new SimpleDoubleProperty(this, "pregress"); - SimpleStringProperty message = new SimpleStringProperty(this, "status"); + SimpleDoubleProperty progress = new SimpleDoubleProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); + SimpleStringProperty message = new SimpleStringProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); public SimpleDoubleProperty progressProperty() { return progress; @@ -659,7 +668,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); + Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); //NON-NLS } } } @@ -685,7 +694,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); + Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); //NON-NLS } } @@ -699,6 +708,11 @@ public final class ImageGalleryController implements Executor { * adds them to the Drawable DB. Uses the presence of a mimetype as an * approximation to 'analyzed'. */ + @NbBundle.Messages({"CopyAnalyzedFiles.populatingDb.status=populating analyzed image/video database", + "CopyAnalyzedFiles.committingDb.status=commiting image/video database", + "CopyAnalyzedFiles.stopCopy.status=Stopping copy to drawable db task.", + "CopyAnalyzedFiles.errPopulating.errMsg=There was an error populating Image Gallery database.", + ""}) static private class CopyAnalyzedFiles extends InnerTask { private final ImageGalleryController controller; @@ -712,28 +726,28 @@ public final class ImageGalleryController implements Executor { } static private final String FILE_EXTENSION_CLAUSE = - "(name LIKE '%." - + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "(name LIKE '%." //NON-NLS + + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") //NON-NLS + "')"; static private final String MIMETYPE_CLAUSE = - "(mime_type LIKE '" - + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), "' OR mime_type LIKE '") + "(mime_type LIKE '" //NON-NLS + + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), "' OR mime_type LIKE '") //NON-NLS + "') "; static private final String DRAWABLE_QUERY = //grab files with supported extension FILE_EXTENSION_CLAUSE //grab files with supported mime-types - + " OR " + MIMETYPE_CLAUSE + + " OR " + MIMETYPE_CLAUSE //NON-NLS //grab files with image or video mime-types even if we don't officially support them - + " OR mime_type LIKE 'video/%' OR mime_type LIKE 'image/%'"; - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("populating analyzed image/video database"); + + " OR mime_type LIKE 'video/%' OR mime_type LIKE 'image/%'"; //NON-NLS + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.CopyAnalyzedFiles_populatingDb_status()); @Override public void run() { progressHandle.start(); - updateMessage("populating analyzed image/video database"); + updateMessage(Bundle.CopyAnalyzedFiles_populatingDb_status()); try { //grab all files with supported extension or detected mime types @@ -747,7 +761,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "Task cancelled: not all contents may be transfered to drawable database."); + LOGGER.log(Level.WARNING, "Task cancelled: not all contents may be transfered to drawable database."); //NON-NLS progressHandle.finish(); break; } @@ -784,17 +798,17 @@ public final class ImageGalleryController implements Executor { progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); - updateMessage("commiting image/video database"); + progressHandle = ProgressHandleFactory.createHandle(Bundle.CopyAnalyzedFiles_committingDb_status()); + updateMessage(Bundle.CopyAnalyzedFiles_committingDb_status()); updateProgress(1.0); progressHandle.start(); taskDB.commitTransaction(tr, true); } catch (TskCoreException ex) { - progressHandle.progress("Stopping copy to drawable db task."); - Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); - MessageNotifyUtil.Notify.warn("There was an error populating Image Gallery database.", ex.getMessage()); + progressHandle.progress(Bundle.CopyAnalyzedFiles_stopCopy_status()); + Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); //NON-NLS + MessageNotifyUtil.Notify.warn(Bundle.CopyAnalyzedFiles_errPopulating_errMsg(), ex.getMessage()); progressHandle.finish(); updateMessage(""); updateProgress(-1.0); @@ -816,6 +830,8 @@ public final class ImageGalleryController implements Executor { * TODO: create methods to simplify progress value/text updates to both * netbeans and ImageGallery progress/status */ + @NbBundle.Messages({"PrePopulateDataSourceFiles.prepopulatingDb.status=prepopulating image/video database", + "PrePopulateDataSourceFiles.committingDb.status=commiting image/video database"}) private class PrePopulateDataSourceFiles extends InnerTask { private final Content dataSource; @@ -826,9 +842,9 @@ public final class ImageGalleryController implements Executor { * check for supported images */ // (name like '.jpg' or name like '.png' ...) - private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; + private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; //NON-NLS - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("prepopulating image/video database", this); + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.PrePopulateDataSourceFiles_prepopulatingDb_status(), this); /** * @@ -848,10 +864,10 @@ public final class ImageGalleryController implements Executor { @Override public void run() { progressHandle.start(); - updateMessage("prepopulating image/video database"); + updateMessage(Bundle.PrePopulateDataSourceFiles_prepopulatingDb_status()); try { - String fsQuery = "(fs_obj_id IS NULL) "; //default clause + String fsQuery = "(fs_obj_id IS NULL) "; //default clause NON-NLS /* * NOTE: Logical files currently (Apr '15) have a null value for * fs_obj_id in DB. for them, we will not specify a fs_obj_id, @@ -872,10 +888,10 @@ public final class ImageGalleryController implements Executor { //use this clause to only grab files from the newly added filesystems. fsQuery = fileSystems.stream() .map(fileSystem -> String.valueOf(fileSystem.getId())) - .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); + .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); //NON-NLS } - final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); + final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); //NON-NLS progressHandle.switchToDeterminate(files.size()); //do in transaction @@ -883,7 +899,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); + LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); //NON-NLS progressHandle.finish(); break; } @@ -893,13 +909,13 @@ public final class ImageGalleryController implements Executor { } progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); + progressHandle = ProgressHandleFactory.createHandle(Bundle.PrePopulateDataSourceFiles_committingDb_status()); progressHandle.start(); db.commitTransaction(tr, false); } catch (TskCoreException ex) { - Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); + Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); //NON-NLS } progressHandle.finish(); @@ -954,7 +970,7 @@ public final class ImageGalleryController implements Executor { } } catch (TskCoreException ex) { //TODO: What to do here? - LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); + LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); //NON-NLS throw new RuntimeException(ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java index 0a37825f54..770df56132 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java @@ -22,6 +22,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.apache.commons.lang3.StringUtils; import static org.apache.commons.lang3.StringUtils.isNotBlank; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableDB; @@ -30,11 +32,12 @@ import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; /** static definitions and utilities for the ImageGallery module */ +@NbBundle.Messages({"ImageGalleryModule.moduleName=Image Gallery"}) public class ImageGalleryModule { private static final Logger LOGGER = Logger.getLogger(ImageGalleryModule.class.getName()); - private static final String MODULE_NAME = "Image Gallery"; + private static final String MODULE_NAME = Bundle.ImageGalleryModule_moduleName(); static String getModuleName() { return MODULE_NAME; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java index be83d9e236..bb44a60ec1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.imagegallery; +import java.awt.*; import java.awt.event.ActionEvent; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; @@ -83,17 +84,17 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel { furtherDescriptionArea.setBackground(new java.awt.Color(240, 240, 240)); furtherDescriptionArea.setColumns(20); - furtherDescriptionArea.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N + furtherDescriptionArea.setFont(furtherDescriptionArea.getFont().deriveFont(Font.PLAIN, 11)); // NOI18N furtherDescriptionArea.setLineWrap(true); furtherDescriptionArea.setRows(5); furtherDescriptionArea.setText(NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.furtherDescriptionArea.text")); // NOI18N furtherDescriptionArea.setWrapStyleWord(true); furtherDescriptionArea.setPreferredSize(new java.awt.Dimension(378, 74)); - infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N + infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(infoIconLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.infoIconLabel.text")); // NOI18N - unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N + unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(unavailableDuringInjestLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.unavailableDuringInjestLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java index 5a89b5f257..51c0b5cb85 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java @@ -29,7 +29,7 @@ class ImageGalleryPreferences { private static final Preferences preferences = NbPreferences.forModule(ImageGalleryPreferences.class); /** key for the listening enabled for new cases setting */ - private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; + private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; //NON-NLS /** * Return setting of whether Image Analyzer should be automatically enabled diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java index d1e8f3a236..e927312ee3 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java @@ -68,7 +68,7 @@ import org.sleuthkit.autopsy.imagegallery.gui.navpanel.HashHitGroupList; }) public final class ImageGalleryTopComponent extends TopComponent implements ExplorerManager.Provider, Lookup.Provider { - public final static String PREFERRED_ID = "ImageGalleryTopComponent"; + public final static String PREFERRED_ID = "ImageGalleryTopComponent"; // NON-NLS private static final Logger LOGGER = Logger.getLogger(ImageGalleryTopComponent.class.getName()); private static boolean topComponentInitialized = false; @@ -81,11 +81,11 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl // } // } // timeLineController.openTimeLine(); - final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); + final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent(PREFERRED_ID); if (tc != null) { topComponentInitialized = true; WindowManager.getDefault().isTopComponentFloating(tc); - Mode mode = WindowManager.getDefault().findMode("timeline"); + Mode mode = WindowManager.getDefault().findMode("timeline"); // NON-NLS if (mode != null) { mode.dockInto(tc); } @@ -96,12 +96,12 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl public static void closeTopComponent() { if (topComponentInitialized) { - final TopComponent etc = WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); + final TopComponent etc = WindowManager.getDefault().findTopComponent(PREFERRED_ID); if (etc != null) { try { etc.close(); } catch (Exception e) { - LOGGER.log(Level.SEVERE, "failed to close ImageGalleryTopComponent", e); + LOGGER.log(Level.SEVERE, "failed to close " + PREFERRED_ID, e); // NON-NLS } } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java index 75a35fc798..89a40977f3 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java @@ -37,9 +37,9 @@ import org.sleuthkit.autopsy.coreutils.Logger; */ class PerCaseProperties { - public static final String ENABLED = "enabled"; + public static final String ENABLED = "enabled"; //NON-NLS - public static final String STALE = "stale"; + public static final String STALE = "stale"; //NON-NLS private final Case theCase; @@ -88,7 +88,7 @@ class PerCaseProperties { * @return true if the config exists, false otherwise. */ public synchronized boolean configExists(String moduleName) { - Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); + Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); //NON-NLS return Files.exists(get); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java index 67c4a10dfa..a0c962c775 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java @@ -101,7 +101,7 @@ public enum ThumbnailCache { try { return cache.get(file.getId(), () -> load(file)); } catch (UncheckedExecutionException | CacheLoader.InvalidCacheLoadException | ExecutionException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); //NON-NLS return null; } } @@ -111,7 +111,7 @@ public enum ThumbnailCache { try { return get(ImageGalleryController.getDefault().getFileFromId(fileID)); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); //NON-NLS return null; } } @@ -142,9 +142,9 @@ public enum ThumbnailCache { return cachedThumbnail; } } catch (MalformedURLException ex) { - LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); + LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); //NON-NLS } catch (IOException ex) { - LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); + LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); //NON-NLS } } return null; @@ -176,7 +176,7 @@ public enum ThumbnailCache { return Optional.of(ImageUtils.getCachedThumbnailFile(file.getAbstractFile(), MAX_THUMBNAIL_SIZE)); } catch (Exception e) { - LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); + LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); //NON-NLS return Optional.empty(); } } @@ -193,7 +193,7 @@ public enum ThumbnailCache { try { cache.put(Long.MIN_VALUE, newGetThumbnailTask.get()); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); + LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); //NON-NLS } } }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java index 28a377aade..92e9a979c2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java @@ -28,6 +28,8 @@ import javafx.application.Platform; import javafx.scene.control.Alert; import javafx.scene.control.Menu; import javax.swing.SwingWorker; + +import org.openide.util.NbBundle; import org.openide.util.Utilities; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -59,8 +61,12 @@ public class AddDrawableTagAction extends AddTagAction { } @Override + @NbBundle.Messages({"AddDrawableTagAction.displayName.plural=Tag Files", + "AddDrawableTagAction.displayName.singular=Tag File"}) protected String getActionDisplayName() { - return Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1 ? "Tag Files" : "Tag File"; + return Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1 + ? Bundle.AddDrawableTagAction_displayName_plural() + : Bundle.AddDrawableTagAction_displayName_singular(); } @Override @@ -70,6 +76,8 @@ public class AddDrawableTagAction extends AddTagAction { } @Override + @NbBundle.Messages({"# {0} - fileID", + "AddDrawableTagAction.addTagsToFiles.alert=Unable to tag file {0}."}) public void addTagsToFiles(TagName tagName, String comment, Set selectedFiles) { new SwingWorker() { @@ -78,7 +86,7 @@ public class AddDrawableTagAction extends AddTagAction { for (Long fileID : selectedFiles) { try { final DrawableFile file = controller.getFileFromId(fileID); - LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); + LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); //NON-NLS // check if the same tag is being added for the same abstract file. DrawableTagsManager tagsManager = controller.getTagsManager(); @@ -89,16 +97,16 @@ public class AddDrawableTagAction extends AddTagAction { .findAny(); if (duplicateTagName.isPresent()) { - LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); + LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS } else { - LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); + LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS controller.getTagsManager().addContentTag(file, tagName, comment); } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); + LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); //NON-NLS Platform.runLater(() -> { - new Alert(Alert.AlertType.ERROR, "Unable to tag file " + fileID + ".").show(); + new Alert(Alert.AlertType.ERROR, Bundle.AddDrawableTagAction_addTagsToFiles_alert(fileID)).show(); }); } } @@ -111,7 +119,7 @@ public class AddDrawableTagAction extends AddTagAction { try { get(); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); + LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); //NON-NLS } } }.execute(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java index 91c2af6503..7742ec583c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java @@ -25,6 +25,8 @@ import javafx.event.ActionEvent; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javax.swing.SwingUtilities; + +import org.openide.util.NbBundle; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.actions.GetTagNameAndCommentDialog; @@ -71,13 +73,17 @@ abstract class AddTagAction { */ // @@@ This user interface has some significant usability issues and needs // to be reworked. + @NbBundle.Messages({"AddTagAction.menuItem.quickTag=Quick Tag", + "AddTagAction.menuItem.noTags=No tags", + "AddTagAction.menuItem.newTag=New Tag...", + "AddTagAction.menuItem.tagAndComment=Tag and Comment..."}) protected class TagMenu extends Menu { TagMenu(ImageGalleryController controller) { super(getActionDisplayName()); // Create a "Quick Tag" sub-menu. - Menu quickTagMenu = new Menu("Quick Tag"); + Menu quickTagMenu = new Menu(Bundle.AddTagAction_menuItem_quickTag()); getItems().add(quickTagMenu); /* @@ -87,7 +93,7 @@ abstract class AddTagAction { */ Collection tagNames = controller.getTagsManager().getNonCategoryTagNames(); if (tagNames.isEmpty()) { - MenuItem empty = new MenuItem("No tags"); + MenuItem empty = new MenuItem(Bundle.AddTagAction_menuItem_noTags()); empty.setDisable(true); quickTagMenu.getItems().add(empty); } else { @@ -105,7 +111,7 @@ abstract class AddTagAction { * Selecting this item initiates a dialog that can be used to create * or select a tag name and adds a tag with the resulting name. */ - MenuItem newTagMenuItem = new MenuItem("New Tag..."); + MenuItem newTagMenuItem = new MenuItem(Bundle.AddTagAction_menuItem_newTag()); newTagMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TagName tagName = GetTagNameDialog.doDialog(getIGWindow()); @@ -122,7 +128,7 @@ abstract class AddTagAction { * name with an optional comment and adds a tag with the resulting * name. */ - MenuItem tagAndCommentItem = new MenuItem("Tag and Comment..."); + MenuItem tagAndCommentItem = new MenuItem(Bundle.AddTagAction_menuItem_tagAndComment()); tagAndCommentItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { GetTagNameAndCommentDialog.TagNameAndComment tagNameAndComment = GetTagNameAndCommentDialog.doDialog(getIGWindow()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java index 4488d94967..1b051e6fb2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java @@ -24,6 +24,7 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -32,12 +33,13 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm public class Back extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); //NON-NLS private final ImageGalleryController controller; + @NbBundle.Messages({"Back.diplayName=Back"}) public Back(ImageGalleryController controller) { - super("Back"); + super(Bundle.Back_displayName()); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.LEFT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java index 9d89b4fb1b..8c819373c8 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java @@ -35,6 +35,8 @@ import javafx.scene.input.KeyCodeCombination; import javax.annotation.Nonnull; import javax.annotation.concurrent.Immutable; import javax.swing.JOptionPane; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.Category; @@ -52,6 +54,7 @@ import org.sleuthkit.datamodel.TskCoreException; * TODO: since we are not using actionsGlobalContext anymore and this has * diverged from autopsy action, make this extend from controlsfx Action */ +@NbBundle.Messages({"CategorizeAction.displayName=Categorize"}) public class CategorizeAction extends AddTagAction { private static final Logger LOGGER = Logger.getLogger(CategorizeAction.class.getName()); @@ -71,7 +74,7 @@ public class CategorizeAction extends AddTagAction { @Override protected String getActionDisplayName() { - return "Categorize"; + return Bundle.CategorizeAction_displayName(); } @Override @@ -86,7 +89,7 @@ public class CategorizeAction extends AddTagAction { } public void addTagsToFiles(TagName tagName, String comment, Set selectedFiles, boolean createUndo) { - Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); + Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); //NON-NLS controller.queueDBWorkerTask(new CategorizeTask(selectedFiles, tagName, comment, createUndo)); } @@ -97,7 +100,7 @@ public class CategorizeAction extends AddTagAction { static private class CategoryMenu extends Menu { CategoryMenu(ImageGalleryController controller) { - super("Categorize"); + super(Bundle.CategorizeAction_displayName()); // Each category get an item in the sub-menu. Selecting one of these menu items adds // a tag with the associated category. @@ -114,6 +117,9 @@ public class CategorizeAction extends AddTagAction { } } + @NbBundle.Messages({"# {0} - fileID number", + "CategorizeTask.errorUnable.msg=Unable to categorize {0}.", + "CategorizeTask.errorUnable.title=Categorizing Error"}) private class CategorizeTask extends ImageGalleryController.InnerTask { private final Set fileIDs; @@ -132,6 +138,7 @@ public class CategorizeAction extends AddTagAction { } + @Override public void run() { final DrawableTagsManager tagsManager = controller.getTagsManager(); @@ -157,7 +164,7 @@ public class CategorizeAction extends AddTagAction { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); + LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); //NON-NLS } }); } else { @@ -170,8 +177,11 @@ public class CategorizeAction extends AddTagAction { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error categorizing result", ex); - JOptionPane.showMessageDialog(null, "Unable to categorize " + fileID + ".", "Categorizing Error", JOptionPane.ERROR_MESSAGE); + LOGGER.log(Level.SEVERE, "Error categorizing result", ex); //NON-NLS + JOptionPane.showMessageDialog(null, + Bundle.CategorizeTask_errorUnable_msg(fileID), + Bundle.CategorizeTask_errorUnable_title(), + JOptionPane.ERROR_MESSAGE); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java index 27ab1cd8b1..57f8afa2cf 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java @@ -23,6 +23,7 @@ import java.util.logging.Level; import javafx.event.ActionEvent; import javax.swing.SwingWorker; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; @@ -38,8 +39,9 @@ public class DeleteFollowUpTagAction extends Action { private static final Logger LOGGER = Logger.getLogger(DeleteFollowUpTagAction.class.getName()); + @NbBundle.Messages("DeleteFollwUpTagAction.displayName=Delete Follow Up Tag") public DeleteFollowUpTagAction(final ImageGalleryController controller, final DrawableFile file) { - super("Delete Follow Up Tag"); + super(Bundle.DeleteFollwUpTagAction_displayName()); setEventHandler((ActionEvent t) -> { new SwingWorker() { @@ -57,7 +59,7 @@ public class DeleteFollowUpTagAction extends Action { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); + LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); //NON-NLS } return null; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java index c94cfc5ffb..1688d6e6d2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java @@ -24,20 +24,22 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * */ //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm +@NbBundle.Messages({"Forward.displayName=Forward"}) public class Forward extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); //NON-NLS private final ImageGalleryController controller; public Forward(ImageGalleryController controller) { - super("Forward"); + super(Bundle.Forward_displayName()); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.RIGHT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java index 0d446cda84..a5e9215a6b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java @@ -26,6 +26,7 @@ import javafx.event.ActionEvent; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; @@ -34,15 +35,17 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; * Marks the currently fisplayed group as "seen" and advances to the next unseen * group */ +@NbBundle.Messages({"NextUnseenGroup.markGroupSeen=Mark Group Seen", + "NextUnseenGroup.nextUnseenGroup=Next Unseen group"}) public class NextUnseenGroup extends Action { private static final Image END = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); //NON-NLS private static final Image ADVANCE = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); //NON-NLS - private static final String MARK_GROUP_SEEN = "Mark Group Seen"; - private static final String NEXT_UNSEEN_GROUP = "Next Unseen group"; + private static final String MARK_GROUP_SEEN = Bundle.NextUnseenGroup_markGroupSeen(); + private static final String NEXT_UNSEEN_GROUP = Bundle.NextUnseenGroup_nextUnseenGroup(); private final ImageGalleryController controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java index b1f1f651b7..a758107da5 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java @@ -41,10 +41,14 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryTopComponent; @ActionRegistration( // iconBase = "org/sleuthkit/autopsy/imagegallery/images/lightbulb.png", lazy = false, displayName = "#CTL_OpenAction") -@Messages("CTL_OpenAction=View Images/Videos") +@Messages({"CTL_OpenAction=View Images/Videos", + "OpenAction.stale.confDlg.msg=The image / video database may be out of date. " + + "Do you want to update and listen for further ingest results?\n" + + "Choosing 'yes' will update the database and enable listening to future ingests.", + "OpenAction.stale.confDlg.title=Image Gallery"}) public final class OpenAction extends CallableSystemAction { - private static final String VIEW_IMAGES_VIDEOS = "View Images/Videos"; + private static final String VIEW_IMAGES_VIDEOS = Bundle.CTL_OpenAction(); private static final boolean fxInited = Installer.isJavaFxInited(); @@ -83,11 +87,8 @@ public final class OpenAction extends CallableSystemAction { if (ImageGalleryModule.isDrawableDBStale(currentCase)) { //drawable db is stale, ask what to do - int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), "The image / video database may be out of date. " + "Do you want to update and listen for further ingest results?\n" - + "Choosing 'yes' will update the database and enable listening to future ingests." - + " Choosing 'no' will display the out of date results." - + " Choosing 'cancel' will close the image /video gallery", - "Image Gallery", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), Bundle.OpenAction.stale.confDlg.msg(), + Bundle.OpenAction_stale_confDlg.title(), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); switch (answer) { case JOptionPane.YES_OPTION: diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java index ba33d077ba..20d6357241 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java @@ -32,14 +32,15 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; * Wraps {@link ExternalViewerAction} in a ControlsFX {@link Action} with * appropriate text and graphic */ -@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer"}) +@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer", + "OpenExternalViewerAction.displayName=External Viewer"}) public class OpenExternalViewerAction extends Action { - private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); + private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); //NON-NLS private static final ActionEvent ACTION_EVENT = new ActionEvent(OpenExternalViewerAction.class, ActionEvent.ACTION_PERFORMED, ""); //Swing ActionEvent //NOI18N public OpenExternalViewerAction(DrawableFile file) { - super("External Viewer"); + super(Bundle.OpenExternalViewerAction_displayName()); /** * TODO: why is the name passed to the action? it means we duplicate diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java index a75a786317..265412146f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java @@ -44,9 +44,9 @@ public final class OpenHelpAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { try { - Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); + Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); //NON-NLS } catch (IOException ex) { - Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); + Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); //NON-NLS } } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java index e3ce54cd7c..2e0f4d0d9d 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java @@ -23,17 +23,19 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * Action that redoes the last undone command */ +@NbBundle.Messages({"RedoAction.name=Redo"}) public class RedoAction extends Action { - private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); + private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); //NON-NLS public RedoAction(ImageGalleryController controller) { - super("Redo"); + super(Bundle.RedoAction_name()); setGraphic(new ImageView(REDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Y, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().redo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java index 0285c57bb7..1cc673808f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java @@ -23,17 +23,19 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * Action that undoes the last undoable command */ +@NbBundle.Messages({"UndoAction.displayName=Undo"}) public class UndoAction extends Action { - private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); + private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); //NON-NLS public UndoAction(ImageGalleryController controller) { - super("Undo"); + super(Bundle.UndoAction_displayName()); setGraphic(new ImageView(UNDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Z, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().undo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java index 1567a1b2b4..5717828fe7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java @@ -24,10 +24,17 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import javafx.scene.paint.Color; +import org.openide.util.NbBundle; /** * Enum to represent the six categories in the DHS image categorization scheme. */ +@NbBundle.Messages({"Category.one=CAT-1: Child Exploitation (Illegal)", + "Category.two=CAT-2: Child Exploitation (Non-Illegal/Age Difficult)", + "Category.three=CAT-3: CGI/Animation (Child Exploitive)", + "Category.four=CAT-4: Exemplar/Comparison (Internal Use Only)", + "Category.five=CAT-5: Non-pertinent", + "Category.zero=CAT-0: Uncategorized"}) public enum Category { /* @@ -35,12 +42,12 @@ public enum Category { * preserves the fact that lower category numbers are first/most sever, * except 0 which is last */ - ONE(Color.RED, 1, "CAT-1: Child Exploitation (Illegal)"), - TWO(Color.ORANGE, 2, "CAT-2: Child Exploitation (Non-Illegal/Age Difficult)"), - THREE(Color.YELLOW, 3, "CAT-3: CGI/Animation (Child Exploitive)"), - FOUR(Color.BISQUE, 4, "CAT-4: Exemplar/Comparison (Internal Use Only)"), - FIVE(Color.GREEN, 5, "CAT-5: Non-pertinent"), - ZERO(Color.LIGHTGREY, 0, "CAT-0: Uncategorized"); + ONE(Color.RED, 1, Bundle.Category_one()), + TWO(Color.ORANGE, 2, Bundle.Category_two()), + THREE(Color.YELLOW, 3, Bundle.Category_three()), + FOUR(Color.BISQUE, 4, Bundle.Category_four()), + FIVE(Color.GREEN, 5, Bundle.Category_five()), + ZERO(Color.LIGHTGREY, 0, Bundle.Category_zero()); public static ImmutableList getNonZeroCategories() { return nonZeroCategories; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java index d2018d422c..464c2492b0 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java @@ -68,8 +68,8 @@ public class CategoryManager { * Used to distribute {@link CategoryChangeEvent}s */ private final EventBus categoryEventBus = new AsyncEventBus(Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { - LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); + new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS + LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); //NON-NLS }).build() )); @@ -176,7 +176,7 @@ public class CategoryManager { longAdder.add(db.getCategoryCount(cat)); longAdder.increment(); } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); + LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS } return longAdder; } @@ -210,8 +210,8 @@ public class CategoryManager { try { categoryEventBus.unregister(listener); } catch (IllegalArgumentException e) { - if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { - LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); + if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { //NON-NLS + LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); //NON-NLS } else { throw e; } @@ -254,12 +254,12 @@ public class CategoryManager { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); + LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); //NON-NLS } } } } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); + LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); //NON-NLS } Category newCat = CategoryManager.categoryFromTagName(addedTag.getName()); if (newCat != Category.ZERO) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java index eb3a7ed64d..8222c1effe 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java @@ -27,6 +27,7 @@ import javafx.beans.property.ReadOnlyStringWrapper; import javafx.beans.property.StringProperty; import javafx.scene.image.Image; import org.apache.commons.lang3.StringUtils; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.datamodel.ContentUtils; import org.sleuthkit.datamodel.TagName; @@ -37,22 +38,37 @@ import org.sleuthkit.datamodel.TagName; * TODO: Review and refactor DrawableAttribute related code with an eye to usage * of type paramaters and multivalued attributes */ +@NbBundle.Messages({"DrawableAttribute.md5hash=MD5 Hash", + "DrawableAttribute.name=Name", + "DrawableAttribute.analyzed=Analyzed", + "DrawableAttribute.category=Category", + "DrawableAttribute.tags=Tags", + "DrawableAttribute.path=Path", + "DrawableAttribute.createdTime=Created Time", + "DrawableAttribute.modifiedTime=Modified Time", + "DrawableAttribute.cameraMake=Camera Make", + "DrawableAttribute.cameraModel=Camera Model", + "DrawableAttribute.hashSet=Hashset", + "DrawableAttribute.intObjID=Internal Object ID", + "DrawableAttribute.width=Width", + "DrawableAttribute.height=Height", + "DrawableAttribute.mimeType=MIME type"}) public class DrawableAttribute> { public final static DrawableAttribute MD5_HASH = - new DrawableAttribute<>(AttributeName.MD5_HASH, "MD5 Hash", + new DrawableAttribute<>(AttributeName.MD5_HASH, Bundle.DrawableAttribute_md5hash(), false, - "icon-hashtag.png", + "icon-hashtag.png", // NON-NLS f -> Collections.singleton(f.getMd5Hash())); public final static DrawableAttribute NAME = - new DrawableAttribute<>(AttributeName.NAME, "Name", + new DrawableAttribute<>(AttributeName.NAME, Bundle.DrawableAttribute_name(), true, - "folder-rename.png", + "folder-rename.png", //NON-NLS f -> Collections.singleton(f.getName())); public final static DrawableAttribute ANALYZED = - new DrawableAttribute<>(AttributeName.ANALYZED, "Analyzed", + new DrawableAttribute<>(AttributeName.ANALYZED, Bundle.DrawableAttribute_analyzed(), true, "", f -> Collections.singleton(f.isAnalyzed())); @@ -66,75 +82,75 @@ public class DrawableAttribute> { * advantage. move categories into DrawableDB? */ public final static DrawableAttribute CATEGORY = - new DrawableAttribute<>(AttributeName.CATEGORY, "Category", + new DrawableAttribute<>(AttributeName.CATEGORY, Bundle.DrawableAttribute_category(), false, - "category-icon.png", + "category-icon.png", //NON-NLS f -> Collections.singleton(f.getCategory())); public final static DrawableAttribute TAGS = - new DrawableAttribute<>(AttributeName.TAGS, "Tags", + new DrawableAttribute<>(AttributeName.TAGS, Bundle.DrawableAttribute_tags(), false, - "tag_red.png", + "tag_red.png", //NON-NLS DrawableFile::getTagNames); public final static DrawableAttribute PATH = - new DrawableAttribute<>(AttributeName.PATH, "Path", + new DrawableAttribute<>(AttributeName.PATH, Bundle.DrawableAttribute_path(), true, - "folder_picture.png", + "folder_picture.png", //NON-NLS f -> Collections.singleton(f.getDrawablePath())); public final static DrawableAttribute CREATED_TIME = - new DrawableAttribute<>(AttributeName.CREATED_TIME, "Created Time", + new DrawableAttribute<>(AttributeName.CREATED_TIME, Bundle.DrawableAttribute_createdTime(), true, - "clock--plus.png", + "clock--plus.png", //NON-NLS f -> Collections.singleton(ContentUtils.getStringTime(f.getCrtime(), f))); public final static DrawableAttribute MODIFIED_TIME = - new DrawableAttribute<>(AttributeName.MODIFIED_TIME, "Modified Time", + new DrawableAttribute<>(AttributeName.MODIFIED_TIME, Bundle.DrawableAttribute_modifiedTime(), true, - "clock--pencil.png", + "clock--pencil.png", //NON-NLS f -> Collections.singleton(ContentUtils.getStringTime(f.getMtime(), f))); public final static DrawableAttribute MAKE = - new DrawableAttribute<>(AttributeName.MAKE, "Camera Make", + new DrawableAttribute<>(AttributeName.MAKE, Bundle.DrawableAttribute_cameraMake(), true, - "camera.png", + "camera.png", //NON-NLS f -> Collections.singleton(f.getMake())); public final static DrawableAttribute MODEL = - new DrawableAttribute<>(AttributeName.MODEL, "Camera Model", + new DrawableAttribute<>(AttributeName.MODEL, Bundle.DrawableAttribute_cameraModel(), true, - "camera.png", + "camera.png", //NON-NLS f -> Collections.singleton(f.getModel())); public final static DrawableAttribute HASHSET = - new DrawableAttribute<>(AttributeName.HASHSET, "Hashset", + new DrawableAttribute<>(AttributeName.HASHSET, Bundle.DrawableAttribute_hashSet(), true, - "hashset_hits.png", + "hashset_hits.png", //NON-NLS DrawableFile::getHashSetNamesUnchecked); public final static DrawableAttribute OBJ_ID = - new DrawableAttribute<>(AttributeName.OBJ_ID, "Internal Object ID", + new DrawableAttribute<>(AttributeName.OBJ_ID, Bundle.DrawableAttribute_intObjID(), true, "", f -> Collections.singleton(f.getId())); public final static DrawableAttribute WIDTH = - new DrawableAttribute<>(AttributeName.WIDTH, "Width", + new DrawableAttribute<>(AttributeName.WIDTH, Bundle.DrawableAttribute_width(), false, - "arrow-resize.png", + "arrow-resize.png", //NON-NLS f -> Collections.singleton(f.getWidth())); public final static DrawableAttribute HEIGHT = - new DrawableAttribute<>(AttributeName.HEIGHT, "Height", + new DrawableAttribute<>(AttributeName.HEIGHT, Bundle.DrawableAttribute_height(), false, - "arrow-resize-090.png", + "arrow-resize-090.png", //NON-NLS f -> Collections.singleton(f.getHeight())); public final static DrawableAttribute MIME_TYPE = - new DrawableAttribute<>(AttributeName.MIME_TYPE, "MIME type", + new DrawableAttribute<>(AttributeName.MIME_TYPE, Bundle.DrawableAttribute_mimeType(), false, - "mime_types.png", + "mime_types.png", //NON-NLS f -> Collections.singleton(f.getMIMEType())); final private static List< DrawableAttribute> groupables = @@ -170,7 +186,7 @@ public class DrawableAttribute> { * time they are needed */ if (null == icon && StringUtils.isNotBlank(imageName)) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS } return icon; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java index 61ef672bc2..079be33ff4 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java @@ -77,11 +77,11 @@ public final class DrawableDB { private static final org.sleuthkit.autopsy.coreutils.Logger LOGGER = Logger.getLogger(DrawableDB.class.getName()); //column name constants////////////////////// - private static final String ANALYZED = "analyzed"; + private static final String ANALYZED = "analyzed"; //NON-NLS - private static final String OBJ_ID = "obj_id"; + private static final String OBJ_ID = "obj_id"; //NON-NLS - private static final String HASH_SET_NAME = "hash_set_name"; + private static final String HASH_SET_NAME = "hash_set_name"; //NON-NLS private final PreparedStatement insertHashSetStmt; @@ -140,7 +140,7 @@ public final class DrawableDB { try { Class.forName("org.sqlite.JDBC"); } catch (ClassNotFoundException ex) { - LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); + LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); //NON-NLS } } private final SleuthkitCase tskCase; @@ -201,33 +201,33 @@ public final class DrawableDB { Files.createDirectories(dbPath.getParent()); if (initializeDBSchema()) { updateFileStmt = prepareStatement( - "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " - + "VALUES (?,?,?,?,?,?,?,?)"); + "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS + + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS insertFileStmt = prepareStatement( - "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " - + "VALUES (?,?,?,?,?,?,?,?)"); + "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS + + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS - removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); + removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); //NON-NLS - pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); - nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); - created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); - modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); - makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); - modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); - analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); - hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); + pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); //NON-NLS + nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); //NON-NLS + created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); //NON-NLS + modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); //NON-NLS + makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); //NON-NLS + modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); //NON-NLS + analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); //NON-NLS + hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); //NON-NLS - updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); - insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); + updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); //NON-NLS + insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); //NON-NLS - groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); + groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); //NON-NLS - selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); - insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); - selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); + selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); //NON-NLS + insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); //NON-NLS + selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); //NON-NLS - insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); + insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); //NON-NLS for (Category cat : Category.values()) { insertGroup(cat.getDisplayName(), DrawableAttribute.CATEGORY); @@ -289,12 +289,12 @@ public final class DrawableDB { public static DrawableDB getDrawableDB(Path dbPath, ImageGalleryController controller) { try { - return new DrawableDB(dbPath.resolve("drawable.db"), controller); + return new DrawableDB(dbPath.resolve("drawable.db"), controller); //NON-NLS } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); + LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); //NON-NLS return null; } catch (ExceptionInInitializerError | IOException ex) { - LOGGER.log(Level.SEVERE, "error creating database connection", ex); + LOGGER.log(Level.SEVERE, "error creating database connection", ex); //NON-NLS return null; } } @@ -304,33 +304,33 @@ public final class DrawableDB { //this should match Sleuthkit db setupt try (Statement statement = con.createStatement()) { //reduce i/o operations, we have no OS crash recovery anyway - statement.execute("PRAGMA synchronous = OFF;"); + statement.execute("PRAGMA synchronous = OFF;"); //NON-NLS //allow to query while in transaction - no need read locks - statement.execute("PRAGMA read_uncommitted = True;"); + statement.execute("PRAGMA read_uncommitted = True;"); //NON-NLS //TODO: do we need this? - statement.execute("PRAGMA foreign_keys = ON"); + statement.execute("PRAGMA foreign_keys = ON"); //NON-NLS //TODO: test this - statement.execute("PRAGMA journal_mode = MEMORY"); + statement.execute("PRAGMA journal_mode = MEMORY"); //NON-NLS // //we don't use this feature, so turn it off for minimal speed up on queries //this is deprecated and not recomended - statement.execute("PRAGMA count_changes = OFF;"); + statement.execute("PRAGMA count_changes = OFF;"); //NON-NLS //this made a big difference to query speed - statement.execute("PRAGMA temp_store = MEMORY"); + statement.execute("PRAGMA temp_store = MEMORY"); //NON-NLS //this made a modest improvement in query speeds - statement.execute("PRAGMA cache_size = 50000"); + statement.execute("PRAGMA cache_size = 50000"); //NON-NLS //we never delete anything so... - statement.execute("PRAGMA auto_vacuum = 0"); + statement.execute("PRAGMA auto_vacuum = 0"); //NON-NLS } try { - LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", + LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", //NON-NLS SQLiteJDBCLoader.getVersion(), SQLiteJDBCLoader.isNativeMode() - ? "native" : "pure-java")); + ? "native" : "pure-java")); //NON-NLS } catch (Exception exception) { - LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); + LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); //NON-NLS } } @@ -349,92 +349,92 @@ public final class DrawableDB { setPragmas(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem accessing database", ex); + LOGGER.log(Level.SEVERE, "problem accessing database", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists drawable_files " - + "( obj_id INTEGER PRIMARY KEY, " - + " path VARCHAR(255), " - + " name VARCHAR(255), " - + " created_time integer, " - + " modified_time integer, " - + " make VARCHAR(255), " - + " model VARCHAR(255), " - + " analyzed integer DEFAULT 0)"; + String sql = "CREATE TABLE if not exists drawable_files " //NON-NLS + + "( obj_id INTEGER PRIMARY KEY, " //NON-NLS + + " path VARCHAR(255), " //NON-NLS + + " name VARCHAR(255), " //NON-NLS + + " created_time integer, " //NON-NLS + + " modified_time integer, " //NON-NLS + + " make VARCHAR(255), " //NON-NLS + + " model VARCHAR(255), " //NON-NLS + + " analyzed integer DEFAULT 0)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); + LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists groups " - + "(group_id INTEGER PRIMARY KEY, " - + " value VARCHAR(255) not null, " - + " attribute VARCHAR(255) not null, " - + " seen integer DEFAULT 0, " - + " UNIQUE(value, attribute) )"; + String sql = "CREATE TABLE if not exists groups " //NON-NLS + + "(group_id INTEGER PRIMARY KEY, " //NON-NLS + + " value VARCHAR(255) not null, " //NON-NLS + + " attribute VARCHAR(255) not null, " //NON-NLS + + " seen integer DEFAULT 0, " //NON-NLS + + " UNIQUE(value, attribute) )"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating groups table", ex); + LOGGER.log(Level.SEVERE, "problem creating groups table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_sets " - + "( hash_set_id INTEGER primary key," - + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; + String sql = "CREATE TABLE if not exists hash_sets " //NON-NLS + + "( hash_set_id INTEGER primary key," //NON-NLS + + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); + LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_set_hits " - + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " - + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " - + " PRIMARY KEY (hash_set_id, obj_id))"; + String sql = "CREATE TABLE if not exists hash_set_hits " //NON-NLS + + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " //NON-NLS + + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " //NON-NLS + + " PRIMARY KEY (hash_set_id, obj_id))"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); + LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; + String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating path_idx", ex); + LOGGER.log(Level.WARNING, "problem creating path_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; + String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating name_idx", ex); + LOGGER.log(Level.WARNING, "problem creating name_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; + String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating make_idx", ex); + LOGGER.log(Level.WARNING, "problem creating make_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; + String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating model_idx", ex); + LOGGER.log(Level.WARNING, "problem creating model_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; + String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); + LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); //NON-NLS } return true; @@ -455,7 +455,7 @@ public final class DrawableDB { closeStatements(); con.close(); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); + LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); //NON-NLS } } con = null; @@ -464,10 +464,10 @@ public final class DrawableDB { public void openDBCon() { try { if (con == null || con.isClosed()) { - con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); + con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); //NON-NLS } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); + LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); //NON-NLS } } @@ -518,7 +518,7 @@ public final class DrawableDB { names.add(rs.getString(HASH_SET_NAME)); } } catch (SQLException sQLException) { - LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); + LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); //NON-NLS } finally { dbReadUnlock(); } @@ -533,11 +533,11 @@ public final class DrawableDB { groupSeenQueryStmt.setString(2, groupKey.getAttribute().attrName.toString()); try (ResultSet rs = groupSeenQueryStmt.executeQuery()) { while (rs.next()) { - return rs.getBoolean("seen"); + return rs.getBoolean("seen"); //NON-NLS } } } catch (SQLException ex) { - String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); + String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); //NON-NLS LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -555,7 +555,7 @@ public final class DrawableDB { updateGroupStmt.setString(3, gk.getAttribute().attrName.toString()); updateGroupStmt.execute(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); + LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); //NON-NLS } finally { dbWriteUnlock(); } @@ -623,7 +623,7 @@ public final class DrawableDB { selectHashSetStmt.setString(1, name); try (ResultSet rs = selectHashSetStmt.executeQuery()) { while (rs.next()) { - int hashsetID = rs.getInt("hash_set_id"); + int hashsetID = rs.getInt("hash_set_id"); //NON-NLS //"insert or ignore into hash_set_hits (hash_set_id, obj_id) values (?,?)"; insertHashHitStmt.setInt(1, hashsetID); insertHashHitStmt.setLong(2, f.getId()); @@ -633,7 +633,7 @@ public final class DrawableDB { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); + LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); //NON-NLS } //and update all groups this file is in @@ -650,7 +650,7 @@ public final class DrawableDB { // This is one of the places where we get an error if the case is closed during processing, // which doesn't need to be reported here. if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); + LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); //NON-NLS } } finally { @@ -676,12 +676,12 @@ public final class DrawableDB { public Boolean isFileAnalyzed(long fileId) { dbReadLock(); try (Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { //NON-NLS while (analyzedQuery.next()) { return analyzedQuery.getBoolean(ANALYZED); } } catch (SQLException ex) { - String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); + String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); //NON-NLS LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -695,12 +695,12 @@ public final class DrawableDB { dbReadLock(); try (Statement stmt = con.createStatement(); //Can't make this a preprared statement because of the IN ( ... ) - ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { + ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { //NON-NLS while (analyzedQuery.next()) { return analyzedQuery.getInt(ANALYZED) == fileIds.size(); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS } finally { dbReadUnlock(); } @@ -717,7 +717,7 @@ public final class DrawableDB { // In testing, this method appears to be a lot faster than doing one large select statement for (Long fileID : fileIDsInGroup) { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); //NON-NLS while (analyzedQuery.next()) { if (analyzedQuery.getInt(ANALYZED) == 0) { return false; @@ -727,10 +727,10 @@ public final class DrawableDB { } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); //NON-NLS } finally { dbReadUnlock(); } @@ -756,7 +756,7 @@ public final class DrawableDB { dbReadLock(); try { statement = con.createStatement(); - rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); + rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); //NON-NLS while (rs.next()) { ret.add(rs.getLong(1)); } @@ -767,14 +767,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); //NON-NLS } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); //NON-NLS } } dbReadUnlock(); @@ -808,14 +808,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); //NON-NLS } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); //NON-NLS } } dbReadUnlock(); @@ -845,14 +845,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); //NON-NLS } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); //NON-NLS } } dbReadUnlock(); @@ -883,15 +883,15 @@ public final class DrawableDB { default: dbReadLock(); //TODO: convert this to prepared statement - StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); + StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); //NON-NLS String orderByClause = ""; switch (sortBy) { case GROUP_BY_VALUE: - orderByClause = " ORDER BY " + groupBy.attrName.toString(); + orderByClause = " ORDER BY " + groupBy.attrName.toString(); //NON-NLS break; case FILE_COUNT: - orderByClause = " ORDER BY COUNT(*)"; + orderByClause = " ORDER BY COUNT(*)"; //NON-NLS break; case NONE: // case PRIORITY: @@ -905,10 +905,10 @@ public final class DrawableDB { switch (sortOrder) { case DESCENDING: - sortOrderClause = " DESC"; + sortOrderClause = " DESC"; //NON-NLS break; case ASCENDING: - sortOrderClause = " ASC"; + sortOrderClause = " ASC"; //NON-NLS break; default: orderByClause = ""; @@ -930,7 +930,7 @@ public final class DrawableDB { vals.add(value); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); + LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); //NON-NLS } finally { dbReadUnlock(); } @@ -951,7 +951,7 @@ public final class DrawableDB { } catch (SQLException sQLException) { // Don't need to report it if the case was closed if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); + LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); //NON-NLS } } finally { dbWriteUnlock(); @@ -972,7 +972,7 @@ public final class DrawableDB { AbstractFile f = tskCase.getAbstractFileById(id); return DrawableFile.create(f, analyzed, isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); //NON-NLS return null; } } @@ -991,7 +991,7 @@ public final class DrawableDB { return DrawableFile.create(f, areFilesAnalyzed(Collections.singleton(id)), isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); //NON-NLS return null; } } @@ -1020,7 +1020,7 @@ public final class DrawableDB { } } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); + LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); //NON-NLS } finally { dbReadUnlock(); } @@ -1042,14 +1042,14 @@ public final class DrawableDB { public int countAllFiles() { int result = -1; dbReadLock(); - try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { + try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { //NON-NLS while (rs.next()) { result = rs.getInt("COUNT"); break; } } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); + LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); //NON-NLS } finally { dbReadUnlock(); } @@ -1081,7 +1081,7 @@ public final class DrawableDB { //TODO: delete from hash_set_hits table also... } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); + LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); //NON-NLS } finally { dbWriteUnlock(); } @@ -1093,7 +1093,7 @@ public final class DrawableDB { public class MultipleTransactionException extends IllegalStateException { - private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; + private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; //NON-NLS public MultipleTransactionException() { super(CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO); @@ -1137,12 +1137,12 @@ public final class DrawableDB { dbReadLock(); try { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); + ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); //NON-NLS while (analyzedQuery.next()) { addImageFileToList(analyzedQuery.getLong(OBJ_ID)); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); + LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); //NON-NLS } finally { dbReadUnlock(); } @@ -1194,9 +1194,9 @@ public final class DrawableDB { .count(); } } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); + LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS } catch (TskCoreException ex1) { - LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); + LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); //NON-NLS } return -1; @@ -1231,15 +1231,15 @@ public final class DrawableDB { //count the fileids that are in the given list and don't have a non-zero category assigned to them. String name = - "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList - + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; + "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList //NON-NLS + + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; //NON-NLS try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(name); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - return resultSet.getLong("count(obj_id)"); + return resultSet.getLong("count(obj_id)"); //NON-NLS } } catch (SQLException | TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error getting category count.", ex); + LOGGER.log(Level.SEVERE, "Error getting category count.", ex); //NON-NLS } return -1; @@ -1274,7 +1274,7 @@ public final class DrawableDB { con.setAutoCommit(false); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); + LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); //NON-NLS } } @@ -1285,7 +1285,7 @@ public final class DrawableDB { con.rollback(); updatedFiles.clear(); } catch (SQLException ex1) { - LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); + LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); //NON-NLS } finally { close(); } @@ -1307,9 +1307,9 @@ public final class DrawableDB { } } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); + LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); //NON-NLS } else { - LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); + LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); //NON-NLS } rollback(); } @@ -1322,9 +1322,9 @@ public final class DrawableDB { con.setAutoCommit(true); } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); //NON-NLS } else { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); //NON-NLS } } finally { closed = true; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java index 14fbf4265c..979429b880 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java @@ -186,9 +186,9 @@ public abstract class DrawableFile extends AbstractFile .map(Tag::getName) .collect(Collectors.toSet()); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); //NON-NLS } catch (IllegalStateException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); + Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); //NON-NLS } return Collections.emptySet(); } @@ -223,7 +223,7 @@ public abstract class DrawableFile extends AbstractFile } } } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); //NON-NLS } return ""; } @@ -255,7 +255,7 @@ public abstract class DrawableFile extends AbstractFile .orElse(Category.ZERO) ); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); + LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); //NON-NLS } catch (IllegalStateException ex) { // We get here many times if the case is closed during ingest, so don't print out a ton of warnings. } @@ -333,7 +333,7 @@ public abstract class DrawableFile extends AbstractFile drawablePath = StringUtils.removeEnd(getUniquePath(), getName()); return drawablePath; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); + LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); //NON-NLS return ""; } } @@ -344,7 +344,7 @@ public abstract class DrawableFile extends AbstractFile try { return getHashSetNames(); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); + LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); //NON-NLS return Collections.emptySet(); } } @@ -362,7 +362,7 @@ public abstract class DrawableFile extends AbstractFile return this.getUniquePath(); } catch (TskCoreException tskCoreException) { String contentName = this.getName(); - LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N + LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N NON-NLS return contentName; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java index 0d122a6219..cdadb53b94 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java @@ -28,6 +28,7 @@ import java.util.logging.Level; import java.util.stream.Collectors; import javax.annotation.Nonnull; import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.casemodule.services.TagsManager; @@ -41,11 +42,12 @@ import org.sleuthkit.datamodel.TskCoreException; * Manages Tags, Tagging, and the relationship between Categories and Tags in * the autopsy Db. delegates some, work to the backing {@link TagsManager}. */ +@NbBundle.Messages({"DrawableTagsManager.followUp=Follow Up"}) public class DrawableTagsManager { private static final Logger LOGGER = Logger.getLogger(DrawableTagsManager.class.getName()); - private static final String FOLLOW_UP = "Follow Up"; + private static final String FOLLOW_UP = Bundle.DrawableTagsManager_followUp(); final private Object autopsyTagsManagerLock = new Object(); private TagsManager autopsyTagsManager; @@ -53,8 +55,8 @@ public class DrawableTagsManager { /** Used to distribute {@link TagsChangeEvent}s */ private final EventBus tagsEventBus = new AsyncEventBus( Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { - LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); + new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS + LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); //NON-NLS }).build() )); @@ -147,7 +149,7 @@ public class DrawableTagsManager { .distinct().sorted() .collect(Collectors.toList()); } catch (TskCoreException | IllegalStateException ex) { - LOGGER.log(Level.WARNING, "couldn't access case", ex); + LOGGER.log(Level.WARNING, "couldn't access case", ex); //NON-NLS } return Collections.emptyList(); } @@ -183,7 +185,7 @@ public class DrawableTagsManager { throw new TskCoreException("tagame exists but wasn't found", ex); } } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); + LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); //NON-NLS throw new TskCoreException("Case was closed out from underneath", ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java index a04646c310..9b3b3218f1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java @@ -46,7 +46,7 @@ public class HashSetManager { try { return db.getHashSetsForFile(fileID); } catch (TskCoreException ex) { - Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); + Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); //NON-NLS return Collections.emptySet(); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java index 4249fe3c24..01e5cfd983 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java @@ -46,7 +46,7 @@ public class ImageFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to read image {0}: " + exception.toString(); + return "Failed to read image {0}: " + exception.toString(); //NON-NLS } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java index 20724ef0bc..3bba01be21 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java @@ -29,6 +29,7 @@ import javafx.scene.media.Media; import javafx.scene.media.MediaException; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.VideoUtils; @@ -39,7 +40,7 @@ public class VideoFile extends DrawableFile { private static final Logger LOGGER = Logger.getLogger(VideoFile.class.getName()); - private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); + private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); //NON-NLS VideoFile(T file, Boolean analyzed) { super(file, analyzed); @@ -53,7 +54,7 @@ public class VideoFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to get image preview for video {0}: " + exception.toString(); + return "Failed to get image preview for video {0}: " + exception.toString(); //NON-NLS } @Override @@ -63,6 +64,7 @@ public class VideoFile extends DrawableFile { private SoftReference mediaRef; + @NbBundle.Messages({"VideoFile.getMedia.progress=writing temporary file to disk"}) public Media getMedia() throws IOException, MediaException { Media media = (mediaRef != null) ? mediaRef.get() : null; @@ -73,7 +75,7 @@ public class VideoFile extends DrawableFile { if (cacheFile.exists() == false || cacheFile.length() < getAbstractFile().getSize()) { Files.createParentDirs(cacheFile); - ProgressHandle progressHandle = ProgressHandleFactory.createHandle("writing temporary file to disk"); + ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.VideoFile_getMedia.progress()); progressHandle.start(100); ContentUtils.writeToFile(this.getAbstractFile(), cacheFile, progressHandle, null, true); progressHandle.finish(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java index f3020830a9..1b8b7d72c8 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java @@ -126,7 +126,7 @@ public class DrawableGroup implements Comparable { .filter(Boolean::booleanValue) .count()); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS } } @@ -145,7 +145,7 @@ public class DrawableGroup implements Comparable { uncatCount.set(ImageGalleryController.getDefault().getDatabase().getCategoryCount(Category.ZERO, fileIDs)); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS } } @@ -202,7 +202,7 @@ public class DrawableGroup implements Comparable { @Override public String toString() { - return "Grouping{ keyProp=" + groupKey + '}'; + return "Grouping{ keyProp=" + groupKey + '}'; //NON-NLS } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java index 79cbb1fba2..1073d587da 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java @@ -57,7 +57,7 @@ public class GroupKey> implements Comparable @Override public String toString() { - return "GroupKey: " + getAttribute().attrName + " = " + getValue(); + return "GroupKey: " + getAttribute().attrName + " = " + getValue(); //NON-NLS } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java index 200ef32a16..cebcd6c222 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java @@ -62,6 +62,7 @@ import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Exceptions; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -195,10 +196,10 @@ public class GroupManager { DrawableFile file = db.getFileFromID(fileID); return getGroupKeysForFile(file); } else { - Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); + Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); //NON-NLS } } catch (TskCoreException ex) { - Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); + Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); //NON-NLS } return Collections.emptySet(); } @@ -347,11 +348,11 @@ public class GroupManager { break; case MIME_TYPE: HashSet types = new HashSet<>(); - try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); + try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); //NON-NLS ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final String mimeType = resultSet.getString("mime_type"); - String objIds = resultSet.getString("group_concat(obj_id)"); + final String mimeType = resultSet.getString("mime_type"); //NON-NLS + String objIds = resultSet.getString("group_concat(obj_id)"); //NON-NLS Pattern.compile(",").splitAsStream(objIds) .map(Long::valueOf) @@ -370,7 +371,7 @@ public class GroupManager { return values; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); + LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); //NON-NLS return Collections.emptyList(); } @@ -416,7 +417,7 @@ public class GroupManager { } } - return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); + return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); //NON-NLS } else { List contentTags = tagsManager.getContentTagsByTagName(tagsManager.getTagName(category)); @@ -428,7 +429,7 @@ public class GroupManager { } } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); + LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); //NON-NLS throw ex; } } @@ -444,7 +445,7 @@ public class GroupManager { } return files; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); + LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); //NON-NLS throw ex; } } @@ -531,7 +532,7 @@ public class GroupManager { /** * an executor to submit async ui related background tasks to. */ - final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); + final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); //NON-NLS public ReadOnlyDoubleProperty regroupProgress() { return regroupProgress.getReadOnlyProperty(); @@ -682,7 +683,7 @@ public class GroupManager { return group; } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); + LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); //NON-NLS } } } @@ -693,13 +694,13 @@ public class GroupManager { HashSet hashSet = new HashSet<>(); String query = (null == mimeType) - ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" - : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; + ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" //NON-NLS + : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; //NON-NLS try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(query); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final long fileID = resultSet.getLong("obj_id"); + final long fileID = resultSet.getLong("obj_id"); //NON-NLS if (db.isInDB(fileID)) { hashSet.add(fileID); } @@ -717,6 +718,13 @@ public class GroupManager { * {@link Groupings} for them */ @SuppressWarnings({"unchecked", "rawtypes"}) + @NbBundle.Messages({"# {0} - groupBy attribute Name", + "# {1} - sortBy name", + "# {2} - sort Order", + "ReGroupTask.displayTitle=regrouping files by {0} sorted by {1} in {2} order", + "# {0} - groupBy attribute Name", + "# {1} - atribute value", + "ReGroupTask.progressUpdate=regrouping files by {0} : {1}"}) private class ReGroupTask> extends LoggedTask { private ProgressHandle groupProgress; @@ -728,7 +736,7 @@ public class GroupManager { private final SortOrder sortOrder; public ReGroupTask(DrawableAttribute groupBy, GroupSortBy sortBy, SortOrder sortOrder) { - super("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", true); + super(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), true); this.groupBy = groupBy; this.sortBy = sortBy; @@ -747,7 +755,7 @@ public class GroupManager { return null; } - groupProgress = ProgressHandleFactory.createHandle("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", this); + groupProgress = ProgressHandleFactory.createHandle(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), this); Platform.runLater(() -> { analyzedGroups.clear(); unSeenGroups.clear(); @@ -765,9 +773,9 @@ public class GroupManager { return null;//abort } p++; - updateMessage("regrouping files by " + groupBy.attrName.toString() + " : " + val); + updateMessage(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), val)); updateProgress(p, vals.size()); - groupProgress.progress("regrouping files by " + groupBy.attrName.toString() + " : " + val, p); + groupProgress.progress(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), val), p); popuplateIfAnalyzed(new GroupKey(groupBy, val), this); } Platform.runLater(() -> FXCollections.sort(analyzedGroups, sortBy.getGrpComparator(sortOrder))); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java index 53f464dbb0..5d8740b343 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java @@ -27,6 +27,7 @@ import javax.swing.SortOrder; import static javax.swing.SortOrder.ASCENDING; import static javax.swing.SortOrder.DESCENDING; import org.apache.commons.lang3.StringUtils; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; @@ -35,13 +36,17 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; * down in Toolbar as well as each enum value having the stategy * ({@link Comparator}) for sorting the groups */ +@NbBundle.Messages({"GroupSortBy.groupSize=Group Size", + "GroupSortBy.groupName=Group Name", + "GroupSortBy.none=None", + "GroupSortBy.priority=Priority"}) public enum GroupSortBy implements ComparatorProvider { /** * sort the groups by the number of files in each sort the groups by the * number of files in each */ - FILE_COUNT("Group Size", true, "folder-open-image.png") { + FILE_COUNT(Bundle.GroupSortBy_groupSize(), true, "folder-open-image.png") { //NON-NLS @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparingInt(DrawableGroup::getSize)); @@ -56,7 +61,7 @@ public enum GroupSortBy implements ComparatorProvider { * sort the groups by the natural order of the grouping value ( eg group * them by path alphabetically ) */ - GROUP_BY_VALUE("Group Name", true, "folder-rename.png") { + GROUP_BY_VALUE(Bundle.GroupSortBy_groupName(), true, "folder-rename.png") { //NON-NLS @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparing(t -> t.getGroupByValueDislpayName())); @@ -71,7 +76,7 @@ public enum GroupSortBy implements ComparatorProvider { * don't sort the groups just use what ever order they come in (ingest * order) */ - NONE("None", false, "prohibition.png") { + NONE(Bundle.GroupSortBy_none(), false, "prohibition.png") { //NON-NLS @Override public Comparator getGrpComparator(SortOrder sortOrder) { return new NoOpComparator<>(); @@ -85,7 +90,7 @@ public enum GroupSortBy implements ComparatorProvider { /** * sort the groups by some priority metric to be determined and implemented */ - PRIORITY("Priority", false, "hashset_hits.png") { + PRIORITY(Bundle.GroupSortBy_priority(), false, "hashset_hits.png") { //NON-NLS @Override public Comparator getGrpComparator(SortOrder sortOrder) { return Comparator.nullsLast(Comparator.comparingDouble(DrawableGroup::getHashHitDensity).thenComparingInt(DrawableGroup::getSize).reversed()); @@ -128,7 +133,7 @@ public enum GroupSortBy implements ComparatorProvider { public Image getIcon() { if (icon == null) { if (StringUtils.isBlank(imageName) == false) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS } } return icon; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java index 402694bd07..872a2afc6b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java @@ -53,7 +53,7 @@ public class NoGroupsDialog extends GridPane { } private NoGroupsDialog() { - FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); + FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); //NON-NLS } public NoGroupsDialog(String message) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java index c1d2fe7a7b..0a0ce0f663 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java @@ -28,6 +28,7 @@ import javafx.scene.control.Label; import javafx.scene.control.ProgressBar; import javafx.scene.control.Tooltip; import javafx.scene.layout.AnchorPane; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -62,6 +63,10 @@ public class StatusBar extends AnchorPane { private ProgressBar bgTaskProgressBar; @FXML + @NbBundle.Messages({"# {0} - file update queue size", + "StatusBar.fileUpdateTaskLabel.text={0} File Update Tasks", + "StatusBar.bgTaskLabel.text=Regrouping", + "StatuBar.toolTip=Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data."}) void initialize() { assert fileTaskProgresBar != null : "fx:id=\"fileTaskProgresBar\" was not injected: check your FXML file 'StatusBar.fxml'."; assert fileUpdateTaskLabel != null : "fx:id=\"fileUpdateTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'."; @@ -69,7 +74,7 @@ public class StatusBar extends AnchorPane { assert bgTaskLabel != null : "fx:id=\"bgTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'."; assert bgTaskProgressBar != null : "fx:id=\"bgTaskProgressBar\" was not injected: check your FXML file 'StatusBar.fxml'."; - fileUpdateTaskLabel.textProperty().bind(controller.getFileUpdateQueueSizeProperty().asString().concat(" File Update Tasks"));//;setText(newSize.toString() + " File Update Tasks"); + fileUpdateTaskLabel.textProperty().bind(Bundle.StatusBar_fileUpdateTaskLabel_text(controller.getFileUpdateQueueSizeProperty().asString()));//;setText(newSize.toString() + " File Update Tasks"); fileTaskProgresBar.progressProperty().bind(controller.getFileUpdateQueueSizeProperty().negate()); // controller.getFileUpdateQueueSizeProperty().addListener((ov, oldSize, newSize) -> { // Platform.runLater(() -> { @@ -83,7 +88,7 @@ public class StatusBar extends AnchorPane { if(controller.regroupProgress().lessThan(1.0).get()){ // Regrouping in progress bgTaskProgressBar.progressProperty().setValue(-1.0); - bgTaskLabel.setText("Regrouping"); + bgTaskLabel.setText(Bundle.StatusBar_bgTaskLabel_text()); } else{ // Clear the progress bar bgTaskProgressBar.progressProperty().setValue(0.0); @@ -94,14 +99,14 @@ public class StatusBar extends AnchorPane { Platform.runLater(() -> { - staleLabel.setTooltip(new Tooltip("Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data.")); + staleLabel.setTooltip(new Tooltip(Bundle.StatuBar_toolTip())); }); staleLabel.visibleProperty().bind(controller.stale()); } public StatusBar(ImageGalleryController controller) { this.controller = controller; - FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); //NON-NLS fxmlLoader.setRoot(this); fxmlLoader.setController(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java index 6fe4ce9b44..b9b1c04813 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java @@ -79,7 +79,7 @@ public class SummaryTablePane extends AnchorPane { public SummaryTablePane(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "SummaryTablePane.fxml"); + FXMLConstructor.construct(this, "SummaryTablePane.fxml"); //NON-NLS } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java index 91ca4a142c..5c68a94436 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java @@ -142,7 +142,7 @@ public class Toolbar extends ToolBar { try { new TagGroupAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); + LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); //NON-NLS } }); @@ -213,7 +213,7 @@ public class Toolbar extends ToolBar { private Toolbar(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "Toolbar.fxml"); + FXMLConstructor.construct(this, "Toolbar.fxml"); //NON-NLS } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java index 9b60278865..01b0e5dd1b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java @@ -40,19 +40,20 @@ import javafx.scene.media.MediaView; import javafx.scene.text.Text; import javafx.util.Duration; import javafx.util.StringConverter; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.datamodel.VideoFile; public class VideoPlayer extends BorderPane { - private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); - private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); - private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); - private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); + private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); //NON-NLS + private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); //NON-NLS + private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); //NON-NLS + private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); //NON-NLS - private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); - private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); + private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); //NON-NLS + private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); //NON-NLS private final MediaPlayer mp; @@ -106,6 +107,8 @@ public class VideoPlayer extends BorderPane { private final VideoFile file; @FXML + @NbBundle.Messages({"# {0} - exception type", + "VideoPlayer.errNotice={0}\nSee the logs for details."}) void initialize() { assert controlButton != null : "fx:id=\"controlButton\" was not injected: check your FXML file 'MediaControl.fxml'."; assert timeSlider != null : "fx:id=\"timeSlider\" was not injected: check your FXML file 'MediaControl.fxml'."; @@ -114,14 +117,14 @@ public class VideoPlayer extends BorderPane { final MediaException ex = mp.getError(); if (ex != null) { Platform.runLater(() -> { - Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); - setCenter(new Text(ex.getType() + "\nSee the logs for details.")); + Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); //NON-NLS + setCenter(new Text(Bundle.VideoPlayer_errNotice(ex.getType()))); setBottom(null); }); } }); mp.statusProperty().addListener((observableStatus, oldStatus, newStatus) -> { - Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); + Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); //NON-NLS }); mediaView.setMediaPlayer(mp); mediaView.fitHeightProperty().bind(this.heightProperty().subtract(playControlBar.heightProperty())); @@ -236,7 +239,7 @@ public class VideoPlayer extends BorderPane { public VideoPlayer(MediaPlayer mp, VideoFile file) { this.file = file; this.mp = mp; - FXMLConstructor.construct(this, "MediaControl.fxml"); + FXMLConstructor.construct(this, "MediaControl.fxml"); //NON-NLS } protected void updateTime() { @@ -277,10 +280,10 @@ public class VideoPlayer extends BorderPane { int elapsedSeconds = totalSeconds - elapsedMinutes * 60; if (elapsedHours > 0) { - return String.format("%d:%02d:%02d", elapsedHours, + return String.format("%d:%02d:%02d", elapsedHours, //NON-NLS elapsedMinutes, elapsedSeconds); } else { - return String.format("%02d:%02d", elapsedMinutes, + return String.format("%02d:%02d", elapsedMinutes, //NON-NLS elapsedSeconds); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java index 674aad0260..badfc20b92 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java @@ -54,7 +54,7 @@ public class DrawableTile extends DrawableTileBase { try { setEffect(Objects.equals(newValue, getFileID()) ? LAST_SELECTED_EFFECT : null); } catch (java.lang.IllegalStateException ex) { - Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); + Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); //NON-NLS } }; @@ -78,7 +78,7 @@ public class DrawableTile extends DrawableTileBase { public DrawableTile(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "DrawableTile.fxml"); + FXMLConstructor.construct(this, "DrawableTile.fxml"); //NON-NLS } /** diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java index 2058737b3c..7cbc9350cb 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java @@ -95,8 +95,8 @@ public abstract class DrawableTileBase extends DrawableUIBase { private static final Border SELECTED_BORDER = new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, new CornerRadii(2), new BorderWidths(3))); //TODO: do this in CSS? -jm - protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); - protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); + protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); //NON-NLS + protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); //NON-NLS protected final FileIDSelectionModel selectionModel; private static ContextMenu contextMenu; @@ -197,6 +197,8 @@ public abstract class DrawableTileBase extends DrawableUIBase { t.consume(); } + @NbBundle.Messages({"DrawableTileBase.menuItem.extractFiles=Extract File(s)", + "DrawableTileBase.menuItem.showContentViewer=Show Content Viewer"}) private ContextMenu buildContextMenu(DrawableFile file) { final ArrayList menuItems = new ArrayList<>(); @@ -204,7 +206,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { menuItems.add(new AddDrawableTagAction(getController()).getPopupMenu()); - final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); + final MenuItem extractMenuItem = new MenuItem(Bundle.DrawableTileBase_menuItem_extractFiles()); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -213,10 +215,10 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); menuItems.add(extractMenuItem); - MenuItem contentViewer = new MenuItem("Show Content Viewer"); + MenuItem contentViewer = new MenuItem(Bundle.DrawableTileBase_menuItem_showContentViewer()); contentViewer.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { - new NewWindowViewAction("Show Content Viewer", new FileNode(file.getAbstractFile())).actionPerformed(null); + new NewWindowViewAction(Bundle.DrawableTileBase_menuItem_showContentViewer(), new FileNode(file.getAbstractFile())).actionPerformed(null); }); }); menuItems.add(contentViewer); @@ -260,7 +262,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { selectionModel.clearAndSelect(file.getId()); new AddDrawableTagAction(getController()).addTag(getController().getTagsManager().getFollowUpTagName(), ""); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); + LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); //NON-NLS } } else { new DeleteFollowUpTagAction(getController(), file).handle(event); @@ -276,7 +278,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { return DrawableAttribute.TAGS.getValue(getFile().get()).stream() .anyMatch(followUpTagName::equals); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); + LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); //NON-NLS return true; } } else { @@ -363,7 +365,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS } }); } @@ -380,7 +382,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { updateFollowUpIcon(); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS } }); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java index d77eee7f44..1a6bfd227e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java @@ -102,7 +102,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView try { fileOpt = Optional.ofNullable(getController().getFileFromId(fileIDOpt.get())); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); + Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); //NON-NLS fileOpt = Optional.empty(); } return fileOpt; @@ -147,7 +147,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView myTask.setOnFailed(failed -> { Throwable exception = myTask.getException(); if (exception instanceof OutOfMemoryError - && exception.getMessage().contains("Java heap space")) { + && exception.getMessage().contains("Java heap space")) { //NON-NLS showErrorNode(Bundle.DrawableUIBase_errorLabel_OOMText(), file); } else { showErrorNode(Bundle.DrawableUIBase_errorLabel_text(), file); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java index 96d30afd93..1219e2d1a8 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java @@ -92,7 +92,7 @@ public interface DrawableView { } catch (NullPointerException ex) { // I think this happens when we're in the process of removing images from the view while // also trying to update it? - Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); + Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); //NON-NLS return false; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java index a31001fd2f..7955368a9e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java @@ -89,6 +89,8 @@ import javafx.scene.layout.Priority; import javafx.scene.layout.Region; import javafx.scene.paint.Color; import javafx.util.Duration; + +import javax.ejb.MessageDriven; import javax.swing.Action; import javax.swing.SwingUtilities; import org.apache.commons.lang3.StringUtils; @@ -97,6 +99,7 @@ import org.controlsfx.control.GridView; import org.controlsfx.control.SegmentedButton; import org.controlsfx.control.action.ActionUtils; import org.openide.util.Lookup; +import org.openide.util.NbBundle; import org.openide.util.actions.Presenter; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; @@ -273,7 +276,7 @@ public class GroupPane extends BorderPane { undoAction = new UndoAction(controller); redoAction = new RedoAction(controller); - FXMLConstructor.construct(this, "GroupPane.fxml"); + FXMLConstructor.construct(this, "GroupPane.fxml"); //NON-NLS } @ThreadConfined(type = ThreadType.JFX) @@ -330,10 +333,14 @@ public class GroupPane extends BorderPane { /** * create the string to display in the group header */ + @NbBundle.Messages({"# {0} - default group name", + "# {1} - hashset hits count", + "# {2} - group size", + "GroupPane.headerString={0} -- {1} hash set hits / {2} files"}) protected String getHeaderString() { return isNull(getGroup()) ? "" - : StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()) + " -- " - + getGroup().getHashSetHitsCount() + " hash set hits / " + getGroup().getSize() + " files"; + : Bundle.GroupPane_headerString(StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()), + getGroup().getHashSetHitsCount(), getGroup().getSize()); } ContextMenu getContextMenu() { @@ -451,13 +458,13 @@ public class GroupPane extends BorderPane { try { tagSelectedSplitMenu.setText(controller.getTagsManager().getFollowUpTagName().getDisplayName()); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS } tagSelectedSplitMenu.setOnAction(actionEvent -> { try { new TagSelectedFilesAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS } }); @@ -512,6 +519,7 @@ public class GroupPane extends BorderPane { addEventFilter(KeyEvent.KEY_PRESSED, tileKeyboardNavigationHandler); gridView.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler() { + @NbBundle.Messages({"GroupPane.gridViewContextMenuItem.extractFiles=Extract File(s)"}) private ContextMenu buildContextMenu() { ArrayList menuItems = new ArrayList<>(); @@ -528,7 +536,7 @@ public class GroupPane extends BorderPane { } } } - final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); + final MenuItem extractMenuItem = new MenuItem(Bundle.GroupPane_gridViewContextMenuItem_extractFiles()); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -730,7 +738,7 @@ public class GroupPane extends BorderPane { if (gridView == null || gridView.getSkin() == null) { return Optional.empty(); } - return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); + return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); //NON-NLS } void makeSelection(Boolean shiftDown, Long newFileID) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java index 32b8b8c71f..24e2072aec 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java @@ -50,6 +50,7 @@ import javafx.scene.input.KeyEvent; import javafx.scene.layout.Region; import javafx.scene.text.Text; import javafx.util.Pair; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.coreutils.Logger; @@ -84,10 +85,11 @@ public class MetaDataPane extends DrawableUIBase { public MetaDataPane(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "MetaDataPane.fxml"); + FXMLConstructor.construct(this, "MetaDataPane.fxml"); //NON-NLS } @FXML + @NbBundle.Messages({"MetaDataPane.tableView.placeholder=Select a file to show its details here."}) void initialize() { assert attributeColumn != null : "fx:id=\"attributeColumn\" was not injected: check your FXML file 'MetaDataPane.fxml'."; assert imageView != null : "fx:id=\"imageView\" was not injected: check your FXML file 'MetaDataPane.fxml'."; @@ -116,7 +118,7 @@ public class MetaDataPane extends DrawableUIBase { }); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label("Select a file to show its details here.")); + tableView.setPlaceholder(new Label(Bundle.MetaDataPane_tableView_placeholder())); tableView.getColumns().setAll(Arrays.asList(attributeColumn, valueColumn)); attributeColumn.setPrefWidth(USE_COMPUTED_SIZE); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java index 59d747a655..ad7d90a209 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java @@ -77,7 +77,7 @@ public class SlideShowView extends DrawableTileBase { SlideShowView(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "SlideShowView.fxml"); + FXMLConstructor.construct(this, "SlideShowView.fxml"); //NON-NLS } @FXML @@ -137,7 +137,7 @@ public class SlideShowView extends DrawableTileBase { }); } catch (NullPointerException ex) { // The case has likely been closed - LOGGER.log(Level.WARNING, "Error accessing groupPane"); + LOGGER.log(Level.WARNING, "Error accessing groupPane"); //NON-NLS } } @@ -278,9 +278,12 @@ public class SlideShowView extends DrawableTileBase { * @return supplemental text to include in the label, specifically: "image x * of y" */ + @NbBundle.Messages({"# {0} - file id number", + "# {1} - number of file ids", + "SlideShowView.supplementalText={0} of {1} in group"}) private String getSupplementalText() { final ObservableList fileIds = getGroupPane().getGroup().getFileIDs(); - return getFileID().map(fileID -> " ( " + (fileIds.indexOf(fileID) + 1) + " of " + fileIds.size() + " in group )") + return getFileID().map(fileID -> " ( " + Bundle.SlideShowView.supplementalText(fileIds.indexOf(fileID) + 1, fileIds.size()) + " )") .orElse(""); } @@ -324,7 +327,7 @@ public class SlideShowView extends DrawableTileBase { final Media media = file.getMedia(); return new VideoPlayer(new MediaPlayer(media), file); } catch (MediaException | IOException | OutOfMemoryError ex) { - LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); + LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); //NON-NLS return doReadImageTask(file); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java index c7bce311c4..a5bbb40f49 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java @@ -21,27 +21,34 @@ package org.sleuthkit.autopsy.imagegallery.gui.navpanel; import com.google.common.collect.ImmutableList; import java.util.Comparator; import java.util.function.Function; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup; /** * */ +@NbBundle.Messages({"GroupComparators.uncategorizedCount=Uncategorized Count", + "GroupComparators.groupName=Group Name", + "GroupComparators.hitCount=Hit Count", + "GroupComparators.groupSize=Group Size", + "GroupComparators.hitDensity=Hit Density"}) final class GroupComparators> implements Comparator { static final GroupComparators UNCATEGORIZED_COUNT = - new GroupComparators<>("Uncategorized Count", DrawableGroup::getUncategorizedCount, String::valueOf, false); + new GroupComparators<>(Bundle.GroupComparators_uncategorizedCount(), DrawableGroup::getUncategorizedCount, String::valueOf, false); static final GroupComparators ALPHABETICAL = - new GroupComparators<>("Group Name", DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); + new GroupComparators<>(Bundle.GroupComparators_groupName(), DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); static final GroupComparators HIT_COUNT = - new GroupComparators<>("Hit Count", DrawableGroup::getHashSetHitsCount, String::valueOf, true); + new GroupComparators<>(Bundle.GroupComparators_hitCount(), DrawableGroup::getHashSetHitsCount, String::valueOf, true); static final GroupComparators FILE_COUNT = - new GroupComparators<>("Group Size", DrawableGroup::getSize, String::valueOf, true); + new GroupComparators<>(Bundle.GroupComparators_groupSize(), DrawableGroup::getSize, String::valueOf, true); static final GroupComparators HIT_FILE_RATIO = - new GroupComparators<>("Hit Density", DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); + new GroupComparators<>(Bundle.GroupComparators_hitDensity(), DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); //NON-NLS private final static ImmutableList> values = ImmutableList.of(UNCATEGORIZED_COUNT, ALPHABETICAL, HIT_COUNT, FILE_COUNT, HIT_FILE_RATIO); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java index 6951d67997..37caa8bd78 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java @@ -42,7 +42,7 @@ class GroupListCell extends ListCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS /** * reference to group files listener that allows us to remove it from a @@ -70,8 +70,8 @@ class GroupListCell extends ListCell { GroupListCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -145,7 +145,7 @@ class GroupListCell extends ListCell { private String getSeenStyleClass() { return Optional.ofNullable(getItem()) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") + .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java index e371644944..ffe9df9a51 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java @@ -32,6 +32,8 @@ import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; import javafx.scene.image.ImageView; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.Beta; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -53,15 +55,16 @@ final public class GroupTree extends NavPanel> { public GroupTree(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); + FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS } @FXML @Override + @NbBundle.Messages({"GroupTree.displayName.allGroups=All Groups"}) void initialize() { super.initialize(); - setText("All Groups"); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); + setText(Bundle.GroupTree_displayName_allGroups()); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); //NON-NLS getBorderPane().setCenter(groupTree); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java index 917aa35084..a26ec693c7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java @@ -47,7 +47,7 @@ class GroupTreeCell extends TreeCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS /** * reference to group files listener that allows us to remove it from a @@ -75,8 +75,8 @@ class GroupTreeCell extends TreeCell { GroupTreeCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -161,7 +161,7 @@ class GroupTreeCell extends TreeCell { return Optional.ofNullable(getItem()) .map(GroupTreeNode::getGroup) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") + .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java index 71f8aa026f..03c6663369 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java @@ -24,6 +24,7 @@ import javafx.fxml.FXML; import javafx.scene.control.ListView; import javafx.scene.control.SelectionModel; import javafx.scene.image.ImageView; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -47,7 +48,7 @@ final public class HashHitGroupList extends NavPanel { public HashHitGroupList(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); + FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS } @ThreadConfined(type = ThreadConfined.ThreadType.JFX) @@ -68,11 +69,12 @@ final public class HashHitGroupList extends NavPanel { @FXML @Override + @NbBundle.Messages({"HashHitGroupList.displayName.onlyHashHits=Only Hash Hits"}) void initialize() { super.initialize(); - setText("Only Hash Hits"); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); + setText(Bundle.HashHitGroupList_displayName_onlyHashHits()); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); //NON-NLS getBorderPane().setCenter(groupList); sorted = getController().getGroupManager().getAnalyzedGroups().filtered((DrawableGroup t) -> t.getHashSetHitsCount() > 0).sorted(getDefaultComparator()); From 553184a078a51372b6608d50f151bef9684f24b4 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Sat, 30 Jan 2016 16:58:45 -0500 Subject: [PATCH 37/48] Fixed uses of Bundle tags where '.' was not replaced with a '_'. --- .../autopsy/imagegallery/ImageGalleryController.java | 8 ++++---- .../autopsy/imagegallery/datamodel/VideoFile.java | 2 +- .../imagegallery/gui/drawableviews/SlideShowView.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index 22dbf04457..34f46d643e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -709,10 +709,10 @@ public final class ImageGalleryController implements Executor { * approximation to 'analyzed'. */ @NbBundle.Messages({"CopyAnalyzedFiles.populatingDb.status=populating analyzed image/video database", - "CopyAnalyzedFiles.committingDb.status=commiting image/video database", - "CopyAnalyzedFiles.stopCopy.status=Stopping copy to drawable db task.", - "CopyAnalyzedFiles.errPopulating.errMsg=There was an error populating Image Gallery database.", - ""}) + "CopyAnalyzedFiles.committingDb.status=commiting image/video database", + "CopyAnalyzedFiles.stopCopy.status=Stopping copy to drawable db task.", + "CopyAnalyzedFiles.errPopulating.errMsg=There was an error populating Image Gallery database.", + ""}) static private class CopyAnalyzedFiles extends InnerTask { private final ImageGalleryController controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java index 3bba01be21..1da586f603 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java @@ -75,7 +75,7 @@ public class VideoFile extends DrawableFile { if (cacheFile.exists() == false || cacheFile.length() < getAbstractFile().getSize()) { Files.createParentDirs(cacheFile); - ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.VideoFile_getMedia.progress()); + ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.VideoFile_getMedia_progress()); progressHandle.start(100); ContentUtils.writeToFile(this.getAbstractFile(), cacheFile, progressHandle, null, true); progressHandle.finish(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java index ad7d90a209..1818f65521 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java @@ -283,7 +283,7 @@ public class SlideShowView extends DrawableTileBase { "SlideShowView.supplementalText={0} of {1} in group"}) private String getSupplementalText() { final ObservableList fileIds = getGroupPane().getGroup().getFileIDs(); - return getFileID().map(fileID -> " ( " + Bundle.SlideShowView.supplementalText(fileIds.indexOf(fileID) + 1, fileIds.size()) + " )") + return getFileID().map(fileID -> " ( " + Bundle.SlideShowView_supplementalText(fileIds.indexOf(fileID) + 1, fileIds.size()) + " )") .orElse(""); } From 266e4ef52a7a225a05619fa33b25df43ba16c17a Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sat, 30 Jan 2016 17:50:48 -0500 Subject: [PATCH 38/48] Temp excise of persistent column ordering --- .../corecomponents/DataResultViewerTable.java | 227 ++++++++++-------- .../datamodel/BlackboardArtifactNode.java | 13 +- .../datamodel/BlackboardArtifactTagNode.java | 13 +- .../autopsy/datamodel/ContentTagNode.java | 13 +- .../autopsy/datamodel/DataSourcesNode.java | 13 +- .../autopsy/datamodel/DeletedContent.java | 29 ++- .../autopsy/datamodel/DirectoryNode.java | 13 +- .../datamodel/DisplayableItemNode.java | 9 +- .../autopsy/datamodel/EmailExtracted.java | 39 ++- .../autopsy/datamodel/ExtractedContent.java | 26 +- .../sleuthkit/autopsy/datamodel/FileNode.java | 13 +- .../sleuthkit/autopsy/datamodel/FileSize.java | 28 ++- .../autopsy/datamodel/FileTypeNode.java | 13 +- .../autopsy/datamodel/FileTypesNode.java | 25 +- .../autopsy/datamodel/HashsetHits.java | 26 +- .../autopsy/datamodel/ImageNode.java | 13 +- .../autopsy/datamodel/InterestingHits.java | 26 +- .../autopsy/datamodel/KeywordHits.java | 40 ++- .../autopsy/datamodel/LayoutFileNode.java | 14 +- .../autopsy/datamodel/LocalFileNode.java | 13 +- .../datamodel/RecentFilesFilterNode.java | 13 +- .../autopsy/datamodel/RecentFilesNode.java | 13 +- .../sleuthkit/autopsy/datamodel/Reports.java | 27 ++- .../autopsy/datamodel/ResultsNode.java | 13 +- .../org/sleuthkit/autopsy/datamodel/Tags.java | 52 ++-- .../autopsy/datamodel/ViewsNode.java | 13 +- .../datamodel/VirtualDirectoryNode.java | 13 +- .../autopsy/datamodel/VolumeNode.java | 15 +- .../DirectoryTreeTopComponent.java | 19 +- .../timeline/explorernodes/EventNode.java | 14 +- .../timeline/explorernodes/EventRootNode.java | 13 +- 31 files changed, 521 insertions(+), 290 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java index 57f1a3452a..174a7f0e19 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java @@ -30,15 +30,10 @@ import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; -import java.util.logging.Level; import javax.swing.Action; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.TableColumnModelEvent; -import javax.swing.event.TableColumnModelListener; import org.netbeans.swing.outline.DefaultOutlineModel; import org.openide.explorer.ExplorerManager; import org.openide.explorer.view.OutlineView; @@ -53,10 +48,7 @@ import org.openide.nodes.NodeMemberEvent; import org.openide.nodes.NodeReorderEvent; import org.openide.nodes.Sheet; import org.openide.util.NbBundle; -import org.openide.util.NbPreferences; -import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer; -import org.sleuthkit.autopsy.coreutils.Logger; /** * DataResult sortable table viewer @@ -101,52 +93,66 @@ public class DataResultViewerTable extends AbstractDataResultViewer { // don't show the root node ov.getOutline().setRootVisible(false); ov.getOutline().setDragEnabled(false); - - ov.getOutline().getColumnModel().addColumnModelListener(new TableColumnModelListener() { - @Override - public void columnAdded(TableColumnModelEvent e) {} - @Override - public void columnRemoved(TableColumnModelEvent e) {} - @Override - public void columnMarginChanged(ChangeEvent e) {} - @Override - public void columnSelectionChanged(ListSelectionEvent e) {} - @Override - public void columnMoved(TableColumnModelEvent e) { - // change the order of the column in the array/hashset - List> props = new ArrayList<>(propertiesAcc); - Node.Property prop = props.remove(e.getFromIndex()); - props.add(e.getToIndex(), prop); - - propertiesAcc.clear(); - for (int j = 0; j < props.size(); ++j) { - propertiesAcc.add(props.get(j)); - } - } - }); + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * The following lines of code were added for this feature. + */ +// ov.getOutline().getColumnModel().addColumnModelListener(new TableColumnModelListener() { +// @Override +// public void columnAdded(TableColumnModelEvent e) {} +// @Override +// public void columnRemoved(TableColumnModelEvent e) {} +// @Override +// public void columnMarginChanged(ChangeEvent e) {} +// @Override +// public void columnSelectionChanged(ListSelectionEvent e) {} +// +// @Override +// public void columnMoved(TableColumnModelEvent e) { +// // change the order of the column in the array/hashset +// List> props = new ArrayList<>(propertiesAcc); +// Node.Property prop = props.remove(e.getFromIndex()); +// props.add(e.getToIndex(), prop); +// +// propertiesAcc.clear(); +// for (int j = 0; j < props.size(); ++j) { +// propertiesAcc.add(props.get(j)); +// } +// } +// }); /** - * Add mouse listener to perform action on double-click - * A somewhat hacky way to perform action even if the column clicked - * is not the first one. + * Add mouse listener to perform action on double-click A somewhat hacky + * way to perform action even if the column clicked is not the first + * one. */ ov.getOutline().addMouseListener(new MouseListener() { @Override - public void mousePressed(MouseEvent e) {} + public void mousePressed(MouseEvent e) { + } + @Override - public void mouseReleased(MouseEvent e) {} + public void mouseReleased(MouseEvent e) { + } + @Override - public void mouseEntered(MouseEvent e) {} + public void mouseEntered(MouseEvent e) { + } + @Override - public void mouseExited(MouseEvent e) {} + public void mouseExited(MouseEvent e) { + } + @Override public void mouseClicked(MouseEvent e) { - if(e.getClickCount() == 2) { + if (e.getClickCount() == 2) { Node[] nodes = DataResultViewerTable.this.em.getSelectedNodes(); - for(Node node : nodes) { + for (Node node : nodes) { Action action = node.getPreferredAction(); - if(action != null) + if (action != null) { action.actionPerformed(null); + } } } } @@ -354,12 +360,20 @@ public class DataResultViewerTable extends AbstractDataResultViewer { if (ov == null) { return; } - - storeState(); - + + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * The next three lines of code replaced the three lines of code that + * follow + */ +// storeState(); // set the new root as current - currentRoot = root; - List> props = loadState(); +// currentRoot = root; +// List> props = loadState(); + propertiesAcc.clear(); + DataResultViewerTable.this.getAllChildPropertyHeadersRec(root, 100); + List> props = new ArrayList<>(propertiesAcc); /* * OutlineView makes the first column be the result of @@ -423,7 +437,7 @@ public class DataResultViewerTable extends AbstractDataResultViewer { ov.getOutline().getColumnModel().getColumn(colIndex).setPreferredWidth(colWidth); } } - + // if there's no content just auto resize all columns if (content.length <= 0) { // turn on the auto resize @@ -431,65 +445,70 @@ public class DataResultViewerTable extends AbstractDataResultViewer { } } } - + + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * The following three methods were added for this feature + */ // Store the state of current root Node. - private void storeState() { - if(currentRoot == null || propertiesAcc.isEmpty()) - return; - - TableFilterNode tfn; - if(currentRoot instanceof TableFilterNode) - tfn = (TableFilterNode) currentRoot; - else - return; - - List> props = new ArrayList<>(propertiesAcc); - for (int i = 0; i < props.size(); i++) { - Property prop = props.get(i); - NbPreferences.forModule(this.getClass()).put(getUniqueColName(prop, tfn.getItemType()), String.valueOf(i)); - } - } - +// private void storeState() { +// if(currentRoot == null || propertiesAcc.isEmpty()) +// return; +// +// TableFilterNode tfn; +// if(currentRoot instanceof TableFilterNode) +// tfn = (TableFilterNode) currentRoot; +// else +// return; +// +// List> props = new ArrayList<>(propertiesAcc); +// for (int i = 0; i < props.size(); i++) { +// Property prop = props.get(i); +// NbPreferences.forModule(this.getClass()).put(getUniqueColName(prop, tfn.getItemType()), String.valueOf(i)); +// } +// } // Load the state of current root Node if exists. - private List> loadState() { - propertiesAcc.clear(); - this.getAllChildPropertyHeadersRec(currentRoot, 100); - List> props = new ArrayList<>(propertiesAcc); - - // If node is not table filter node, use default order for columns - TableFilterNode tfn; - if(currentRoot instanceof TableFilterNode) { - tfn = (TableFilterNode) currentRoot; - } - else { - Logger.getLogger(DataResultViewerTable.class.getName()).log(Level.INFO, - "Node {0} is not TableFilterNode, columns are going to be in default order", currentRoot.getName()); - return props; - } - - List> orderedProps = new ArrayList<>(propertiesAcc); - for (Property prop : props) { - Integer value = Integer.valueOf(NbPreferences.forModule(this.getClass()).get(getUniqueColName(prop, tfn.getItemType()), "-1")); - if (value >= 0) { - /** - * The original contents of orderedProps do not matter when setting the new ordered values. The reason - * we copy propertiesAcc into it first is to give it the currect size so we can set() in any index. - */ - orderedProps.set(value, prop); - } - } - propertiesAcc.clear(); - for (Property prop : orderedProps) { - propertiesAcc.add(prop); - } - return orderedProps; - } - - // Get unique name for node and it's property. - private String getUniqueColName(Property prop, String type) { - return Case.getCurrentCase().getName() + "." + type + "." - + prop.getName().replaceAll("[^a-zA-Z0-9_]", "") + ".columnOrder"; - } +// private List> loadState() { +// propertiesAcc.clear(); +// this.getAllChildPropertyHeadersRec(currentRoot, 100); +// List> props = new ArrayList<>(propertiesAcc); +// +// // If node is not table filter node, use default order for columns +// TableFilterNode tfn; +// if (currentRoot instanceof TableFilterNode) { +// tfn = (TableFilterNode) currentRoot; +// } else { +// Logger.getLogger(DataResultViewerTable.class.getName()).log(Level.INFO, +// "Node {0} is not TableFilterNode, columns are going to be in default order", currentRoot.getName()); +// return props; +// } +// +// List> orderedProps = new ArrayList<>(propertiesAcc); +// for (Property prop : props) { +// Integer value = Integer.valueOf(NbPreferences.forModule(this.getClass()).get(getUniqueColName(prop, tfn.getItemType()), "-1")); +// if (value >= 0) { +// /** +// * The original contents of orderedProps do not matter when +// * setting the new ordered values. The reason we copy +// * propertiesAcc into it first is to give it the currect size so +// * we can set() in any index. +// */ +// orderedProps.set(value, prop); +// } +// } +// propertiesAcc.clear(); +// for (Property prop : orderedProps) { +// propertiesAcc.add(prop); +// } +// return orderedProps; +// } +// +// // Get unique name for node and it's property. +// private String getUniqueColName(Property prop, String type) { +// return Case.getCurrentCase().getName() + "." + type + "." +// + prop.getName().replaceAll("[^a-zA-Z0-9_]", "") + ".columnOrder"; +// } // Populate a two-dimensional array with rows of property values for up // to maxRows children of the node passed in. diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java index 4a62a26b2c..198baaf923 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java @@ -414,8 +414,13 @@ public class BlackboardArtifactNode extends DisplayableItemNode { return true; } - @Override - public String getItemType() { - return "BlackboardArtifact"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "BlackboardArtifact"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java index f9e27a8969..257f8ddde1 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java @@ -108,8 +108,13 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode { return true; } - @Override - public String getItemType() { - return "BlackboardArtifactTag"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "BlackboardArtifactTag"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java index 9c92e82958..8be6cda9f4 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java @@ -122,8 +122,13 @@ class ContentTagNode extends DisplayableItemNode { return true; } - @Override - public String getItemType() { - return "ContentTag"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "ContentTag"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java index eb0af9c01c..48bfc74443 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java @@ -56,10 +56,15 @@ public class DataSourcesNode extends DisplayableItemNode { this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/image.png"); //NON-NLS } - @Override - public String getItemType() { - return "DataSources"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "DataSources"; //NON-NLS +// } /* * Custom Keys implementation that listens for new data sources being added. diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java index b1ffc42918..f2b86f8d28 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java @@ -147,10 +147,15 @@ public class DeletedContent implements AutopsyVisitableItem { return s; } - @Override - public String getItemType() { - return "DeletedContent"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "DeletedContent"; //NON-NLS +// } } public static class DeletedContentsChildren extends ChildFactory { @@ -280,11 +285,16 @@ public class DeletedContent implements AutopsyVisitableItem { updateDisplayName(); } - @Override - public String getItemType() { - return "DeletedContentChildren"; //NON-NLS - } - + /* + * TODO (AUT-1849): Correct or remove peristent column reordering + * code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "DeletedContentChildren"; //NON-NLS +// } // update the display name when new events are fired private class DeletedContentNodeObserver implements Observer { @@ -347,7 +357,6 @@ public class DeletedContent implements AutopsyVisitableItem { private final Observer observer = new DeletedContentChildrenObserver(); // Cause refresh of children if there are changes - private class DeletedContentChildrenObserver implements Observer { @Override diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java index baf0b51966..303ca71f15 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java @@ -101,8 +101,13 @@ public class DirectoryNode extends AbstractFsContentNode { return false; } - @Override - public String getItemType() { - return "Directory"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "Directory"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNode.java index d5a4de315e..40f7d52b62 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNode.java @@ -40,6 +40,11 @@ public abstract class DisplayableItemNode extends AbstractNode { public abstract boolean isLeafTypeNode(); public abstract T accept(DisplayableItemNodeVisitor v); - - public abstract String getItemType(); + + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// public abstract String getItemType(); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java index a21ceecc2e..fecf47d7cd 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java @@ -191,10 +191,15 @@ public class EmailExtracted implements AutopsyVisitableItem { return s; } - @Override - public String getItemType() { - return "EmailExtractedRoot"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "EmailExtractedRoot"; //NON-NLS +// } } /** @@ -346,10 +351,15 @@ public class EmailExtracted implements AutopsyVisitableItem { updateDisplayName(); } - @Override - public String getItemType() { - return "EmailExtractedAccount"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "EmailExtractedAccount"; //NON-NLS +// } } /** @@ -437,10 +447,15 @@ public class EmailExtracted implements AutopsyVisitableItem { updateDisplayName(); } - @Override - public String getItemType() { - return "EmailExtractedFolder"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "EmailExtractedFolder"; //NON-NLS +// } } /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java index 5c38965bb6..146c4c72e5 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java @@ -183,10 +183,15 @@ public class ExtractedContent implements AutopsyVisitableItem { return s; } - @Override - public String getItemType() { - return "ExtractedContentRoot"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "ExtractedContentRoot"; //NON-NLS +// } } /** @@ -400,10 +405,15 @@ public class ExtractedContent implements AutopsyVisitableItem { return true; } - @Override - public String getItemType() { - return type.getDisplayName(); - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return type.getDisplayName(); +// } } /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileNode.java index 036e6a2de0..d740149ffe 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileNode.java @@ -184,8 +184,13 @@ public class FileNode extends AbstractFsContentNode { return true; } - @Override - public String getItemType() { - return "File"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "File"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java index 9acf789592..c5fee7d696 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java @@ -144,10 +144,15 @@ public class FileSize implements AutopsyVisitableItem { return s; } - @Override - public String getItemType() { - return "FileSizeRoot"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "FileSizeRoot"; //NON-NLS +// } } /* @@ -286,11 +291,16 @@ public class FileSize implements AutopsyVisitableItem { updateDisplayName(); } - @Override - public String getItemType() { - return "FileSize"; //NON-NLS - } - + /* + * TODO (AUT-1849): Correct or remove peristent column reordering + * code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "FileSize"; //NON-NLS +// } // update the display name when new events are fired private class FileSizeNodeObserver implements Observer { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java index 04102bfead..e1b7553aba 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java @@ -82,10 +82,15 @@ public class FileTypeNode extends DisplayableItemNode { this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-filter-icon.png"); //NON-NLS } - @Override - public String getItemType() { - return "FileType"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "FileType"; //NON-NLS +// } // update the display name when new events are fired private class FileTypeNodeObserver implements Observer { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java index 2240d4ca24..3bbbf0b63c 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java @@ -104,16 +104,21 @@ public class FileTypesNode extends DisplayableItemNode { return s; } - @Override - public String getItemType() { - if(filter == null) - return "FileTypes"; //NON-NLS - if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_DOCUMENT_FILTER)) - return "FileTypesDoc"; //NON-NLS - if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_EXECUTABLE_FILTER)) - return "FileTypesExe"; //NON-NLS - return "FileTypes"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// if(filter == null) +// return "FileTypes"; //NON-NLS +// if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_DOCUMENT_FILTER)) +// return "FileTypesDoc"; //NON-NLS +// if (filter.equals(FileTypeExtensionFilters.RootFilter.TSK_EXECUTABLE_FILTER)) +// return "FileTypesExe"; //NON-NLS +// return "FileTypes"; //NON-NLS +// } /** * diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java index 6e4503bec0..6ecaec6258 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java @@ -169,10 +169,15 @@ public class HashsetHits implements AutopsyVisitableItem { return s; } - @Override - public String getItemType() { - return "HashsetRoot"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "HashsetRoot"; //NON-NLS +// } } /** @@ -327,10 +332,15 @@ public class HashsetHits implements AutopsyVisitableItem { updateDisplayName(); } - @Override - public String getItemType() { - return "HashsetName"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "HashsetName"; //NON-NLS +// } } /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java index bdf90c2e8b..4a822aec09 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java @@ -110,8 +110,13 @@ public class ImageNode extends AbstractContentNode { return v.visit(this); } - @Override - public String getItemType() { - return "Image"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "Image"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java index acc9013158..8faec30ab7 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java @@ -162,10 +162,15 @@ public class InterestingHits implements AutopsyVisitableItem { return s; } - @Override - public String getItemType() { - return "InterestingHitsRoot"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "InterestingHitsRoot"; //NON-NLS +// } } private class SetNameFactory extends ChildFactory.Detachable implements Observer { @@ -313,10 +318,15 @@ public class InterestingHits implements AutopsyVisitableItem { updateDisplayName(); } - @Override - public String getItemType() { - return "InterestingHitsSetName"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "InterestingHitsSetName"; //NON-NLS +// } } private class HitFactory extends ChildFactory implements Observer { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java index 9a1290bc29..987cf72caa 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java @@ -73,7 +73,6 @@ public class KeywordHits implements AutopsyVisitableItem { private final class KeywordResults extends Observable { // Map from listName/Type to Map of keyword to set of artifact Ids - private final Map>> topLevelMap; KeywordResults() { @@ -240,10 +239,15 @@ public class KeywordHits implements AutopsyVisitableItem { return s; } - @Override - public String getItemType() { - return "KeywordRoot"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "KeywordRoot"; //NON-NLS +// } } private class ListFactory extends ChildFactory.Detachable implements Observer { @@ -395,10 +399,15 @@ public class KeywordHits implements AutopsyVisitableItem { updateDisplayName(); } - @Override - public String getItemType() { - return "KeywordList"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "KeywordList"; //NON-NLS +// } } private class TermFactory extends ChildFactory.Detachable implements Observer { @@ -493,10 +502,15 @@ public class KeywordHits implements AutopsyVisitableItem { return s; } - @Override - public String getItemType() { - return "KeywordTerm"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "KeywordTerm"; //NON-NLS +// } } public class HitsFactory extends ChildFactory.Detachable implements Observer { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java index 575695dbe7..0192f37912 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java @@ -38,11 +38,15 @@ import org.sleuthkit.datamodel.TskData; */ public class LayoutFileNode extends AbstractAbstractFileNode { - @Override - public String getItemType() { - return "LayoutFile"; //NON-NLS - } - + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "LayoutFile"; //NON-NLS +// } public static enum LayoutContentPropertyType { PARTS { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java index 3956bb93ac..45c9dd492b 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java @@ -116,8 +116,13 @@ public class LocalFileNode extends AbstractAbstractFileNode { return true; //!this.hasContentChildren(); } - @Override - public String getItemType() { - return "LocalFile"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "LocalFile"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java index 0d7d503c10..e9d8fe6b63 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java @@ -83,8 +83,13 @@ public class RecentFilesFilterNode extends DisplayableItemNode { return true; } - @Override - public String getItemType() { - return "RecentFilesFilter"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "RecentFilesFilter"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java index dd2501e19b..21751acdbc 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java @@ -66,8 +66,13 @@ public class RecentFilesNode extends DisplayableItemNode { return s; } - @Override - public String getItemType() { - return "RecentFiles"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "RecentFiles"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java b/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java index 327fdf1270..e3715787cf 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java @@ -89,10 +89,15 @@ public final class Reports implements AutopsyVisitableItem { return visitor.visit(this); } - @Override - public String getItemType() { - return "ReportsList"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "ReportsList"; //NON-NLS +// } } /** @@ -214,11 +219,15 @@ public final class Reports implements AutopsyVisitableItem { return new OpenReportAction(); } - @Override - public String getItemType() { - return "Reports"; //NON-NLS - } - + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "Reports"; //NON-NLS +// } private static class DeleteReportAction extends AbstractAction { private static DeleteReportAction instance; diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java index 7f761f2b05..737a931097 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java @@ -69,8 +69,13 @@ public class ResultsNode extends DisplayableItemNode { return s; } - @Override - public String getItemType() { - return "Results"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "Results"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java b/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java index a9eabeccc6..16f0ac7084 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java @@ -109,10 +109,15 @@ public class Tags implements AutopsyVisitableItem { return propertySheet; } - @Override - public String getItemType() { - return "TagsRoots"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "TagsRoots"; //NON-NLS +// } } private class TagNameNodeFactory extends ChildFactory.Detachable implements Observer { @@ -271,10 +276,15 @@ public class Tags implements AutopsyVisitableItem { updateDisplayName(); } - @Override - public String getItemType() { - return "TagsName"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "TagsName"; //NON-NLS +// } } /** @@ -371,10 +381,15 @@ public class Tags implements AutopsyVisitableItem { updateDisplayName(); } - @Override - public String getItemType() { - return "TagsContentType"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "TagsContentType"; //NON-NLS +// } } private class ContentTagNodeFactory extends ChildFactory implements Observer { @@ -469,10 +484,15 @@ public class Tags implements AutopsyVisitableItem { updateDisplayName(); } - @Override - public String getItemType() { - return "TagsBlackboardArtifact"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "TagsBlackboardArtifact"; //NON-NLS +// } } private class BlackboardArtifactTagNodeFactory extends ChildFactory implements Observer { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java index 25314fbc00..4919594378 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java @@ -73,8 +73,13 @@ public class ViewsNode extends DisplayableItemNode { return s; } - @Override - public String getItemType() { - return "Views"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "Views"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java index de5c23a0d0..16bb0b591d 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java @@ -149,8 +149,13 @@ public class VirtualDirectoryNode extends AbstractAbstractFileNode { // Listen for case events so that we can detect when case is closed Case.addPropertyChangeListener(pcl); } - + private void removeListeners() { IngestManager.getInstance().removeIngestModuleEventListener(pcl); Case.removePropertyChangeListener(pcl); @@ -190,8 +190,13 @@ public class VolumeNode extends AbstractContentNode { return v.visit(this); } - @Override - public String getItemType() { - return "Volume"; //NON-NLS - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "Volume"; //NON-NLS +// } } diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java index 1fa77f5940..cabc5cc3d4 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java @@ -631,11 +631,18 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat //set node, wrap in filter node first to filter out children Node drfn = new DataResultFilterNode(originNode, DirectoryTreeTopComponent.this.em); Node kffn = new KnownFileFilterNode(drfn, KnownFileFilterNode.getSelectionContext(originNode)); - if(originNode instanceof DisplayableItemNode) { - dataResult.setNode(new TableFilterNode(kffn, true, ((DisplayableItemNode) originNode).getItemType())); - } else { - dataResult.setNode(new TableFilterNode(kffn, true)); - } + /* + * TODO (AUT-1849): Correct or remove peristent column + * reordering code + * + * The following conditional was added to support this + * feature. + */ +// if(originNode instanceof DisplayableItemNode) { +// dataResult.setNode(new TableFilterNode(kffn, true, ((DisplayableItemNode) originNode).getItemType())); +// } else { + dataResult.setNode(new TableFilterNode(kffn, true)); +// } String displayName = ""; Content content = originNode.getLookup().lookup(Content.class); @@ -772,7 +779,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat Node imagesNode = imagesNodeOrig.getNode(); - DataSourcesNode.DataSourcesNodeChildren contentRootChildren = (DataSourcesNode.DataSourcesNodeChildren) imagesNode.getChildren(); + DataSourcesNode.DataSourcesNodeChildren contentRootChildren = (DataSourcesNode.DataSourcesNodeChildren) imagesNode.getChildren(); contentRootChildren.refreshContentKeys(); //final TreeView tree = getTree(); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java b/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java index 2a5473bb52..bd801bef17 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java @@ -121,11 +121,15 @@ class EventNode extends DisplayableItemNode { throw new UnsupportedOperationException("Not supported yet."); // NON-NLS //To change body of generated methods, choose Tools | Templates. } - @Override - public String getItemType() { - return "Event"; - } - + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "Event"; +// } /** * We use TimeProperty instead of a normal NodeProperty to correctly display * the date/time when the user changes the timezone setting. diff --git a/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventRootNode.java b/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventRootNode.java index 401d30e336..9ad3a2bb2f 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventRootNode.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventRootNode.java @@ -70,10 +70,15 @@ public class EventRootNode extends DisplayableItemNode { return childCount; } - @Override - public String getItemType() { - return "EventRoot"; - } + /* + * TODO (AUT-1849): Correct or remove peristent column reordering code + * + * Added to support this feature. + */ +// @Override +// public String getItemType() { +// return "EventRoot"; +// } /** * The node factories used to make lists of files to send to the result From e6e91fa9befc54adb08cdabd830c8f588166fc0f Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sat, 30 Jan 2016 18:27:15 -0500 Subject: [PATCH 39/48] Revert "1501 ja image gallery - redo 1" --- .../autopsy/imagegallery/FXMLConstructor.java | 6 +- .../imagegallery/FileIDSelectionModel.java | 4 +- .../autopsy/imagegallery/FileTypeUtils.java | 50 ++-- .../imagegallery/ImageGalleryController.java | 100 +++---- .../imagegallery/ImageGalleryModule.java | 5 +- .../ImageGalleryOptionsPanel.java | 7 +- .../imagegallery/ImageGalleryPreferences.java | 2 +- .../ImageGalleryTopComponent.java | 10 +- .../imagegallery/PerCaseProperties.java | 6 +- .../autopsy/imagegallery/ThumbnailCache.java | 12 +- .../actions/AddDrawableTagAction.java | 22 +- .../imagegallery/actions/AddTagAction.java | 14 +- .../autopsy/imagegallery/actions/Back.java | 6 +- .../actions/CategorizeAction.java | 22 +- .../actions/DeleteFollowUpTagAction.java | 6 +- .../autopsy/imagegallery/actions/Forward.java | 6 +- .../imagegallery/actions/NextUnseenGroup.java | 11 +- .../imagegallery/actions/OpenAction.java | 15 +- .../actions/OpenExternalViewerAction.java | 7 +- .../imagegallery/actions/OpenHelpAction.java | 4 +- .../imagegallery/actions/RedoAction.java | 6 +- .../imagegallery/actions/UndoAction.java | 6 +- .../imagegallery/datamodel/Category.java | 19 +- .../datamodel/CategoryManager.java | 14 +- .../datamodel/DrawableAttribute.java | 74 ++--- .../imagegallery/datamodel/DrawableDB.java | 254 +++++++++--------- .../imagegallery/datamodel/DrawableFile.java | 14 +- .../datamodel/DrawableTagsManager.java | 12 +- .../datamodel/HashSetManager.java | 2 +- .../imagegallery/datamodel/ImageFile.java | 2 +- .../imagegallery/datamodel/VideoFile.java | 8 +- .../datamodel/grouping/DrawableGroup.java | 6 +- .../datamodel/grouping/GroupKey.java | 2 +- .../datamodel/grouping/GroupManager.java | 44 ++- .../datamodel/grouping/GroupSortBy.java | 15 +- .../imagegallery/gui/NoGroupsDialog.java | 2 +- .../autopsy/imagegallery/gui/StatusBar.java | 13 +- .../imagegallery/gui/SummaryTablePane.java | 2 +- .../autopsy/imagegallery/gui/Toolbar.java | 4 +- .../autopsy/imagegallery/gui/VideoPlayer.java | 27 +- .../gui/drawableviews/DrawableTile.java | 4 +- .../gui/drawableviews/DrawableTileBase.java | 20 +- .../gui/drawableviews/DrawableUIBase.java | 4 +- .../gui/drawableviews/DrawableView.java | 2 +- .../gui/drawableviews/GroupPane.java | 22 +- .../gui/drawableviews/MetaDataPane.java | 6 +- .../gui/drawableviews/SlideShowView.java | 11 +- .../gui/navpanel/GroupComparators.java | 17 +- .../gui/navpanel/GroupListCell.java | 8 +- .../imagegallery/gui/navpanel/GroupTree.java | 9 +- .../gui/navpanel/GroupTreeCell.java | 8 +- .../gui/navpanel/HashHitGroupList.java | 8 +- 52 files changed, 413 insertions(+), 547 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java index ec846c1f36..55d45ac5f5 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java @@ -39,7 +39,7 @@ public class FXMLConstructor { private static Logger logger = Logger.getLogger(FXMLConstructor.class.getName()); static public void construct(Object n, String fxmlFileName) { - final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; //NON-NLS + final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; try { FXMLLoader fxmlLoader = new FXMLLoader(new URL(name)); @@ -53,12 +53,12 @@ public class FXMLConstructor { fxmlLoader.setClassLoader(FXMLLoader.getDefaultClassLoader()); fxmlLoader.load(); } catch (IOException ex) { - String msg = String.format("Failed to load fxml file %s", fxmlFileName); //NON-NLS + String msg = String.format("Failed to load fxml file %s", fxmlFileName); logger.log(Level.SEVERE, msg, ex); } } } catch (MalformedURLException ex) { - String msg = String.format("Malformed URL %s", name); //NON-NLS + String msg = String.format("Malformed URL %s", name); logger.log(Level.SEVERE, msg, ex); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java index 812ace17e9..e2109389fd 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java @@ -72,7 +72,7 @@ public class FileIDSelectionModel { try { fileNodes.add(new FileNode(controller.getSleuthKitCase().getAbstractFileById(id))); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); } } FileNode[] fileNodeArray = fileNodes.stream().toArray(FileNode[]::new); @@ -84,7 +84,7 @@ public class FileIDSelectionModel { try { etc.getExplorerManager().setSelectedNodes(fileNodeArray); } catch (PropertyVetoException ex) { - LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); } }); }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java index 83dc067ac6..4498021484 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java @@ -93,31 +93,31 @@ public enum FileTypeUtils { .collect(Collectors.toList())); //add list of known image extensions imageExtensions.addAll(Arrays.asList( - "bmp" //Bitmap NON-NLS - , "gif" //gif NON-NLS - , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants NON-NLS - , "pbm", "pgm", "ppm" // Portable image format variants NON-NLS - , "png" //portable network graphic NON-NLS - , "tga" //targa NON-NLS - , "psd" //photoshop NON-NLS - , "tif", "tiff" //tiff variants NON-NLS - , "yuv", "ico" //icons NON-NLS - , "ai" //illustrator NON-NLS - , "svg" //scalable vector graphics NON-NLS - , "sn", "ras" //sun raster NON-NLS - , "ico" //windows icons NON-NLS - , "tga" //targa NON-NLS + "bmp" //Bitmap + , "gif" //gif + , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants + , "pbm", "pgm", "ppm" // Portable image format variants + , "png" //portable network graphic + , "tga" //targa + , "psd" //photoshop + , "tif", "tiff" //tiff variants + , "yuv", "ico" //icons + , "ai" //illustrator + , "svg" //scalable vector graphics + , "sn", "ras" //sun raster + , "ico" //windows icons + , "tga" //targa )); //add list of known video extensions - videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", //NON-NLS - "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", //NON-NLS - "rm", "wmv", "mpv", "flv", "swf")); //NON-NLS + videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", + "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", + "rm", "wmv", "mpv", "flv", "swf")); supportedExtensions = Sets.union(imageExtensions, videoExtensions); //add list of mimetypes to count as videos even though they aren't prefixed by video/ - videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); //NON-NLS + videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); supportedMimeTypes.addAll(videoMimeTypes); @@ -128,14 +128,14 @@ public enum FileTypeUtils { * fixed, we should remove application/x-123 from the list of supported * mime types. */ - supportedMimeTypes.addAll(Arrays.asList("application/x-123")); //NON-NLS + supportedMimeTypes.addAll(Arrays.asList("application/x-123")); //add list of mimetypes ImageIO claims to support supportedMimeTypes.addAll(Stream.of(ImageIO.getReaderMIMETypes()) .map(String::toLowerCase) .collect(Collectors.toList())); - supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rarely usefull NON-NLS + supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rarely usefull } public static Set getAllSupportedMimeTypes() { @@ -151,7 +151,7 @@ public enum FileTypeUtils { try { FILE_TYPE_DETECTOR = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); } } return FILE_TYPE_DETECTOR; @@ -196,8 +196,8 @@ public enum FileTypeUtils { return Optional.empty(); } else { mimeType = mimeType.toLowerCase(); - return Optional.of(mimeType.startsWith("image/") //NON-NLS - || mimeType.startsWith("video/") //NON-NLS + return Optional.of(mimeType.startsWith("image/") + || mimeType.startsWith("video/") || supportedMimeTypes.contains(mimeType)); } } @@ -221,11 +221,11 @@ public enum FileTypeUtils { String mimeType = fileTypeDetector.getFileType(file); if (nonNull(mimeType)) { mimeType = mimeType.toLowerCase(); - return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); //NON-NLS + return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); } } } catch (TskCoreException ex) { - LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); //NON-NLS + LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); } return FileTypeUtils.videoExtensions.contains(file.getNameExtension()); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index 34f46d643e..b749c9cdde 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -58,7 +58,6 @@ import org.apache.commons.lang3.StringUtils; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Cancellable; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -290,44 +289,38 @@ public final class ImageGalleryController implements Executor { * aren't, add a blocking progress spinner with appropriate message. */ @ThreadConfined(type = ThreadConfined.ThreadType.JFX) - @NbBundle.Messages({"ImageGalleryController.noGroupsDlg.msg1=No groups are fully analyzed; but listening to ingest is disabled. " + - " No groups will be available until ingest is finished and listening is re-enabled.", - "ImageGalleryController.noGroupsDlg.msg2=No groups are fully analyzed yet, but ingest is still ongoing. Please Wait.", - "ImageGalleryController.noGroupsDlg.msg3=No groups are fully analyzed yet, but image / video data is still being populated. Please Wait.", - "ImageGalleryController.noGroupsDlg.msg4=There are no images/videos available from the added datasources; but listening to ingest is disabled. " + - " No groups will be available until ingest is finished and listening is re-enabled.", - "ImageGalleryController.noGroupsDlg.msg5=There are no images/videos in the added datasources.", - "ImageGalleryController.noGroupsDlg.msg6=There are no fully analyzed groups to display:" + - " the current Group By setting resulted in no groups, " + - "or no groups are fully analyzed but ingest is not running."}) public void checkForGroups() { if (groupManager.getAnalyzedGroups().isEmpty()) { if (IngestManager.getInstance().isIngestRunning()) { if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg1())); + new NoGroupsDialog("No groups are fully analyzed; but listening to ingest is disabled. " + + " No groups will be available until ingest is finished and listening is re-enabled.")); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg2(), + new NoGroupsDialog("No groups are fully analyzed yet, but ingest is still ongoing. Please Wait.", new ProgressIndicator())); } } else if (getFileUpdateQueueSizeProperty().get() > 0) { replaceNotification(fullUIStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg3(), + new NoGroupsDialog("No groups are fully analyzed yet, but image / video data is still being populated. Please Wait.", new ProgressIndicator())); } else if (db != null && db.countAllFiles() <= 0) { // there are no files in db if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg4())); + new NoGroupsDialog("There are no images/videos available from the added datasources; but listening to ingest is disabled. " + + " No groups will be available until ingest is finished and listening is re-enabled.")); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg5())); + new NoGroupsDialog("There are no images/videos in the added datasources.")); } } else if (!groupManager.isRegrouping()) { replaceNotification(centralStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg6())); + new NoGroupsDialog("There are no fully analyzed groups to display:" + + " the current Group By setting resulted in no groups, " + + "or no groups are fully analyzed but ingest is not running.")); } } else { @@ -406,7 +399,7 @@ public final class ImageGalleryController implements Executor { * reset the state of the controller (eg if the case is closed) */ public synchronized void reset() { - LOGGER.info("resetting ImageGalleryControler to initial state."); //NON-NLS + LOGGER.info("resetting ImageGalleryControler to initial state."); selectionModel.clearSelection(); setListeningEnabled(false); ThumbnailCache.getDefault().clearCache(); @@ -443,7 +436,7 @@ public final class ImageGalleryController implements Executor { @Nullable synchronized public DrawableFile getFileFromId(Long fileID) throws TskCoreException { if (Objects.isNull(db)) { - LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); //NON-NLS + LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); return null; } return db.getFileFromID(fileID); @@ -469,7 +462,7 @@ public final class ImageGalleryController implements Executor { */ void onStart() { Platform.setImplicitExit(false); - LOGGER.info("setting up ImageGallery listeners"); //NON-NLS + LOGGER.info("setting up ImageGallery listeners"); //TODO can we do anything usefull in an InjestJobEventListener? //IngestManager.getInstance().addIngestJobEventListener((PropertyChangeEvent evt) -> {}); IngestManager.getInstance().addIngestModuleEventListener(new IngestModuleEventListener()); @@ -553,7 +546,7 @@ public final class ImageGalleryController implements Executor { }); } catch (InterruptedException ex) { - LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); } } } @@ -566,8 +559,6 @@ public final class ImageGalleryController implements Executor { /** * Abstract base class for task to be done on {@link DBWorkerThread} */ - @NbBundle.Messages({"ImageGalleryController.InnerTask.progress.name=progress", - "ImageGalleryController.InnerTask.progress.name=status"}) static public abstract class InnerTask implements Runnable, Cancellable { public double getProgress() { @@ -586,8 +577,8 @@ public final class ImageGalleryController implements Executor { this.message.set(Status); } SimpleObjectProperty state = new SimpleObjectProperty<>(Worker.State.READY); - SimpleDoubleProperty progress = new SimpleDoubleProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); - SimpleStringProperty message = new SimpleStringProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); + SimpleDoubleProperty progress = new SimpleDoubleProperty(this, "pregress"); + SimpleStringProperty message = new SimpleStringProperty(this, "status"); public SimpleDoubleProperty progressProperty() { return progress; @@ -668,7 +659,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); //NON-NLS + Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); } } } @@ -694,7 +685,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); //NON-NLS + Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); } } @@ -708,11 +699,6 @@ public final class ImageGalleryController implements Executor { * adds them to the Drawable DB. Uses the presence of a mimetype as an * approximation to 'analyzed'. */ - @NbBundle.Messages({"CopyAnalyzedFiles.populatingDb.status=populating analyzed image/video database", - "CopyAnalyzedFiles.committingDb.status=commiting image/video database", - "CopyAnalyzedFiles.stopCopy.status=Stopping copy to drawable db task.", - "CopyAnalyzedFiles.errPopulating.errMsg=There was an error populating Image Gallery database.", - ""}) static private class CopyAnalyzedFiles extends InnerTask { private final ImageGalleryController controller; @@ -726,28 +712,28 @@ public final class ImageGalleryController implements Executor { } static private final String FILE_EXTENSION_CLAUSE = - "(name LIKE '%." //NON-NLS - + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") //NON-NLS + "(name LIKE '%." + + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "')"; static private final String MIMETYPE_CLAUSE = - "(mime_type LIKE '" //NON-NLS - + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), "' OR mime_type LIKE '") //NON-NLS + "(mime_type LIKE '" + + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), "' OR mime_type LIKE '") + "') "; static private final String DRAWABLE_QUERY = //grab files with supported extension FILE_EXTENSION_CLAUSE //grab files with supported mime-types - + " OR " + MIMETYPE_CLAUSE //NON-NLS + + " OR " + MIMETYPE_CLAUSE //grab files with image or video mime-types even if we don't officially support them - + " OR mime_type LIKE 'video/%' OR mime_type LIKE 'image/%'"; //NON-NLS - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.CopyAnalyzedFiles_populatingDb_status()); + + " OR mime_type LIKE 'video/%' OR mime_type LIKE 'image/%'"; + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("populating analyzed image/video database"); @Override public void run() { progressHandle.start(); - updateMessage(Bundle.CopyAnalyzedFiles_populatingDb_status()); + updateMessage("populating analyzed image/video database"); try { //grab all files with supported extension or detected mime types @@ -761,7 +747,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "Task cancelled: not all contents may be transfered to drawable database."); //NON-NLS + LOGGER.log(Level.WARNING, "Task cancelled: not all contents may be transfered to drawable database."); progressHandle.finish(); break; } @@ -798,17 +784,17 @@ public final class ImageGalleryController implements Executor { progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle(Bundle.CopyAnalyzedFiles_committingDb_status()); - updateMessage(Bundle.CopyAnalyzedFiles_committingDb_status()); + progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); + updateMessage("commiting image/video database"); updateProgress(1.0); progressHandle.start(); taskDB.commitTransaction(tr, true); } catch (TskCoreException ex) { - progressHandle.progress(Bundle.CopyAnalyzedFiles_stopCopy_status()); - Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); //NON-NLS - MessageNotifyUtil.Notify.warn(Bundle.CopyAnalyzedFiles_errPopulating_errMsg(), ex.getMessage()); + progressHandle.progress("Stopping copy to drawable db task."); + Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); + MessageNotifyUtil.Notify.warn("There was an error populating Image Gallery database.", ex.getMessage()); progressHandle.finish(); updateMessage(""); updateProgress(-1.0); @@ -830,8 +816,6 @@ public final class ImageGalleryController implements Executor { * TODO: create methods to simplify progress value/text updates to both * netbeans and ImageGallery progress/status */ - @NbBundle.Messages({"PrePopulateDataSourceFiles.prepopulatingDb.status=prepopulating image/video database", - "PrePopulateDataSourceFiles.committingDb.status=commiting image/video database"}) private class PrePopulateDataSourceFiles extends InnerTask { private final Content dataSource; @@ -842,9 +826,9 @@ public final class ImageGalleryController implements Executor { * check for supported images */ // (name like '.jpg' or name like '.png' ...) - private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; //NON-NLS + private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.PrePopulateDataSourceFiles_prepopulatingDb_status(), this); + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("prepopulating image/video database", this); /** * @@ -864,10 +848,10 @@ public final class ImageGalleryController implements Executor { @Override public void run() { progressHandle.start(); - updateMessage(Bundle.PrePopulateDataSourceFiles_prepopulatingDb_status()); + updateMessage("prepopulating image/video database"); try { - String fsQuery = "(fs_obj_id IS NULL) "; //default clause NON-NLS + String fsQuery = "(fs_obj_id IS NULL) "; //default clause /* * NOTE: Logical files currently (Apr '15) have a null value for * fs_obj_id in DB. for them, we will not specify a fs_obj_id, @@ -888,10 +872,10 @@ public final class ImageGalleryController implements Executor { //use this clause to only grab files from the newly added filesystems. fsQuery = fileSystems.stream() .map(fileSystem -> String.valueOf(fileSystem.getId())) - .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); //NON-NLS + .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); } - final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); //NON-NLS + final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); progressHandle.switchToDeterminate(files.size()); //do in transaction @@ -899,7 +883,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); //NON-NLS + LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); progressHandle.finish(); break; } @@ -909,13 +893,13 @@ public final class ImageGalleryController implements Executor { } progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle(Bundle.PrePopulateDataSourceFiles_committingDb_status()); + progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); progressHandle.start(); db.commitTransaction(tr, false); } catch (TskCoreException ex) { - Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); //NON-NLS + Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); } progressHandle.finish(); @@ -970,7 +954,7 @@ public final class ImageGalleryController implements Executor { } } catch (TskCoreException ex) { //TODO: What to do here? - LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); throw new RuntimeException(ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java index 770df56132..0a37825f54 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java @@ -22,8 +22,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.apache.commons.lang3.StringUtils; import static org.apache.commons.lang3.StringUtils.isNotBlank; - -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableDB; @@ -32,12 +30,11 @@ import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; /** static definitions and utilities for the ImageGallery module */ -@NbBundle.Messages({"ImageGalleryModule.moduleName=Image Gallery"}) public class ImageGalleryModule { private static final Logger LOGGER = Logger.getLogger(ImageGalleryModule.class.getName()); - private static final String MODULE_NAME = Bundle.ImageGalleryModule_moduleName(); + private static final String MODULE_NAME = "Image Gallery"; static String getModuleName() { return MODULE_NAME; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java index bb44a60ec1..be83d9e236 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java @@ -18,7 +18,6 @@ */ package org.sleuthkit.autopsy.imagegallery; -import java.awt.*; import java.awt.event.ActionEvent; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; @@ -84,17 +83,17 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel { furtherDescriptionArea.setBackground(new java.awt.Color(240, 240, 240)); furtherDescriptionArea.setColumns(20); - furtherDescriptionArea.setFont(furtherDescriptionArea.getFont().deriveFont(Font.PLAIN, 11)); // NOI18N + furtherDescriptionArea.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N furtherDescriptionArea.setLineWrap(true); furtherDescriptionArea.setRows(5); furtherDescriptionArea.setText(NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.furtherDescriptionArea.text")); // NOI18N furtherDescriptionArea.setWrapStyleWord(true); furtherDescriptionArea.setPreferredSize(new java.awt.Dimension(378, 74)); - infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N NON-NLS + infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(infoIconLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.infoIconLabel.text")); // NOI18N - unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N NON-NLS + unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(unavailableDuringInjestLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.unavailableDuringInjestLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java index 51c0b5cb85..5a89b5f257 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java @@ -29,7 +29,7 @@ class ImageGalleryPreferences { private static final Preferences preferences = NbPreferences.forModule(ImageGalleryPreferences.class); /** key for the listening enabled for new cases setting */ - private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; //NON-NLS + private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; /** * Return setting of whether Image Analyzer should be automatically enabled diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java index e927312ee3..d1e8f3a236 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java @@ -68,7 +68,7 @@ import org.sleuthkit.autopsy.imagegallery.gui.navpanel.HashHitGroupList; }) public final class ImageGalleryTopComponent extends TopComponent implements ExplorerManager.Provider, Lookup.Provider { - public final static String PREFERRED_ID = "ImageGalleryTopComponent"; // NON-NLS + public final static String PREFERRED_ID = "ImageGalleryTopComponent"; private static final Logger LOGGER = Logger.getLogger(ImageGalleryTopComponent.class.getName()); private static boolean topComponentInitialized = false; @@ -81,11 +81,11 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl // } // } // timeLineController.openTimeLine(); - final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent(PREFERRED_ID); + final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); if (tc != null) { topComponentInitialized = true; WindowManager.getDefault().isTopComponentFloating(tc); - Mode mode = WindowManager.getDefault().findMode("timeline"); // NON-NLS + Mode mode = WindowManager.getDefault().findMode("timeline"); if (mode != null) { mode.dockInto(tc); } @@ -96,12 +96,12 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl public static void closeTopComponent() { if (topComponentInitialized) { - final TopComponent etc = WindowManager.getDefault().findTopComponent(PREFERRED_ID); + final TopComponent etc = WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); if (etc != null) { try { etc.close(); } catch (Exception e) { - LOGGER.log(Level.SEVERE, "failed to close " + PREFERRED_ID, e); // NON-NLS + LOGGER.log(Level.SEVERE, "failed to close ImageGalleryTopComponent", e); } } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java index 89a40977f3..75a35fc798 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java @@ -37,9 +37,9 @@ import org.sleuthkit.autopsy.coreutils.Logger; */ class PerCaseProperties { - public static final String ENABLED = "enabled"; //NON-NLS + public static final String ENABLED = "enabled"; - public static final String STALE = "stale"; //NON-NLS + public static final String STALE = "stale"; private final Case theCase; @@ -88,7 +88,7 @@ class PerCaseProperties { * @return true if the config exists, false otherwise. */ public synchronized boolean configExists(String moduleName) { - Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); //NON-NLS + Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); return Files.exists(get); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java index a0c962c775..67c4a10dfa 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java @@ -101,7 +101,7 @@ public enum ThumbnailCache { try { return cache.get(file.getId(), () -> load(file)); } catch (UncheckedExecutionException | CacheLoader.InvalidCacheLoadException | ExecutionException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); return null; } } @@ -111,7 +111,7 @@ public enum ThumbnailCache { try { return get(ImageGalleryController.getDefault().getFileFromId(fileID)); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); return null; } } @@ -142,9 +142,9 @@ public enum ThumbnailCache { return cachedThumbnail; } } catch (MalformedURLException ex) { - LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); } catch (IOException ex) { - LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); } } return null; @@ -176,7 +176,7 @@ public enum ThumbnailCache { return Optional.of(ImageUtils.getCachedThumbnailFile(file.getAbstractFile(), MAX_THUMBNAIL_SIZE)); } catch (Exception e) { - LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); return Optional.empty(); } } @@ -193,7 +193,7 @@ public enum ThumbnailCache { try { cache.put(Long.MIN_VALUE, newGetThumbnailTask.get()); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); } } }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java index 92e9a979c2..28a377aade 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java @@ -28,8 +28,6 @@ import javafx.application.Platform; import javafx.scene.control.Alert; import javafx.scene.control.Menu; import javax.swing.SwingWorker; - -import org.openide.util.NbBundle; import org.openide.util.Utilities; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -61,12 +59,8 @@ public class AddDrawableTagAction extends AddTagAction { } @Override - @NbBundle.Messages({"AddDrawableTagAction.displayName.plural=Tag Files", - "AddDrawableTagAction.displayName.singular=Tag File"}) protected String getActionDisplayName() { - return Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1 - ? Bundle.AddDrawableTagAction_displayName_plural() - : Bundle.AddDrawableTagAction_displayName_singular(); + return Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1 ? "Tag Files" : "Tag File"; } @Override @@ -76,8 +70,6 @@ public class AddDrawableTagAction extends AddTagAction { } @Override - @NbBundle.Messages({"# {0} - fileID", - "AddDrawableTagAction.addTagsToFiles.alert=Unable to tag file {0}."}) public void addTagsToFiles(TagName tagName, String comment, Set selectedFiles) { new SwingWorker() { @@ -86,7 +78,7 @@ public class AddDrawableTagAction extends AddTagAction { for (Long fileID : selectedFiles) { try { final DrawableFile file = controller.getFileFromId(fileID); - LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); //NON-NLS + LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); // check if the same tag is being added for the same abstract file. DrawableTagsManager tagsManager = controller.getTagsManager(); @@ -97,16 +89,16 @@ public class AddDrawableTagAction extends AddTagAction { .findAny(); if (duplicateTagName.isPresent()) { - LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS + LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); } else { - LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS + LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); controller.getTagsManager().addContentTag(file, tagName, comment); } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); //NON-NLS + LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); Platform.runLater(() -> { - new Alert(Alert.AlertType.ERROR, Bundle.AddDrawableTagAction_addTagsToFiles_alert(fileID)).show(); + new Alert(Alert.AlertType.ERROR, "Unable to tag file " + fileID + ".").show(); }); } } @@ -119,7 +111,7 @@ public class AddDrawableTagAction extends AddTagAction { try { get(); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); } } }.execute(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java index 7742ec583c..91c2af6503 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java @@ -25,8 +25,6 @@ import javafx.event.ActionEvent; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javax.swing.SwingUtilities; - -import org.openide.util.NbBundle; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.actions.GetTagNameAndCommentDialog; @@ -73,17 +71,13 @@ abstract class AddTagAction { */ // @@@ This user interface has some significant usability issues and needs // to be reworked. - @NbBundle.Messages({"AddTagAction.menuItem.quickTag=Quick Tag", - "AddTagAction.menuItem.noTags=No tags", - "AddTagAction.menuItem.newTag=New Tag...", - "AddTagAction.menuItem.tagAndComment=Tag and Comment..."}) protected class TagMenu extends Menu { TagMenu(ImageGalleryController controller) { super(getActionDisplayName()); // Create a "Quick Tag" sub-menu. - Menu quickTagMenu = new Menu(Bundle.AddTagAction_menuItem_quickTag()); + Menu quickTagMenu = new Menu("Quick Tag"); getItems().add(quickTagMenu); /* @@ -93,7 +87,7 @@ abstract class AddTagAction { */ Collection tagNames = controller.getTagsManager().getNonCategoryTagNames(); if (tagNames.isEmpty()) { - MenuItem empty = new MenuItem(Bundle.AddTagAction_menuItem_noTags()); + MenuItem empty = new MenuItem("No tags"); empty.setDisable(true); quickTagMenu.getItems().add(empty); } else { @@ -111,7 +105,7 @@ abstract class AddTagAction { * Selecting this item initiates a dialog that can be used to create * or select a tag name and adds a tag with the resulting name. */ - MenuItem newTagMenuItem = new MenuItem(Bundle.AddTagAction_menuItem_newTag()); + MenuItem newTagMenuItem = new MenuItem("New Tag..."); newTagMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TagName tagName = GetTagNameDialog.doDialog(getIGWindow()); @@ -128,7 +122,7 @@ abstract class AddTagAction { * name with an optional comment and adds a tag with the resulting * name. */ - MenuItem tagAndCommentItem = new MenuItem(Bundle.AddTagAction_menuItem_tagAndComment()); + MenuItem tagAndCommentItem = new MenuItem("Tag and Comment..."); tagAndCommentItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { GetTagNameAndCommentDialog.TagNameAndComment tagNameAndComment = GetTagNameAndCommentDialog.doDialog(getIGWindow()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java index 1b051e6fb2..4488d94967 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java @@ -24,7 +24,6 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -33,13 +32,12 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm public class Back extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); //NON-NLS + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); private final ImageGalleryController controller; - @NbBundle.Messages({"Back.diplayName=Back"}) public Back(ImageGalleryController controller) { - super(Bundle.Back_displayName()); + super("Back"); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.LEFT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java index 8c819373c8..9d89b4fb1b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java @@ -35,8 +35,6 @@ import javafx.scene.input.KeyCodeCombination; import javax.annotation.Nonnull; import javax.annotation.concurrent.Immutable; import javax.swing.JOptionPane; - -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.Category; @@ -54,7 +52,6 @@ import org.sleuthkit.datamodel.TskCoreException; * TODO: since we are not using actionsGlobalContext anymore and this has * diverged from autopsy action, make this extend from controlsfx Action */ -@NbBundle.Messages({"CategorizeAction.displayName=Categorize"}) public class CategorizeAction extends AddTagAction { private static final Logger LOGGER = Logger.getLogger(CategorizeAction.class.getName()); @@ -74,7 +71,7 @@ public class CategorizeAction extends AddTagAction { @Override protected String getActionDisplayName() { - return Bundle.CategorizeAction_displayName(); + return "Categorize"; } @Override @@ -89,7 +86,7 @@ public class CategorizeAction extends AddTagAction { } public void addTagsToFiles(TagName tagName, String comment, Set selectedFiles, boolean createUndo) { - Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); //NON-NLS + Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); controller.queueDBWorkerTask(new CategorizeTask(selectedFiles, tagName, comment, createUndo)); } @@ -100,7 +97,7 @@ public class CategorizeAction extends AddTagAction { static private class CategoryMenu extends Menu { CategoryMenu(ImageGalleryController controller) { - super(Bundle.CategorizeAction_displayName()); + super("Categorize"); // Each category get an item in the sub-menu. Selecting one of these menu items adds // a tag with the associated category. @@ -117,9 +114,6 @@ public class CategorizeAction extends AddTagAction { } } - @NbBundle.Messages({"# {0} - fileID number", - "CategorizeTask.errorUnable.msg=Unable to categorize {0}.", - "CategorizeTask.errorUnable.title=Categorizing Error"}) private class CategorizeTask extends ImageGalleryController.InnerTask { private final Set fileIDs; @@ -138,7 +132,6 @@ public class CategorizeAction extends AddTagAction { } - @Override public void run() { final DrawableTagsManager tagsManager = controller.getTagsManager(); @@ -164,7 +157,7 @@ public class CategorizeAction extends AddTagAction { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); } }); } else { @@ -177,11 +170,8 @@ public class CategorizeAction extends AddTagAction { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error categorizing result", ex); //NON-NLS - JOptionPane.showMessageDialog(null, - Bundle.CategorizeTask_errorUnable_msg(fileID), - Bundle.CategorizeTask_errorUnable_title(), - JOptionPane.ERROR_MESSAGE); + LOGGER.log(Level.SEVERE, "Error categorizing result", ex); + JOptionPane.showMessageDialog(null, "Unable to categorize " + fileID + ".", "Categorizing Error", JOptionPane.ERROR_MESSAGE); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java index 57f8afa2cf..27ab1cd8b1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java @@ -23,7 +23,6 @@ import java.util.logging.Level; import javafx.event.ActionEvent; import javax.swing.SwingWorker; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; @@ -39,9 +38,8 @@ public class DeleteFollowUpTagAction extends Action { private static final Logger LOGGER = Logger.getLogger(DeleteFollowUpTagAction.class.getName()); - @NbBundle.Messages("DeleteFollwUpTagAction.displayName=Delete Follow Up Tag") public DeleteFollowUpTagAction(final ImageGalleryController controller, final DrawableFile file) { - super(Bundle.DeleteFollwUpTagAction_displayName()); + super("Delete Follow Up Tag"); setEventHandler((ActionEvent t) -> { new SwingWorker() { @@ -59,7 +57,7 @@ public class DeleteFollowUpTagAction extends Action { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); } return null; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java index 1688d6e6d2..c94cfc5ffb 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java @@ -24,22 +24,20 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * */ //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm -@NbBundle.Messages({"Forward.displayName=Forward"}) public class Forward extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); //NON-NLS + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); private final ImageGalleryController controller; public Forward(ImageGalleryController controller) { - super(Bundle.Forward_displayName()); + super("Forward"); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.RIGHT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java index a5e9215a6b..0d446cda84 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java @@ -26,7 +26,6 @@ import javafx.event.ActionEvent; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; @@ -35,17 +34,15 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; * Marks the currently fisplayed group as "seen" and advances to the next unseen * group */ -@NbBundle.Messages({"NextUnseenGroup.markGroupSeen=Mark Group Seen", - "NextUnseenGroup.nextUnseenGroup=Next Unseen group"}) public class NextUnseenGroup extends Action { private static final Image END = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); //NON-NLS + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); private static final Image ADVANCE = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); //NON-NLS + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); - private static final String MARK_GROUP_SEEN = Bundle.NextUnseenGroup_markGroupSeen(); - private static final String NEXT_UNSEEN_GROUP = Bundle.NextUnseenGroup_nextUnseenGroup(); + private static final String MARK_GROUP_SEEN = "Mark Group Seen"; + private static final String NEXT_UNSEEN_GROUP = "Next Unseen group"; private final ImageGalleryController controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java index a758107da5..b1f1f651b7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java @@ -41,14 +41,10 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryTopComponent; @ActionRegistration( // iconBase = "org/sleuthkit/autopsy/imagegallery/images/lightbulb.png", lazy = false, displayName = "#CTL_OpenAction") -@Messages({"CTL_OpenAction=View Images/Videos", - "OpenAction.stale.confDlg.msg=The image / video database may be out of date. " + - "Do you want to update and listen for further ingest results?\n" + - "Choosing 'yes' will update the database and enable listening to future ingests.", - "OpenAction.stale.confDlg.title=Image Gallery"}) +@Messages("CTL_OpenAction=View Images/Videos") public final class OpenAction extends CallableSystemAction { - private static final String VIEW_IMAGES_VIDEOS = Bundle.CTL_OpenAction(); + private static final String VIEW_IMAGES_VIDEOS = "View Images/Videos"; private static final boolean fxInited = Installer.isJavaFxInited(); @@ -87,8 +83,11 @@ public final class OpenAction extends CallableSystemAction { if (ImageGalleryModule.isDrawableDBStale(currentCase)) { //drawable db is stale, ask what to do - int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), Bundle.OpenAction.stale.confDlg.msg(), - Bundle.OpenAction_stale_confDlg.title(), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), "The image / video database may be out of date. " + "Do you want to update and listen for further ingest results?\n" + + "Choosing 'yes' will update the database and enable listening to future ingests." + + " Choosing 'no' will display the out of date results." + + " Choosing 'cancel' will close the image /video gallery", + "Image Gallery", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); switch (answer) { case JOptionPane.YES_OPTION: diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java index 20d6357241..ba33d077ba 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java @@ -32,15 +32,14 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; * Wraps {@link ExternalViewerAction} in a ControlsFX {@link Action} with * appropriate text and graphic */ -@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer", - "OpenExternalViewerAction.displayName=External Viewer"}) +@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer"}) public class OpenExternalViewerAction extends Action { - private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); //NON-NLS + private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); private static final ActionEvent ACTION_EVENT = new ActionEvent(OpenExternalViewerAction.class, ActionEvent.ACTION_PERFORMED, ""); //Swing ActionEvent //NOI18N public OpenExternalViewerAction(DrawableFile file) { - super(Bundle.OpenExternalViewerAction_displayName()); + super("External Viewer"); /** * TODO: why is the name passed to the action? it means we duplicate diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java index 265412146f..a75a786317 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java @@ -44,9 +44,9 @@ public final class OpenHelpAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { try { - Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); //NON-NLS + Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); } catch (IOException ex) { - Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); //NON-NLS + Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); } } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java index 2e0f4d0d9d..e3ce54cd7c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java @@ -23,19 +23,17 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * Action that redoes the last undone command */ -@NbBundle.Messages({"RedoAction.name=Redo"}) public class RedoAction extends Action { - private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); //NON-NLS + private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); public RedoAction(ImageGalleryController controller) { - super(Bundle.RedoAction_name()); + super("Redo"); setGraphic(new ImageView(REDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Y, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().redo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java index 1cc673808f..0285c57bb7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java @@ -23,19 +23,17 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * Action that undoes the last undoable command */ -@NbBundle.Messages({"UndoAction.displayName=Undo"}) public class UndoAction extends Action { - private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); //NON-NLS + private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); public UndoAction(ImageGalleryController controller) { - super(Bundle.UndoAction_displayName()); + super("Undo"); setGraphic(new ImageView(UNDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Z, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().undo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java index 5717828fe7..1567a1b2b4 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java @@ -24,17 +24,10 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import javafx.scene.paint.Color; -import org.openide.util.NbBundle; /** * Enum to represent the six categories in the DHS image categorization scheme. */ -@NbBundle.Messages({"Category.one=CAT-1: Child Exploitation (Illegal)", - "Category.two=CAT-2: Child Exploitation (Non-Illegal/Age Difficult)", - "Category.three=CAT-3: CGI/Animation (Child Exploitive)", - "Category.four=CAT-4: Exemplar/Comparison (Internal Use Only)", - "Category.five=CAT-5: Non-pertinent", - "Category.zero=CAT-0: Uncategorized"}) public enum Category { /* @@ -42,12 +35,12 @@ public enum Category { * preserves the fact that lower category numbers are first/most sever, * except 0 which is last */ - ONE(Color.RED, 1, Bundle.Category_one()), - TWO(Color.ORANGE, 2, Bundle.Category_two()), - THREE(Color.YELLOW, 3, Bundle.Category_three()), - FOUR(Color.BISQUE, 4, Bundle.Category_four()), - FIVE(Color.GREEN, 5, Bundle.Category_five()), - ZERO(Color.LIGHTGREY, 0, Bundle.Category_zero()); + ONE(Color.RED, 1, "CAT-1: Child Exploitation (Illegal)"), + TWO(Color.ORANGE, 2, "CAT-2: Child Exploitation (Non-Illegal/Age Difficult)"), + THREE(Color.YELLOW, 3, "CAT-3: CGI/Animation (Child Exploitive)"), + FOUR(Color.BISQUE, 4, "CAT-4: Exemplar/Comparison (Internal Use Only)"), + FIVE(Color.GREEN, 5, "CAT-5: Non-pertinent"), + ZERO(Color.LIGHTGREY, 0, "CAT-0: Uncategorized"); public static ImmutableList getNonZeroCategories() { return nonZeroCategories; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java index 464c2492b0..d2018d422c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java @@ -68,8 +68,8 @@ public class CategoryManager { * Used to distribute {@link CategoryChangeEvent}s */ private final EventBus categoryEventBus = new AsyncEventBus(Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS - LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); //NON-NLS + new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { + LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); }).build() )); @@ -176,7 +176,7 @@ public class CategoryManager { longAdder.add(db.getCategoryCount(cat)); longAdder.increment(); } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS + LOGGER.log(Level.WARNING, "Case closed while getting files"); } return longAdder; } @@ -210,8 +210,8 @@ public class CategoryManager { try { categoryEventBus.unregister(listener); } catch (IllegalArgumentException e) { - if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { //NON-NLS - LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); //NON-NLS + if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { + LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); } else { throw e; } @@ -254,12 +254,12 @@ public class CategoryManager { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); } } } } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); } Category newCat = CategoryManager.categoryFromTagName(addedTag.getName()); if (newCat != Category.ZERO) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java index 8222c1effe..eb3a7ed64d 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java @@ -27,7 +27,6 @@ import javafx.beans.property.ReadOnlyStringWrapper; import javafx.beans.property.StringProperty; import javafx.scene.image.Image; import org.apache.commons.lang3.StringUtils; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.datamodel.ContentUtils; import org.sleuthkit.datamodel.TagName; @@ -38,37 +37,22 @@ import org.sleuthkit.datamodel.TagName; * TODO: Review and refactor DrawableAttribute related code with an eye to usage * of type paramaters and multivalued attributes */ -@NbBundle.Messages({"DrawableAttribute.md5hash=MD5 Hash", - "DrawableAttribute.name=Name", - "DrawableAttribute.analyzed=Analyzed", - "DrawableAttribute.category=Category", - "DrawableAttribute.tags=Tags", - "DrawableAttribute.path=Path", - "DrawableAttribute.createdTime=Created Time", - "DrawableAttribute.modifiedTime=Modified Time", - "DrawableAttribute.cameraMake=Camera Make", - "DrawableAttribute.cameraModel=Camera Model", - "DrawableAttribute.hashSet=Hashset", - "DrawableAttribute.intObjID=Internal Object ID", - "DrawableAttribute.width=Width", - "DrawableAttribute.height=Height", - "DrawableAttribute.mimeType=MIME type"}) public class DrawableAttribute> { public final static DrawableAttribute MD5_HASH = - new DrawableAttribute<>(AttributeName.MD5_HASH, Bundle.DrawableAttribute_md5hash(), + new DrawableAttribute<>(AttributeName.MD5_HASH, "MD5 Hash", false, - "icon-hashtag.png", // NON-NLS + "icon-hashtag.png", f -> Collections.singleton(f.getMd5Hash())); public final static DrawableAttribute NAME = - new DrawableAttribute<>(AttributeName.NAME, Bundle.DrawableAttribute_name(), + new DrawableAttribute<>(AttributeName.NAME, "Name", true, - "folder-rename.png", //NON-NLS + "folder-rename.png", f -> Collections.singleton(f.getName())); public final static DrawableAttribute ANALYZED = - new DrawableAttribute<>(AttributeName.ANALYZED, Bundle.DrawableAttribute_analyzed(), + new DrawableAttribute<>(AttributeName.ANALYZED, "Analyzed", true, "", f -> Collections.singleton(f.isAnalyzed())); @@ -82,75 +66,75 @@ public class DrawableAttribute> { * advantage. move categories into DrawableDB? */ public final static DrawableAttribute CATEGORY = - new DrawableAttribute<>(AttributeName.CATEGORY, Bundle.DrawableAttribute_category(), + new DrawableAttribute<>(AttributeName.CATEGORY, "Category", false, - "category-icon.png", //NON-NLS + "category-icon.png", f -> Collections.singleton(f.getCategory())); public final static DrawableAttribute TAGS = - new DrawableAttribute<>(AttributeName.TAGS, Bundle.DrawableAttribute_tags(), + new DrawableAttribute<>(AttributeName.TAGS, "Tags", false, - "tag_red.png", //NON-NLS + "tag_red.png", DrawableFile::getTagNames); public final static DrawableAttribute PATH = - new DrawableAttribute<>(AttributeName.PATH, Bundle.DrawableAttribute_path(), + new DrawableAttribute<>(AttributeName.PATH, "Path", true, - "folder_picture.png", //NON-NLS + "folder_picture.png", f -> Collections.singleton(f.getDrawablePath())); public final static DrawableAttribute CREATED_TIME = - new DrawableAttribute<>(AttributeName.CREATED_TIME, Bundle.DrawableAttribute_createdTime(), + new DrawableAttribute<>(AttributeName.CREATED_TIME, "Created Time", true, - "clock--plus.png", //NON-NLS + "clock--plus.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getCrtime(), f))); public final static DrawableAttribute MODIFIED_TIME = - new DrawableAttribute<>(AttributeName.MODIFIED_TIME, Bundle.DrawableAttribute_modifiedTime(), + new DrawableAttribute<>(AttributeName.MODIFIED_TIME, "Modified Time", true, - "clock--pencil.png", //NON-NLS + "clock--pencil.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getMtime(), f))); public final static DrawableAttribute MAKE = - new DrawableAttribute<>(AttributeName.MAKE, Bundle.DrawableAttribute_cameraMake(), + new DrawableAttribute<>(AttributeName.MAKE, "Camera Make", true, - "camera.png", //NON-NLS + "camera.png", f -> Collections.singleton(f.getMake())); public final static DrawableAttribute MODEL = - new DrawableAttribute<>(AttributeName.MODEL, Bundle.DrawableAttribute_cameraModel(), + new DrawableAttribute<>(AttributeName.MODEL, "Camera Model", true, - "camera.png", //NON-NLS + "camera.png", f -> Collections.singleton(f.getModel())); public final static DrawableAttribute HASHSET = - new DrawableAttribute<>(AttributeName.HASHSET, Bundle.DrawableAttribute_hashSet(), + new DrawableAttribute<>(AttributeName.HASHSET, "Hashset", true, - "hashset_hits.png", //NON-NLS + "hashset_hits.png", DrawableFile::getHashSetNamesUnchecked); public final static DrawableAttribute OBJ_ID = - new DrawableAttribute<>(AttributeName.OBJ_ID, Bundle.DrawableAttribute_intObjID(), + new DrawableAttribute<>(AttributeName.OBJ_ID, "Internal Object ID", true, "", f -> Collections.singleton(f.getId())); public final static DrawableAttribute WIDTH = - new DrawableAttribute<>(AttributeName.WIDTH, Bundle.DrawableAttribute_width(), + new DrawableAttribute<>(AttributeName.WIDTH, "Width", false, - "arrow-resize.png", //NON-NLS + "arrow-resize.png", f -> Collections.singleton(f.getWidth())); public final static DrawableAttribute HEIGHT = - new DrawableAttribute<>(AttributeName.HEIGHT, Bundle.DrawableAttribute_height(), + new DrawableAttribute<>(AttributeName.HEIGHT, "Height", false, - "arrow-resize-090.png", //NON-NLS + "arrow-resize-090.png", f -> Collections.singleton(f.getHeight())); public final static DrawableAttribute MIME_TYPE = - new DrawableAttribute<>(AttributeName.MIME_TYPE, Bundle.DrawableAttribute_mimeType(), + new DrawableAttribute<>(AttributeName.MIME_TYPE, "MIME type", false, - "mime_types.png", //NON-NLS + "mime_types.png", f -> Collections.singleton(f.getMIMEType())); final private static List< DrawableAttribute> groupables = @@ -186,7 +170,7 @@ public class DrawableAttribute> { * time they are needed */ if (null == icon && StringUtils.isNotBlank(imageName)) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); } return icon; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java index 079be33ff4..61ef672bc2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java @@ -77,11 +77,11 @@ public final class DrawableDB { private static final org.sleuthkit.autopsy.coreutils.Logger LOGGER = Logger.getLogger(DrawableDB.class.getName()); //column name constants////////////////////// - private static final String ANALYZED = "analyzed"; //NON-NLS + private static final String ANALYZED = "analyzed"; - private static final String OBJ_ID = "obj_id"; //NON-NLS + private static final String OBJ_ID = "obj_id"; - private static final String HASH_SET_NAME = "hash_set_name"; //NON-NLS + private static final String HASH_SET_NAME = "hash_set_name"; private final PreparedStatement insertHashSetStmt; @@ -140,7 +140,7 @@ public final class DrawableDB { try { Class.forName("org.sqlite.JDBC"); } catch (ClassNotFoundException ex) { - LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); } } private final SleuthkitCase tskCase; @@ -201,33 +201,33 @@ public final class DrawableDB { Files.createDirectories(dbPath.getParent()); if (initializeDBSchema()) { updateFileStmt = prepareStatement( - "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS - + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS + "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " + + "VALUES (?,?,?,?,?,?,?,?)"); insertFileStmt = prepareStatement( - "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS - + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS + "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " + + "VALUES (?,?,?,?,?,?,?,?)"); - removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); //NON-NLS + removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); - pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); //NON-NLS - nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); //NON-NLS - created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); //NON-NLS - modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); //NON-NLS - makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); //NON-NLS - modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); //NON-NLS - analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); //NON-NLS - hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); //NON-NLS + pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); + nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); + created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); + modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); + makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); + modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); + analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); + hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); - updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); //NON-NLS - insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); //NON-NLS + updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); + insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); - groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); //NON-NLS + groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); - selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); //NON-NLS - insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); //NON-NLS - selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); //NON-NLS + selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); + insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); + selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); - insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); //NON-NLS + insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); for (Category cat : Category.values()) { insertGroup(cat.getDisplayName(), DrawableAttribute.CATEGORY); @@ -289,12 +289,12 @@ public final class DrawableDB { public static DrawableDB getDrawableDB(Path dbPath, ImageGalleryController controller) { try { - return new DrawableDB(dbPath.resolve("drawable.db"), controller); //NON-NLS + return new DrawableDB(dbPath.resolve("drawable.db"), controller); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); return null; } catch (ExceptionInInitializerError | IOException ex) { - LOGGER.log(Level.SEVERE, "error creating database connection", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "error creating database connection", ex); return null; } } @@ -304,33 +304,33 @@ public final class DrawableDB { //this should match Sleuthkit db setupt try (Statement statement = con.createStatement()) { //reduce i/o operations, we have no OS crash recovery anyway - statement.execute("PRAGMA synchronous = OFF;"); //NON-NLS + statement.execute("PRAGMA synchronous = OFF;"); //allow to query while in transaction - no need read locks - statement.execute("PRAGMA read_uncommitted = True;"); //NON-NLS + statement.execute("PRAGMA read_uncommitted = True;"); //TODO: do we need this? - statement.execute("PRAGMA foreign_keys = ON"); //NON-NLS + statement.execute("PRAGMA foreign_keys = ON"); //TODO: test this - statement.execute("PRAGMA journal_mode = MEMORY"); //NON-NLS + statement.execute("PRAGMA journal_mode = MEMORY"); // //we don't use this feature, so turn it off for minimal speed up on queries //this is deprecated and not recomended - statement.execute("PRAGMA count_changes = OFF;"); //NON-NLS + statement.execute("PRAGMA count_changes = OFF;"); //this made a big difference to query speed - statement.execute("PRAGMA temp_store = MEMORY"); //NON-NLS + statement.execute("PRAGMA temp_store = MEMORY"); //this made a modest improvement in query speeds - statement.execute("PRAGMA cache_size = 50000"); //NON-NLS + statement.execute("PRAGMA cache_size = 50000"); //we never delete anything so... - statement.execute("PRAGMA auto_vacuum = 0"); //NON-NLS + statement.execute("PRAGMA auto_vacuum = 0"); } try { - LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", //NON-NLS + LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", SQLiteJDBCLoader.getVersion(), SQLiteJDBCLoader.isNativeMode() - ? "native" : "pure-java")); //NON-NLS + ? "native" : "pure-java")); } catch (Exception exception) { - LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); //NON-NLS + LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); } } @@ -349,92 +349,92 @@ public final class DrawableDB { setPragmas(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem accessing database", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem accessing database", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists drawable_files " //NON-NLS - + "( obj_id INTEGER PRIMARY KEY, " //NON-NLS - + " path VARCHAR(255), " //NON-NLS - + " name VARCHAR(255), " //NON-NLS - + " created_time integer, " //NON-NLS - + " modified_time integer, " //NON-NLS - + " make VARCHAR(255), " //NON-NLS - + " model VARCHAR(255), " //NON-NLS - + " analyzed integer DEFAULT 0)"; //NON-NLS + String sql = "CREATE TABLE if not exists drawable_files " + + "( obj_id INTEGER PRIMARY KEY, " + + " path VARCHAR(255), " + + " name VARCHAR(255), " + + " created_time integer, " + + " modified_time integer, " + + " make VARCHAR(255), " + + " model VARCHAR(255), " + + " analyzed integer DEFAULT 0)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists groups " //NON-NLS - + "(group_id INTEGER PRIMARY KEY, " //NON-NLS - + " value VARCHAR(255) not null, " //NON-NLS - + " attribute VARCHAR(255) not null, " //NON-NLS - + " seen integer DEFAULT 0, " //NON-NLS - + " UNIQUE(value, attribute) )"; //NON-NLS + String sql = "CREATE TABLE if not exists groups " + + "(group_id INTEGER PRIMARY KEY, " + + " value VARCHAR(255) not null, " + + " attribute VARCHAR(255) not null, " + + " seen integer DEFAULT 0, " + + " UNIQUE(value, attribute) )"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating groups table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating groups table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_sets " //NON-NLS - + "( hash_set_id INTEGER primary key," //NON-NLS - + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; //NON-NLS + String sql = "CREATE TABLE if not exists hash_sets " + + "( hash_set_id INTEGER primary key," + + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_set_hits " //NON-NLS - + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " //NON-NLS - + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " //NON-NLS - + " PRIMARY KEY (hash_set_id, obj_id))"; //NON-NLS + String sql = "CREATE TABLE if not exists hash_set_hits " + + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " + + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " + + " PRIMARY KEY (hash_set_id, obj_id))"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; //NON-NLS + String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating path_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating path_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; //NON-NLS + String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating name_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating name_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; //NON-NLS + String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating make_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating make_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; //NON-NLS + String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating model_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating model_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; //NON-NLS + String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); } return true; @@ -455,7 +455,7 @@ public final class DrawableDB { closeStatements(); con.close(); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); } } con = null; @@ -464,10 +464,10 @@ public final class DrawableDB { public void openDBCon() { try { if (con == null || con.isClosed()) { - con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); //NON-NLS + con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); } } @@ -518,7 +518,7 @@ public final class DrawableDB { names.add(rs.getString(HASH_SET_NAME)); } } catch (SQLException sQLException) { - LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); } finally { dbReadUnlock(); } @@ -533,11 +533,11 @@ public final class DrawableDB { groupSeenQueryStmt.setString(2, groupKey.getAttribute().attrName.toString()); try (ResultSet rs = groupSeenQueryStmt.executeQuery()) { while (rs.next()) { - return rs.getBoolean("seen"); //NON-NLS + return rs.getBoolean("seen"); } } } catch (SQLException ex) { - String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); //NON-NLS + String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -555,7 +555,7 @@ public final class DrawableDB { updateGroupStmt.setString(3, gk.getAttribute().attrName.toString()); updateGroupStmt.execute(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); } finally { dbWriteUnlock(); } @@ -623,7 +623,7 @@ public final class DrawableDB { selectHashSetStmt.setString(1, name); try (ResultSet rs = selectHashSetStmt.executeQuery()) { while (rs.next()) { - int hashsetID = rs.getInt("hash_set_id"); //NON-NLS + int hashsetID = rs.getInt("hash_set_id"); //"insert or ignore into hash_set_hits (hash_set_id, obj_id) values (?,?)"; insertHashHitStmt.setInt(1, hashsetID); insertHashHitStmt.setLong(2, f.getId()); @@ -633,7 +633,7 @@ public final class DrawableDB { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); } //and update all groups this file is in @@ -650,7 +650,7 @@ public final class DrawableDB { // This is one of the places where we get an error if the case is closed during processing, // which doesn't need to be reported here. if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); } } finally { @@ -676,12 +676,12 @@ public final class DrawableDB { public Boolean isFileAnalyzed(long fileId) { dbReadLock(); try (Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { while (analyzedQuery.next()) { return analyzedQuery.getBoolean(ANALYZED); } } catch (SQLException ex) { - String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); //NON-NLS + String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -695,12 +695,12 @@ public final class DrawableDB { dbReadLock(); try (Statement stmt = con.createStatement(); //Can't make this a preprared statement because of the IN ( ... ) - ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { while (analyzedQuery.next()) { return analyzedQuery.getInt(ANALYZED) == fileIds.size(); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); } finally { dbReadUnlock(); } @@ -717,7 +717,7 @@ public final class DrawableDB { // In testing, this method appears to be a lot faster than doing one large select statement for (Long fileID : fileIDsInGroup) { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); while (analyzedQuery.next()) { if (analyzedQuery.getInt(ANALYZED) == 0) { return false; @@ -727,10 +727,10 @@ public final class DrawableDB { } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); //NON-NLS + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); } finally { dbReadUnlock(); } @@ -756,7 +756,7 @@ public final class DrawableDB { dbReadLock(); try { statement = con.createStatement(); - rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); //NON-NLS + rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); while (rs.next()) { ret.add(rs.getLong(1)); } @@ -767,14 +767,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); } } dbReadUnlock(); @@ -808,14 +808,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); } } dbReadUnlock(); @@ -845,14 +845,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); } } dbReadUnlock(); @@ -883,15 +883,15 @@ public final class DrawableDB { default: dbReadLock(); //TODO: convert this to prepared statement - StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); //NON-NLS + StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); String orderByClause = ""; switch (sortBy) { case GROUP_BY_VALUE: - orderByClause = " ORDER BY " + groupBy.attrName.toString(); //NON-NLS + orderByClause = " ORDER BY " + groupBy.attrName.toString(); break; case FILE_COUNT: - orderByClause = " ORDER BY COUNT(*)"; //NON-NLS + orderByClause = " ORDER BY COUNT(*)"; break; case NONE: // case PRIORITY: @@ -905,10 +905,10 @@ public final class DrawableDB { switch (sortOrder) { case DESCENDING: - sortOrderClause = " DESC"; //NON-NLS + sortOrderClause = " DESC"; break; case ASCENDING: - sortOrderClause = " ASC"; //NON-NLS + sortOrderClause = " ASC"; break; default: orderByClause = ""; @@ -930,7 +930,7 @@ public final class DrawableDB { vals.add(value); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); } finally { dbReadUnlock(); } @@ -951,7 +951,7 @@ public final class DrawableDB { } catch (SQLException sQLException) { // Don't need to report it if the case was closed if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); //NON-NLS + LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); } } finally { dbWriteUnlock(); @@ -972,7 +972,7 @@ public final class DrawableDB { AbstractFile f = tskCase.getAbstractFileById(id); return DrawableFile.create(f, analyzed, isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); //NON-NLS + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); return null; } } @@ -991,7 +991,7 @@ public final class DrawableDB { return DrawableFile.create(f, areFilesAnalyzed(Collections.singleton(id)), isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); //NON-NLS + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); return null; } } @@ -1020,7 +1020,7 @@ public final class DrawableDB { } } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); } finally { dbReadUnlock(); } @@ -1042,14 +1042,14 @@ public final class DrawableDB { public int countAllFiles() { int result = -1; dbReadLock(); - try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { //NON-NLS + try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { while (rs.next()) { result = rs.getInt("COUNT"); break; } } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); //NON-NLS + LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); } finally { dbReadUnlock(); } @@ -1081,7 +1081,7 @@ public final class DrawableDB { //TODO: delete from hash_set_hits table also... } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); //NON-NLS + LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); } finally { dbWriteUnlock(); } @@ -1093,7 +1093,7 @@ public final class DrawableDB { public class MultipleTransactionException extends IllegalStateException { - private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; //NON-NLS + private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; public MultipleTransactionException() { super(CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO); @@ -1137,12 +1137,12 @@ public final class DrawableDB { dbReadLock(); try { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); while (analyzedQuery.next()) { addImageFileToList(analyzedQuery.getLong(OBJ_ID)); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); } finally { dbReadUnlock(); } @@ -1194,9 +1194,9 @@ public final class DrawableDB { .count(); } } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS + LOGGER.log(Level.WARNING, "Case closed while getting files"); } catch (TskCoreException ex1) { - LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); } return -1; @@ -1231,15 +1231,15 @@ public final class DrawableDB { //count the fileids that are in the given list and don't have a non-zero category assigned to them. String name = - "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList //NON-NLS - + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; //NON-NLS + "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList + + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(name); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - return resultSet.getLong("count(obj_id)"); //NON-NLS + return resultSet.getLong("count(obj_id)"); } } catch (SQLException | TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error getting category count.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error getting category count.", ex); } return -1; @@ -1274,7 +1274,7 @@ public final class DrawableDB { con.setAutoCommit(false); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); } } @@ -1285,7 +1285,7 @@ public final class DrawableDB { con.rollback(); updatedFiles.clear(); } catch (SQLException ex1) { - LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); //NON-NLS + LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); } finally { close(); } @@ -1307,9 +1307,9 @@ public final class DrawableDB { } } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); } else { - LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); //NON-NLS + LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); } rollback(); } @@ -1322,9 +1322,9 @@ public final class DrawableDB { con.setAutoCommit(true); } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); } else { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); //NON-NLS + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); } } finally { closed = true; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java index 979429b880..14fbf4265c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java @@ -186,9 +186,9 @@ public abstract class DrawableFile extends AbstractFile .map(Tag::getName) .collect(Collectors.toSet()); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); } catch (IllegalStateException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); } return Collections.emptySet(); } @@ -223,7 +223,7 @@ public abstract class DrawableFile extends AbstractFile } } } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); } return ""; } @@ -255,7 +255,7 @@ public abstract class DrawableFile extends AbstractFile .orElse(Category.ZERO) ); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); //NON-NLS + LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); } catch (IllegalStateException ex) { // We get here many times if the case is closed during ingest, so don't print out a ton of warnings. } @@ -333,7 +333,7 @@ public abstract class DrawableFile extends AbstractFile drawablePath = StringUtils.removeEnd(getUniquePath(), getName()); return drawablePath; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); return ""; } } @@ -344,7 +344,7 @@ public abstract class DrawableFile extends AbstractFile try { return getHashSetNames(); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); return Collections.emptySet(); } } @@ -362,7 +362,7 @@ public abstract class DrawableFile extends AbstractFile return this.getUniquePath(); } catch (TskCoreException tskCoreException) { String contentName = this.getName(); - LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N return contentName; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java index cdadb53b94..0d122a6219 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java @@ -28,7 +28,6 @@ import java.util.logging.Level; import java.util.stream.Collectors; import javax.annotation.Nonnull; import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.casemodule.services.TagsManager; @@ -42,12 +41,11 @@ import org.sleuthkit.datamodel.TskCoreException; * Manages Tags, Tagging, and the relationship between Categories and Tags in * the autopsy Db. delegates some, work to the backing {@link TagsManager}. */ -@NbBundle.Messages({"DrawableTagsManager.followUp=Follow Up"}) public class DrawableTagsManager { private static final Logger LOGGER = Logger.getLogger(DrawableTagsManager.class.getName()); - private static final String FOLLOW_UP = Bundle.DrawableTagsManager_followUp(); + private static final String FOLLOW_UP = "Follow Up"; final private Object autopsyTagsManagerLock = new Object(); private TagsManager autopsyTagsManager; @@ -55,8 +53,8 @@ public class DrawableTagsManager { /** Used to distribute {@link TagsChangeEvent}s */ private final EventBus tagsEventBus = new AsyncEventBus( Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS - LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); //NON-NLS + new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { + LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); }).build() )); @@ -149,7 +147,7 @@ public class DrawableTagsManager { .distinct().sorted() .collect(Collectors.toList()); } catch (TskCoreException | IllegalStateException ex) { - LOGGER.log(Level.WARNING, "couldn't access case", ex); //NON-NLS + LOGGER.log(Level.WARNING, "couldn't access case", ex); } return Collections.emptyList(); } @@ -185,7 +183,7 @@ public class DrawableTagsManager { throw new TskCoreException("tagame exists but wasn't found", ex); } } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); throw new TskCoreException("Case was closed out from underneath", ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java index 9b3b3218f1..a04646c310 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java @@ -46,7 +46,7 @@ public class HashSetManager { try { return db.getHashSetsForFile(fileID); } catch (TskCoreException ex) { - Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); //NON-NLS + Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); return Collections.emptySet(); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java index 01e5cfd983..4249fe3c24 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java @@ -46,7 +46,7 @@ public class ImageFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to read image {0}: " + exception.toString(); //NON-NLS + return "Failed to read image {0}: " + exception.toString(); } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java index 1da586f603..20724ef0bc 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java @@ -29,7 +29,6 @@ import javafx.scene.media.Media; import javafx.scene.media.MediaException; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.VideoUtils; @@ -40,7 +39,7 @@ public class VideoFile extends DrawableFile { private static final Logger LOGGER = Logger.getLogger(VideoFile.class.getName()); - private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); //NON-NLS + private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); VideoFile(T file, Boolean analyzed) { super(file, analyzed); @@ -54,7 +53,7 @@ public class VideoFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to get image preview for video {0}: " + exception.toString(); //NON-NLS + return "Failed to get image preview for video {0}: " + exception.toString(); } @Override @@ -64,7 +63,6 @@ public class VideoFile extends DrawableFile { private SoftReference mediaRef; - @NbBundle.Messages({"VideoFile.getMedia.progress=writing temporary file to disk"}) public Media getMedia() throws IOException, MediaException { Media media = (mediaRef != null) ? mediaRef.get() : null; @@ -75,7 +73,7 @@ public class VideoFile extends DrawableFile { if (cacheFile.exists() == false || cacheFile.length() < getAbstractFile().getSize()) { Files.createParentDirs(cacheFile); - ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.VideoFile_getMedia_progress()); + ProgressHandle progressHandle = ProgressHandleFactory.createHandle("writing temporary file to disk"); progressHandle.start(100); ContentUtils.writeToFile(this.getAbstractFile(), cacheFile, progressHandle, null, true); progressHandle.finish(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java index 1b8b7d72c8..f3020830a9 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java @@ -126,7 +126,7 @@ public class DrawableGroup implements Comparable { .filter(Boolean::booleanValue) .count()); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); } } @@ -145,7 +145,7 @@ public class DrawableGroup implements Comparable { uncatCount.set(ImageGalleryController.getDefault().getDatabase().getCategoryCount(Category.ZERO, fileIDs)); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); } } @@ -202,7 +202,7 @@ public class DrawableGroup implements Comparable { @Override public String toString() { - return "Grouping{ keyProp=" + groupKey + '}'; //NON-NLS + return "Grouping{ keyProp=" + groupKey + '}'; } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java index 1073d587da..79cbb1fba2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java @@ -57,7 +57,7 @@ public class GroupKey> implements Comparable @Override public String toString() { - return "GroupKey: " + getAttribute().attrName + " = " + getValue(); //NON-NLS + return "GroupKey: " + getAttribute().attrName + " = " + getValue(); } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java index cebcd6c222..200ef32a16 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java @@ -62,7 +62,6 @@ import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Exceptions; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -196,10 +195,10 @@ public class GroupManager { DrawableFile file = db.getFileFromID(fileID); return getGroupKeysForFile(file); } else { - Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); //NON-NLS + Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); } } catch (TskCoreException ex) { - Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); //NON-NLS + Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); } return Collections.emptySet(); } @@ -348,11 +347,11 @@ public class GroupManager { break; case MIME_TYPE: HashSet types = new HashSet<>(); - try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); //NON-NLS + try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final String mimeType = resultSet.getString("mime_type"); //NON-NLS - String objIds = resultSet.getString("group_concat(obj_id)"); //NON-NLS + final String mimeType = resultSet.getString("mime_type"); + String objIds = resultSet.getString("group_concat(obj_id)"); Pattern.compile(",").splitAsStream(objIds) .map(Long::valueOf) @@ -371,7 +370,7 @@ public class GroupManager { return values; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); //NON-NLS + LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); return Collections.emptyList(); } @@ -417,7 +416,7 @@ public class GroupManager { } } - return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); //NON-NLS + return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); } else { List contentTags = tagsManager.getContentTagsByTagName(tagsManager.getTagName(category)); @@ -429,7 +428,7 @@ public class GroupManager { } } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); throw ex; } } @@ -445,7 +444,7 @@ public class GroupManager { } return files; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); throw ex; } } @@ -532,7 +531,7 @@ public class GroupManager { /** * an executor to submit async ui related background tasks to. */ - final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); //NON-NLS + final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); public ReadOnlyDoubleProperty regroupProgress() { return regroupProgress.getReadOnlyProperty(); @@ -683,7 +682,7 @@ public class GroupManager { return group; } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); } } } @@ -694,13 +693,13 @@ public class GroupManager { HashSet hashSet = new HashSet<>(); String query = (null == mimeType) - ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" //NON-NLS - : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; //NON-NLS + ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" + : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(query); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final long fileID = resultSet.getLong("obj_id"); //NON-NLS + final long fileID = resultSet.getLong("obj_id"); if (db.isInDB(fileID)) { hashSet.add(fileID); } @@ -718,13 +717,6 @@ public class GroupManager { * {@link Groupings} for them */ @SuppressWarnings({"unchecked", "rawtypes"}) - @NbBundle.Messages({"# {0} - groupBy attribute Name", - "# {1} - sortBy name", - "# {2} - sort Order", - "ReGroupTask.displayTitle=regrouping files by {0} sorted by {1} in {2} order", - "# {0} - groupBy attribute Name", - "# {1} - atribute value", - "ReGroupTask.progressUpdate=regrouping files by {0} : {1}"}) private class ReGroupTask> extends LoggedTask { private ProgressHandle groupProgress; @@ -736,7 +728,7 @@ public class GroupManager { private final SortOrder sortOrder; public ReGroupTask(DrawableAttribute groupBy, GroupSortBy sortBy, SortOrder sortOrder) { - super(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), true); + super("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", true); this.groupBy = groupBy; this.sortBy = sortBy; @@ -755,7 +747,7 @@ public class GroupManager { return null; } - groupProgress = ProgressHandleFactory.createHandle(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), this); + groupProgress = ProgressHandleFactory.createHandle("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", this); Platform.runLater(() -> { analyzedGroups.clear(); unSeenGroups.clear(); @@ -773,9 +765,9 @@ public class GroupManager { return null;//abort } p++; - updateMessage(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), val)); + updateMessage("regrouping files by " + groupBy.attrName.toString() + " : " + val); updateProgress(p, vals.size()); - groupProgress.progress(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), val), p); + groupProgress.progress("regrouping files by " + groupBy.attrName.toString() + " : " + val, p); popuplateIfAnalyzed(new GroupKey(groupBy, val), this); } Platform.runLater(() -> FXCollections.sort(analyzedGroups, sortBy.getGrpComparator(sortOrder))); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java index 5d8740b343..53f464dbb0 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java @@ -27,7 +27,6 @@ import javax.swing.SortOrder; import static javax.swing.SortOrder.ASCENDING; import static javax.swing.SortOrder.DESCENDING; import org.apache.commons.lang3.StringUtils; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; @@ -36,17 +35,13 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; * down in Toolbar as well as each enum value having the stategy * ({@link Comparator}) for sorting the groups */ -@NbBundle.Messages({"GroupSortBy.groupSize=Group Size", - "GroupSortBy.groupName=Group Name", - "GroupSortBy.none=None", - "GroupSortBy.priority=Priority"}) public enum GroupSortBy implements ComparatorProvider { /** * sort the groups by the number of files in each sort the groups by the * number of files in each */ - FILE_COUNT(Bundle.GroupSortBy_groupSize(), true, "folder-open-image.png") { //NON-NLS + FILE_COUNT("Group Size", true, "folder-open-image.png") { @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparingInt(DrawableGroup::getSize)); @@ -61,7 +56,7 @@ public enum GroupSortBy implements ComparatorProvider { * sort the groups by the natural order of the grouping value ( eg group * them by path alphabetically ) */ - GROUP_BY_VALUE(Bundle.GroupSortBy_groupName(), true, "folder-rename.png") { //NON-NLS + GROUP_BY_VALUE("Group Name", true, "folder-rename.png") { @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparing(t -> t.getGroupByValueDislpayName())); @@ -76,7 +71,7 @@ public enum GroupSortBy implements ComparatorProvider { * don't sort the groups just use what ever order they come in (ingest * order) */ - NONE(Bundle.GroupSortBy_none(), false, "prohibition.png") { //NON-NLS + NONE("None", false, "prohibition.png") { @Override public Comparator getGrpComparator(SortOrder sortOrder) { return new NoOpComparator<>(); @@ -90,7 +85,7 @@ public enum GroupSortBy implements ComparatorProvider { /** * sort the groups by some priority metric to be determined and implemented */ - PRIORITY(Bundle.GroupSortBy_priority(), false, "hashset_hits.png") { //NON-NLS + PRIORITY("Priority", false, "hashset_hits.png") { @Override public Comparator getGrpComparator(SortOrder sortOrder) { return Comparator.nullsLast(Comparator.comparingDouble(DrawableGroup::getHashHitDensity).thenComparingInt(DrawableGroup::getSize).reversed()); @@ -133,7 +128,7 @@ public enum GroupSortBy implements ComparatorProvider { public Image getIcon() { if (icon == null) { if (StringUtils.isBlank(imageName) == false) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); } } return icon; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java index 872a2afc6b..402694bd07 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java @@ -53,7 +53,7 @@ public class NoGroupsDialog extends GridPane { } private NoGroupsDialog() { - FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); //NON-NLS + FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); } public NoGroupsDialog(String message) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java index 0a0ce0f663..c1d2fe7a7b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java @@ -28,7 +28,6 @@ import javafx.scene.control.Label; import javafx.scene.control.ProgressBar; import javafx.scene.control.Tooltip; import javafx.scene.layout.AnchorPane; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -63,10 +62,6 @@ public class StatusBar extends AnchorPane { private ProgressBar bgTaskProgressBar; @FXML - @NbBundle.Messages({"# {0} - file update queue size", - "StatusBar.fileUpdateTaskLabel.text={0} File Update Tasks", - "StatusBar.bgTaskLabel.text=Regrouping", - "StatuBar.toolTip=Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data."}) void initialize() { assert fileTaskProgresBar != null : "fx:id=\"fileTaskProgresBar\" was not injected: check your FXML file 'StatusBar.fxml'."; assert fileUpdateTaskLabel != null : "fx:id=\"fileUpdateTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'."; @@ -74,7 +69,7 @@ public class StatusBar extends AnchorPane { assert bgTaskLabel != null : "fx:id=\"bgTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'."; assert bgTaskProgressBar != null : "fx:id=\"bgTaskProgressBar\" was not injected: check your FXML file 'StatusBar.fxml'."; - fileUpdateTaskLabel.textProperty().bind(Bundle.StatusBar_fileUpdateTaskLabel_text(controller.getFileUpdateQueueSizeProperty().asString()));//;setText(newSize.toString() + " File Update Tasks"); + fileUpdateTaskLabel.textProperty().bind(controller.getFileUpdateQueueSizeProperty().asString().concat(" File Update Tasks"));//;setText(newSize.toString() + " File Update Tasks"); fileTaskProgresBar.progressProperty().bind(controller.getFileUpdateQueueSizeProperty().negate()); // controller.getFileUpdateQueueSizeProperty().addListener((ov, oldSize, newSize) -> { // Platform.runLater(() -> { @@ -88,7 +83,7 @@ public class StatusBar extends AnchorPane { if(controller.regroupProgress().lessThan(1.0).get()){ // Regrouping in progress bgTaskProgressBar.progressProperty().setValue(-1.0); - bgTaskLabel.setText(Bundle.StatusBar_bgTaskLabel_text()); + bgTaskLabel.setText("Regrouping"); } else{ // Clear the progress bar bgTaskProgressBar.progressProperty().setValue(0.0); @@ -99,14 +94,14 @@ public class StatusBar extends AnchorPane { Platform.runLater(() -> { - staleLabel.setTooltip(new Tooltip(Bundle.StatuBar_toolTip())); + staleLabel.setTooltip(new Tooltip("Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data.")); }); staleLabel.visibleProperty().bind(controller.stale()); } public StatusBar(ImageGalleryController controller) { this.controller = controller; - FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); //NON-NLS + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); fxmlLoader.setRoot(this); fxmlLoader.setController(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java index b9b1c04813..6fe4ce9b44 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java @@ -79,7 +79,7 @@ public class SummaryTablePane extends AnchorPane { public SummaryTablePane(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "SummaryTablePane.fxml"); //NON-NLS + FXMLConstructor.construct(this, "SummaryTablePane.fxml"); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java index 5c68a94436..91ca4a142c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java @@ -142,7 +142,7 @@ public class Toolbar extends ToolBar { try { new TagGroupAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); } }); @@ -213,7 +213,7 @@ public class Toolbar extends ToolBar { private Toolbar(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "Toolbar.fxml"); //NON-NLS + FXMLConstructor.construct(this, "Toolbar.fxml"); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java index 01b0e5dd1b..9b60278865 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java @@ -40,20 +40,19 @@ import javafx.scene.media.MediaView; import javafx.scene.text.Text; import javafx.util.Duration; import javafx.util.StringConverter; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.datamodel.VideoFile; public class VideoPlayer extends BorderPane { - private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); //NON-NLS - private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); //NON-NLS - private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); //NON-NLS - private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); //NON-NLS + private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); + private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); + private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); + private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); - private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); //NON-NLS - private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); //NON-NLS + private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); + private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); private final MediaPlayer mp; @@ -107,8 +106,6 @@ public class VideoPlayer extends BorderPane { private final VideoFile file; @FXML - @NbBundle.Messages({"# {0} - exception type", - "VideoPlayer.errNotice={0}\nSee the logs for details."}) void initialize() { assert controlButton != null : "fx:id=\"controlButton\" was not injected: check your FXML file 'MediaControl.fxml'."; assert timeSlider != null : "fx:id=\"timeSlider\" was not injected: check your FXML file 'MediaControl.fxml'."; @@ -117,14 +114,14 @@ public class VideoPlayer extends BorderPane { final MediaException ex = mp.getError(); if (ex != null) { Platform.runLater(() -> { - Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); //NON-NLS - setCenter(new Text(Bundle.VideoPlayer_errNotice(ex.getType()))); + Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); + setCenter(new Text(ex.getType() + "\nSee the logs for details.")); setBottom(null); }); } }); mp.statusProperty().addListener((observableStatus, oldStatus, newStatus) -> { - Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); //NON-NLS + Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); }); mediaView.setMediaPlayer(mp); mediaView.fitHeightProperty().bind(this.heightProperty().subtract(playControlBar.heightProperty())); @@ -239,7 +236,7 @@ public class VideoPlayer extends BorderPane { public VideoPlayer(MediaPlayer mp, VideoFile file) { this.file = file; this.mp = mp; - FXMLConstructor.construct(this, "MediaControl.fxml"); //NON-NLS + FXMLConstructor.construct(this, "MediaControl.fxml"); } protected void updateTime() { @@ -280,10 +277,10 @@ public class VideoPlayer extends BorderPane { int elapsedSeconds = totalSeconds - elapsedMinutes * 60; if (elapsedHours > 0) { - return String.format("%d:%02d:%02d", elapsedHours, //NON-NLS + return String.format("%d:%02d:%02d", elapsedHours, elapsedMinutes, elapsedSeconds); } else { - return String.format("%02d:%02d", elapsedMinutes, //NON-NLS + return String.format("%02d:%02d", elapsedMinutes, elapsedSeconds); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java index badfc20b92..674aad0260 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java @@ -54,7 +54,7 @@ public class DrawableTile extends DrawableTileBase { try { setEffect(Objects.equals(newValue, getFileID()) ? LAST_SELECTED_EFFECT : null); } catch (java.lang.IllegalStateException ex) { - Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); //NON-NLS + Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); } }; @@ -78,7 +78,7 @@ public class DrawableTile extends DrawableTileBase { public DrawableTile(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "DrawableTile.fxml"); //NON-NLS + FXMLConstructor.construct(this, "DrawableTile.fxml"); } /** diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java index 7cbc9350cb..2058737b3c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java @@ -95,8 +95,8 @@ public abstract class DrawableTileBase extends DrawableUIBase { private static final Border SELECTED_BORDER = new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, new CornerRadii(2), new BorderWidths(3))); //TODO: do this in CSS? -jm - protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); //NON-NLS - protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); //NON-NLS + protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); + protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); protected final FileIDSelectionModel selectionModel; private static ContextMenu contextMenu; @@ -197,8 +197,6 @@ public abstract class DrawableTileBase extends DrawableUIBase { t.consume(); } - @NbBundle.Messages({"DrawableTileBase.menuItem.extractFiles=Extract File(s)", - "DrawableTileBase.menuItem.showContentViewer=Show Content Viewer"}) private ContextMenu buildContextMenu(DrawableFile file) { final ArrayList menuItems = new ArrayList<>(); @@ -206,7 +204,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { menuItems.add(new AddDrawableTagAction(getController()).getPopupMenu()); - final MenuItem extractMenuItem = new MenuItem(Bundle.DrawableTileBase_menuItem_extractFiles()); + final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -215,10 +213,10 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); menuItems.add(extractMenuItem); - MenuItem contentViewer = new MenuItem(Bundle.DrawableTileBase_menuItem_showContentViewer()); + MenuItem contentViewer = new MenuItem("Show Content Viewer"); contentViewer.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { - new NewWindowViewAction(Bundle.DrawableTileBase_menuItem_showContentViewer(), new FileNode(file.getAbstractFile())).actionPerformed(null); + new NewWindowViewAction("Show Content Viewer", new FileNode(file.getAbstractFile())).actionPerformed(null); }); }); menuItems.add(contentViewer); @@ -262,7 +260,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { selectionModel.clearAndSelect(file.getId()); new AddDrawableTagAction(getController()).addTag(getController().getTagsManager().getFollowUpTagName(), ""); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); } } else { new DeleteFollowUpTagAction(getController(), file).handle(event); @@ -278,7 +276,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { return DrawableAttribute.TAGS.getValue(getFile().get()).stream() .anyMatch(followUpTagName::equals); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); return true; } } else { @@ -365,7 +363,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); } }); } @@ -382,7 +380,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { updateFollowUpIcon(); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); } }); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java index 1a6bfd227e..d77eee7f44 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java @@ -102,7 +102,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView try { fileOpt = Optional.ofNullable(getController().getFileFromId(fileIDOpt.get())); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); fileOpt = Optional.empty(); } return fileOpt; @@ -147,7 +147,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView myTask.setOnFailed(failed -> { Throwable exception = myTask.getException(); if (exception instanceof OutOfMemoryError - && exception.getMessage().contains("Java heap space")) { //NON-NLS + && exception.getMessage().contains("Java heap space")) { showErrorNode(Bundle.DrawableUIBase_errorLabel_OOMText(), file); } else { showErrorNode(Bundle.DrawableUIBase_errorLabel_text(), file); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java index 1219e2d1a8..96d30afd93 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java @@ -92,7 +92,7 @@ public interface DrawableView { } catch (NullPointerException ex) { // I think this happens when we're in the process of removing images from the view while // also trying to update it? - Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); //NON-NLS + Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); return false; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java index 7955368a9e..a31001fd2f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java @@ -89,8 +89,6 @@ import javafx.scene.layout.Priority; import javafx.scene.layout.Region; import javafx.scene.paint.Color; import javafx.util.Duration; - -import javax.ejb.MessageDriven; import javax.swing.Action; import javax.swing.SwingUtilities; import org.apache.commons.lang3.StringUtils; @@ -99,7 +97,6 @@ import org.controlsfx.control.GridView; import org.controlsfx.control.SegmentedButton; import org.controlsfx.control.action.ActionUtils; import org.openide.util.Lookup; -import org.openide.util.NbBundle; import org.openide.util.actions.Presenter; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; @@ -276,7 +273,7 @@ public class GroupPane extends BorderPane { undoAction = new UndoAction(controller); redoAction = new RedoAction(controller); - FXMLConstructor.construct(this, "GroupPane.fxml"); //NON-NLS + FXMLConstructor.construct(this, "GroupPane.fxml"); } @ThreadConfined(type = ThreadType.JFX) @@ -333,14 +330,10 @@ public class GroupPane extends BorderPane { /** * create the string to display in the group header */ - @NbBundle.Messages({"# {0} - default group name", - "# {1} - hashset hits count", - "# {2} - group size", - "GroupPane.headerString={0} -- {1} hash set hits / {2} files"}) protected String getHeaderString() { return isNull(getGroup()) ? "" - : Bundle.GroupPane_headerString(StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()), - getGroup().getHashSetHitsCount(), getGroup().getSize()); + : StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()) + " -- " + + getGroup().getHashSetHitsCount() + " hash set hits / " + getGroup().getSize() + " files"; } ContextMenu getContextMenu() { @@ -458,13 +451,13 @@ public class GroupPane extends BorderPane { try { tagSelectedSplitMenu.setText(controller.getTagsManager().getFollowUpTagName().getDisplayName()); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); } tagSelectedSplitMenu.setOnAction(actionEvent -> { try { new TagSelectedFilesAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); } }); @@ -519,7 +512,6 @@ public class GroupPane extends BorderPane { addEventFilter(KeyEvent.KEY_PRESSED, tileKeyboardNavigationHandler); gridView.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler() { - @NbBundle.Messages({"GroupPane.gridViewContextMenuItem.extractFiles=Extract File(s)"}) private ContextMenu buildContextMenu() { ArrayList menuItems = new ArrayList<>(); @@ -536,7 +528,7 @@ public class GroupPane extends BorderPane { } } } - final MenuItem extractMenuItem = new MenuItem(Bundle.GroupPane_gridViewContextMenuItem_extractFiles()); + final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -738,7 +730,7 @@ public class GroupPane extends BorderPane { if (gridView == null || gridView.getSkin() == null) { return Optional.empty(); } - return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); //NON-NLS + return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); } void makeSelection(Boolean shiftDown, Long newFileID) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java index 24e2072aec..32b8b8c71f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java @@ -50,7 +50,6 @@ import javafx.scene.input.KeyEvent; import javafx.scene.layout.Region; import javafx.scene.text.Text; import javafx.util.Pair; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.coreutils.Logger; @@ -85,11 +84,10 @@ public class MetaDataPane extends DrawableUIBase { public MetaDataPane(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "MetaDataPane.fxml"); //NON-NLS + FXMLConstructor.construct(this, "MetaDataPane.fxml"); } @FXML - @NbBundle.Messages({"MetaDataPane.tableView.placeholder=Select a file to show its details here."}) void initialize() { assert attributeColumn != null : "fx:id=\"attributeColumn\" was not injected: check your FXML file 'MetaDataPane.fxml'."; assert imageView != null : "fx:id=\"imageView\" was not injected: check your FXML file 'MetaDataPane.fxml'."; @@ -118,7 +116,7 @@ public class MetaDataPane extends DrawableUIBase { }); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Bundle.MetaDataPane_tableView_placeholder())); + tableView.setPlaceholder(new Label("Select a file to show its details here.")); tableView.getColumns().setAll(Arrays.asList(attributeColumn, valueColumn)); attributeColumn.setPrefWidth(USE_COMPUTED_SIZE); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java index 1818f65521..59d747a655 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java @@ -77,7 +77,7 @@ public class SlideShowView extends DrawableTileBase { SlideShowView(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "SlideShowView.fxml"); //NON-NLS + FXMLConstructor.construct(this, "SlideShowView.fxml"); } @FXML @@ -137,7 +137,7 @@ public class SlideShowView extends DrawableTileBase { }); } catch (NullPointerException ex) { // The case has likely been closed - LOGGER.log(Level.WARNING, "Error accessing groupPane"); //NON-NLS + LOGGER.log(Level.WARNING, "Error accessing groupPane"); } } @@ -278,12 +278,9 @@ public class SlideShowView extends DrawableTileBase { * @return supplemental text to include in the label, specifically: "image x * of y" */ - @NbBundle.Messages({"# {0} - file id number", - "# {1} - number of file ids", - "SlideShowView.supplementalText={0} of {1} in group"}) private String getSupplementalText() { final ObservableList fileIds = getGroupPane().getGroup().getFileIDs(); - return getFileID().map(fileID -> " ( " + Bundle.SlideShowView_supplementalText(fileIds.indexOf(fileID) + 1, fileIds.size()) + " )") + return getFileID().map(fileID -> " ( " + (fileIds.indexOf(fileID) + 1) + " of " + fileIds.size() + " in group )") .orElse(""); } @@ -327,7 +324,7 @@ public class SlideShowView extends DrawableTileBase { final Media media = file.getMedia(); return new VideoPlayer(new MediaPlayer(media), file); } catch (MediaException | IOException | OutOfMemoryError ex) { - LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); return doReadImageTask(file); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java index a5bbb40f49..c7bce311c4 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java @@ -21,34 +21,27 @@ package org.sleuthkit.autopsy.imagegallery.gui.navpanel; import com.google.common.collect.ImmutableList; import java.util.Comparator; import java.util.function.Function; - -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup; /** * */ -@NbBundle.Messages({"GroupComparators.uncategorizedCount=Uncategorized Count", - "GroupComparators.groupName=Group Name", - "GroupComparators.hitCount=Hit Count", - "GroupComparators.groupSize=Group Size", - "GroupComparators.hitDensity=Hit Density"}) final class GroupComparators> implements Comparator { static final GroupComparators UNCATEGORIZED_COUNT = - new GroupComparators<>(Bundle.GroupComparators_uncategorizedCount(), DrawableGroup::getUncategorizedCount, String::valueOf, false); + new GroupComparators<>("Uncategorized Count", DrawableGroup::getUncategorizedCount, String::valueOf, false); static final GroupComparators ALPHABETICAL = - new GroupComparators<>(Bundle.GroupComparators_groupName(), DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); + new GroupComparators<>("Group Name", DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); static final GroupComparators HIT_COUNT = - new GroupComparators<>(Bundle.GroupComparators_hitCount(), DrawableGroup::getHashSetHitsCount, String::valueOf, true); + new GroupComparators<>("Hit Count", DrawableGroup::getHashSetHitsCount, String::valueOf, true); static final GroupComparators FILE_COUNT = - new GroupComparators<>(Bundle.GroupComparators_groupSize(), DrawableGroup::getSize, String::valueOf, true); + new GroupComparators<>("Group Size", DrawableGroup::getSize, String::valueOf, true); static final GroupComparators HIT_FILE_RATIO = - new GroupComparators<>(Bundle.GroupComparators_hitDensity(), DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); //NON-NLS + new GroupComparators<>("Hit Density", DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); private final static ImmutableList> values = ImmutableList.of(UNCATEGORIZED_COUNT, ALPHABETICAL, HIT_COUNT, FILE_COUNT, HIT_FILE_RATIO); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java index 37caa8bd78..6951d67997 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java @@ -42,7 +42,7 @@ class GroupListCell extends ListCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); /** * reference to group files listener that allows us to remove it from a @@ -70,8 +70,8 @@ class GroupListCell extends ListCell { GroupListCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -145,7 +145,7 @@ class GroupListCell extends ListCell { private String getSeenStyleClass() { return Optional.ofNullable(getItem()) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS + .map(seen -> seen ? "" : "-fx-font-weight:bold;") .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java index ffe9df9a51..e371644944 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java @@ -32,8 +32,6 @@ import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; import javafx.scene.image.ImageView; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.util.Beta; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -55,16 +53,15 @@ final public class GroupTree extends NavPanel> { public GroupTree(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS + FXMLConstructor.construct(this, "NavPanel.fxml"); } @FXML @Override - @NbBundle.Messages({"GroupTree.displayName.allGroups=All Groups"}) void initialize() { super.initialize(); - setText(Bundle.GroupTree_displayName_allGroups()); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); //NON-NLS + setText("All Groups"); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); getBorderPane().setCenter(groupTree); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java index a26ec693c7..917aa35084 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java @@ -47,7 +47,7 @@ class GroupTreeCell extends TreeCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); /** * reference to group files listener that allows us to remove it from a @@ -75,8 +75,8 @@ class GroupTreeCell extends TreeCell { GroupTreeCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -161,7 +161,7 @@ class GroupTreeCell extends TreeCell { return Optional.ofNullable(getItem()) .map(GroupTreeNode::getGroup) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS + .map(seen -> seen ? "" : "-fx-font-weight:bold;") .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java index 03c6663369..71f8aa026f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java @@ -24,7 +24,6 @@ import javafx.fxml.FXML; import javafx.scene.control.ListView; import javafx.scene.control.SelectionModel; import javafx.scene.image.ImageView; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -48,7 +47,7 @@ final public class HashHitGroupList extends NavPanel { public HashHitGroupList(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS + FXMLConstructor.construct(this, "NavPanel.fxml"); } @ThreadConfined(type = ThreadConfined.ThreadType.JFX) @@ -69,12 +68,11 @@ final public class HashHitGroupList extends NavPanel { @FXML @Override - @NbBundle.Messages({"HashHitGroupList.displayName.onlyHashHits=Only Hash Hits"}) void initialize() { super.initialize(); - setText(Bundle.HashHitGroupList_displayName_onlyHashHits()); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); //NON-NLS + setText("Only Hash Hits"); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); getBorderPane().setCenter(groupList); sorted = getController().getGroupManager().getAnalyzedGroups().filtered((DrawableGroup t) -> t.getHashSetHitsCount() > 0).sorted(getDefaultComparator()); From 57594e2bdb58878a5e3b13f1c22be211e29c8fb2 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sat, 30 Jan 2016 19:17:40 -0500 Subject: [PATCH 40/48] Factor IngestibleFileFilter util out of IngestTasksScheduler --- .../autopsy/ingest/IngestTasksScheduler.java | 60 +--------- .../autopsy/ingest/IngestibleFileFilter.java | 111 ++++++++++++++++++ 2 files changed, 113 insertions(+), 58 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java index 766891ae86..924b8a9913 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java @@ -395,64 +395,8 @@ final class IngestTasksScheduler { * @return True or false. */ private static boolean shouldEnqueueFileTask(final FileIngestTask task) { - final AbstractFile file = task.getFile(); - - // Skip the task if the file is an unallocated space file and the - // process unallocated space flag is not set for this job. - if (!task.getIngestJob().shouldProcessUnallocatedSpace() - && file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)) { - return false; - } - - // Skip the task if the file is actually the pseudo-file for the parent - // or current directory. - String fileName = file.getName(); - if (fileName.equals(".") || fileName.equals("..")) { - return false; - } - - // Skip the task if the file is one of a select group of special, large - // NTFS or FAT file system files. - if (file instanceof org.sleuthkit.datamodel.File) { - final org.sleuthkit.datamodel.File f = (org.sleuthkit.datamodel.File) file; - - // Get the type of the file system, if any, that owns the file. - TskData.TSK_FS_TYPE_ENUM fsType = TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_UNSUPP; - try { - FileSystem fs = f.getFileSystem(); - if (fs != null) { - fsType = fs.getFsType(); - } - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error querying file system for " + f, ex); //NON-NLS - } - - // If the file system is not NTFS or FAT, don't skip the file. - if ((fsType.getValue() & FAT_NTFS_FLAGS) == 0) { - return true; - } - - // Find out whether the file is in a root directory. - boolean isInRootDir = false; - try { - AbstractFile parent = f.getParentDirectory(); - isInRootDir = parent.isRoot(); - } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Error querying parent directory for" + f.getName(), ex); //NON-NLS - } - - // If the file is in the root directory of an NTFS or FAT file - // system, check its meta-address and check its name for the '$' - // character and a ':' character (not a default attribute). - if (isInRootDir && f.getMetaAddr() < 32) { - String name = f.getName(); - if (name.length() > 0 && name.charAt(0) == '$' && name.contains(":")) { - return false; - } - } - } - - return true; + AbstractFile file = task.getFile(); + return IngestibleFileFilter.isIngestible(task.getFile(), !task.getIngestJob().shouldProcessUnallocatedSpace()); } /** diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java new file mode 100644 index 0000000000..853e4fb294 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java @@ -0,0 +1,111 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2012-2015 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.ingest; + +import java.util.logging.Level; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.datamodel.AbstractFile; +import org.sleuthkit.datamodel.FileSystem; +import org.sleuthkit.datamodel.TskCoreException; +import org.sleuthkit.datamodel.TskData; + +/** + * Utility class for identifying files that should not be ingested: synthesized + * unallocated space files, pseudo-files, and special NTFS or FAT file system + * files. + */ +public class IngestibleFileFilter { + + private static final Logger logger = Logger.getLogger(IngestibleFileFilter.class.getName()); + private static final int FAT_NTFS_FLAGS = TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_FAT12.getValue() | TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_FAT16.getValue() | TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_FAT32.getValue() | TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_NTFS.getValue(); + + /** + * + * @param candidateFile + * @param excludeUnallocSpaceFiles + * + * @return + */ + static boolean isIngestible(AbstractFile candidateFile, boolean excludeUnallocSpaceFiles) { + /* + * Filter out synthesized unallocated space files. + */ + if (excludeUnallocSpaceFiles && candidateFile.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)) { + return false; + } + + /* + * Filter out pseudo-files. + */ + String fileName = candidateFile.getName(); + if (fileName.equals(".") || fileName.equals("..")) { + return false; + } + + if (candidateFile instanceof org.sleuthkit.datamodel.File) { + /* + * Is the file in an NTFS or FAT file system? + */ + org.sleuthkit.datamodel.File file = (org.sleuthkit.datamodel.File) candidateFile; + TskData.TSK_FS_TYPE_ENUM fileSystemType = TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_UNSUPP; + try { + FileSystem fileSystem = file.getFileSystem(); + if (null != fileSystem) { + fileSystemType = fileSystem.getFsType(); + } + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error querying file system for " + file, ex); //NON-NLS + } + if ((fileSystemType.getValue() & FAT_NTFS_FLAGS) == 0) { + return true; + } + + /* + * Is the NTFS or FAT file in the root directory? + */ + boolean isInRootDir = false; + try { + AbstractFile parent = file.getParentDirectory(); + isInRootDir = parent.isRoot(); + } catch (TskCoreException ex) { + logger.log(Level.WARNING, "Error querying parent directory for" + file.getName(), ex); //NON-NLS + } + + /* + * Check its meta-address and check its name for the '$' character + * and a ':' character (not a default attribute). + */ + if (isInRootDir && file.getMetaAddr() < 32) { + String name = file.getName(); + if (name.length() > 0 && name.charAt(0) == '$' && name.contains(":")) { + return false; + } + } + } + + return true; + } + + /** + * Prevents instantiation of this class. + */ + private IngestibleFileFilter() { + } + +} From e7bcd3987b8aaa16c36915f2c938d852ed2e49c6 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sat, 30 Jan 2016 19:39:48 -0500 Subject: [PATCH 41/48] Make IngestibleFileFilter.isIngestible public --- Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java index 853e4fb294..994491375b 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java @@ -42,7 +42,7 @@ public class IngestibleFileFilter { * * @return */ - static boolean isIngestible(AbstractFile candidateFile, boolean excludeUnallocSpaceFiles) { + public static boolean isIngestible(AbstractFile candidateFile, boolean excludeUnallocSpaceFiles) { /* * Filter out synthesized unallocated space files. */ From dc541c5eae5d997dd78051ae8b0e6cb1f8980ad2 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 1 Feb 2016 11:05:01 -0500 Subject: [PATCH 42/48] Clarify a field name in FileUtil --- .../sleuthkit/autopsy/coreutils/FileUtil.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java index 91e12a32ba..4c742acfac 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2012-2015 Basis Technology Corp. + * Copyright 2012-2016 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,7 +31,8 @@ import java.nio.file.Path; public class FileUtil { private static final Logger logger = Logger.getLogger(FileUtil.class.getName()); - private static String TEMP_FILE_PREFIX = "Autopsy"; //NON-NLS + private static final String TEMP_FILE_NAME = "Autopsy"; //NON-NLS + private static final String TEMP_FILE_EXT = null; //NON-NLS /** * Recursively delete all of the files and sub-directories in a directory. @@ -172,16 +173,17 @@ public class FileUtil { } /** - * Test if the current user has read and write access to the path. + * Test if the current user has read and write access to the dirPath. * - * @param path The path to test for read and write access. + * @param dirPath The path to the directory to test for read and write + * access. * * @return True if we have both read and write access, false otherwise. */ - public static boolean hasReadWriteAccess(Path path) { + public static boolean hasReadWriteAccess(Path dirPath) { Path p = null; try { - p = Files.createTempFile(path, TEMP_FILE_PREFIX, null); + p = Files.createTempFile(dirPath, TEMP_FILE_NAME, TEMP_FILE_EXT); return (p.toFile().canRead() && p.toFile().canWrite()); } catch (IOException ex) { return false; @@ -194,4 +196,10 @@ public class FileUtil { } } } + + /** + * Prevents instantiation of this utility class. + */ + private FileUtil() { + } } From ba4aabbdcd9a11ad9fe69ad20cf0511fd3bb3e91 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Mon, 1 Feb 2016 12:26:32 -0500 Subject: [PATCH 43/48] Fixed bundle tags. Removed one empty string tag. Fixed duplicate tag issue. --- .../autopsy/imagegallery/ImageGalleryController.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index 34f46d643e..426764b93b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -567,7 +567,7 @@ public final class ImageGalleryController implements Executor { * Abstract base class for task to be done on {@link DBWorkerThread} */ @NbBundle.Messages({"ImageGalleryController.InnerTask.progress.name=progress", - "ImageGalleryController.InnerTask.progress.name=status"}) + "ImageGalleryController.InnerTask.message.name=status"}) static public abstract class InnerTask implements Runnable, Cancellable { public double getProgress() { @@ -587,7 +587,7 @@ public final class ImageGalleryController implements Executor { } SimpleObjectProperty state = new SimpleObjectProperty<>(Worker.State.READY); SimpleDoubleProperty progress = new SimpleDoubleProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); - SimpleStringProperty message = new SimpleStringProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); + SimpleStringProperty message = new SimpleStringProperty(this, Bundle.ImageGalleryController_InnerTask_message_name()); public SimpleDoubleProperty progressProperty() { return progress; @@ -711,8 +711,7 @@ public final class ImageGalleryController implements Executor { @NbBundle.Messages({"CopyAnalyzedFiles.populatingDb.status=populating analyzed image/video database", "CopyAnalyzedFiles.committingDb.status=commiting image/video database", "CopyAnalyzedFiles.stopCopy.status=Stopping copy to drawable db task.", - "CopyAnalyzedFiles.errPopulating.errMsg=There was an error populating Image Gallery database.", - ""}) + "CopyAnalyzedFiles.errPopulating.errMsg=There was an error populating Image Gallery database."}) static private class CopyAnalyzedFiles extends InnerTask { private final ImageGalleryController controller; From 2a25dab4c65cacf9709d4e09681e1b752ef9fcfa Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 1 Feb 2016 12:49:13 -0500 Subject: [PATCH 44/48] Revert "Revert "1501 ja image gallery - redo 1"" --- .../autopsy/imagegallery/FXMLConstructor.java | 6 +- .../imagegallery/FileIDSelectionModel.java | 4 +- .../autopsy/imagegallery/FileTypeUtils.java | 50 ++-- .../imagegallery/ImageGalleryController.java | 100 ++++--- .../imagegallery/ImageGalleryModule.java | 5 +- .../ImageGalleryOptionsPanel.java | 7 +- .../imagegallery/ImageGalleryPreferences.java | 2 +- .../ImageGalleryTopComponent.java | 10 +- .../imagegallery/PerCaseProperties.java | 6 +- .../autopsy/imagegallery/ThumbnailCache.java | 12 +- .../actions/AddDrawableTagAction.java | 22 +- .../imagegallery/actions/AddTagAction.java | 14 +- .../autopsy/imagegallery/actions/Back.java | 6 +- .../actions/CategorizeAction.java | 22 +- .../actions/DeleteFollowUpTagAction.java | 6 +- .../autopsy/imagegallery/actions/Forward.java | 6 +- .../imagegallery/actions/NextUnseenGroup.java | 11 +- .../imagegallery/actions/OpenAction.java | 15 +- .../actions/OpenExternalViewerAction.java | 7 +- .../imagegallery/actions/OpenHelpAction.java | 4 +- .../imagegallery/actions/RedoAction.java | 6 +- .../imagegallery/actions/UndoAction.java | 6 +- .../imagegallery/datamodel/Category.java | 19 +- .../datamodel/CategoryManager.java | 14 +- .../datamodel/DrawableAttribute.java | 74 +++-- .../imagegallery/datamodel/DrawableDB.java | 254 +++++++++--------- .../imagegallery/datamodel/DrawableFile.java | 14 +- .../datamodel/DrawableTagsManager.java | 12 +- .../datamodel/HashSetManager.java | 2 +- .../imagegallery/datamodel/ImageFile.java | 2 +- .../imagegallery/datamodel/VideoFile.java | 8 +- .../datamodel/grouping/DrawableGroup.java | 6 +- .../datamodel/grouping/GroupKey.java | 2 +- .../datamodel/grouping/GroupManager.java | 44 +-- .../datamodel/grouping/GroupSortBy.java | 15 +- .../imagegallery/gui/NoGroupsDialog.java | 2 +- .../autopsy/imagegallery/gui/StatusBar.java | 13 +- .../imagegallery/gui/SummaryTablePane.java | 2 +- .../autopsy/imagegallery/gui/Toolbar.java | 4 +- .../autopsy/imagegallery/gui/VideoPlayer.java | 27 +- .../gui/drawableviews/DrawableTile.java | 4 +- .../gui/drawableviews/DrawableTileBase.java | 20 +- .../gui/drawableviews/DrawableUIBase.java | 4 +- .../gui/drawableviews/DrawableView.java | 2 +- .../gui/drawableviews/GroupPane.java | 22 +- .../gui/drawableviews/MetaDataPane.java | 6 +- .../gui/drawableviews/SlideShowView.java | 11 +- .../gui/navpanel/GroupComparators.java | 17 +- .../gui/navpanel/GroupListCell.java | 8 +- .../imagegallery/gui/navpanel/GroupTree.java | 9 +- .../gui/navpanel/GroupTreeCell.java | 8 +- .../gui/navpanel/HashHitGroupList.java | 8 +- 52 files changed, 547 insertions(+), 413 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java index 55d45ac5f5..ec846c1f36 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java @@ -39,7 +39,7 @@ public class FXMLConstructor { private static Logger logger = Logger.getLogger(FXMLConstructor.class.getName()); static public void construct(Object n, String fxmlFileName) { - final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; + final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; //NON-NLS try { FXMLLoader fxmlLoader = new FXMLLoader(new URL(name)); @@ -53,12 +53,12 @@ public class FXMLConstructor { fxmlLoader.setClassLoader(FXMLLoader.getDefaultClassLoader()); fxmlLoader.load(); } catch (IOException ex) { - String msg = String.format("Failed to load fxml file %s", fxmlFileName); + String msg = String.format("Failed to load fxml file %s", fxmlFileName); //NON-NLS logger.log(Level.SEVERE, msg, ex); } } } catch (MalformedURLException ex) { - String msg = String.format("Malformed URL %s", name); + String msg = String.format("Malformed URL %s", name); //NON-NLS logger.log(Level.SEVERE, msg, ex); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java index e2109389fd..812ace17e9 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java @@ -72,7 +72,7 @@ public class FileIDSelectionModel { try { fileNodes.add(new FileNode(controller.getSleuthKitCase().getAbstractFileById(id))); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); + LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); //NON-NLS } } FileNode[] fileNodeArray = fileNodes.stream().toArray(FileNode[]::new); @@ -84,7 +84,7 @@ public class FileIDSelectionModel { try { etc.getExplorerManager().setSelectedNodes(fileNodeArray); } catch (PropertyVetoException ex) { - LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); + LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); //NON-NLS } }); }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java index 4498021484..83dc067ac6 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java @@ -93,31 +93,31 @@ public enum FileTypeUtils { .collect(Collectors.toList())); //add list of known image extensions imageExtensions.addAll(Arrays.asList( - "bmp" //Bitmap - , "gif" //gif - , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants - , "pbm", "pgm", "ppm" // Portable image format variants - , "png" //portable network graphic - , "tga" //targa - , "psd" //photoshop - , "tif", "tiff" //tiff variants - , "yuv", "ico" //icons - , "ai" //illustrator - , "svg" //scalable vector graphics - , "sn", "ras" //sun raster - , "ico" //windows icons - , "tga" //targa + "bmp" //Bitmap NON-NLS + , "gif" //gif NON-NLS + , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants NON-NLS + , "pbm", "pgm", "ppm" // Portable image format variants NON-NLS + , "png" //portable network graphic NON-NLS + , "tga" //targa NON-NLS + , "psd" //photoshop NON-NLS + , "tif", "tiff" //tiff variants NON-NLS + , "yuv", "ico" //icons NON-NLS + , "ai" //illustrator NON-NLS + , "svg" //scalable vector graphics NON-NLS + , "sn", "ras" //sun raster NON-NLS + , "ico" //windows icons NON-NLS + , "tga" //targa NON-NLS )); //add list of known video extensions - videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", - "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", - "rm", "wmv", "mpv", "flv", "swf")); + videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", //NON-NLS + "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", //NON-NLS + "rm", "wmv", "mpv", "flv", "swf")); //NON-NLS supportedExtensions = Sets.union(imageExtensions, videoExtensions); //add list of mimetypes to count as videos even though they aren't prefixed by video/ - videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); + videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); //NON-NLS supportedMimeTypes.addAll(videoMimeTypes); @@ -128,14 +128,14 @@ public enum FileTypeUtils { * fixed, we should remove application/x-123 from the list of supported * mime types. */ - supportedMimeTypes.addAll(Arrays.asList("application/x-123")); + supportedMimeTypes.addAll(Arrays.asList("application/x-123")); //NON-NLS //add list of mimetypes ImageIO claims to support supportedMimeTypes.addAll(Stream.of(ImageIO.getReaderMIMETypes()) .map(String::toLowerCase) .collect(Collectors.toList())); - supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rarely usefull + supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rarely usefull NON-NLS } public static Set getAllSupportedMimeTypes() { @@ -151,7 +151,7 @@ public enum FileTypeUtils { try { FILE_TYPE_DETECTOR = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); + LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); //NON-NLS } } return FILE_TYPE_DETECTOR; @@ -196,8 +196,8 @@ public enum FileTypeUtils { return Optional.empty(); } else { mimeType = mimeType.toLowerCase(); - return Optional.of(mimeType.startsWith("image/") - || mimeType.startsWith("video/") + return Optional.of(mimeType.startsWith("image/") //NON-NLS + || mimeType.startsWith("video/") //NON-NLS || supportedMimeTypes.contains(mimeType)); } } @@ -221,11 +221,11 @@ public enum FileTypeUtils { String mimeType = fileTypeDetector.getFileType(file); if (nonNull(mimeType)) { mimeType = mimeType.toLowerCase(); - return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); + return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); //NON-NLS } } } catch (TskCoreException ex) { - LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); + LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); //NON-NLS } return FileTypeUtils.videoExtensions.contains(file.getNameExtension()); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index b749c9cdde..34f46d643e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -58,6 +58,7 @@ import org.apache.commons.lang3.StringUtils; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Cancellable; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -289,38 +290,44 @@ public final class ImageGalleryController implements Executor { * aren't, add a blocking progress spinner with appropriate message. */ @ThreadConfined(type = ThreadConfined.ThreadType.JFX) + @NbBundle.Messages({"ImageGalleryController.noGroupsDlg.msg1=No groups are fully analyzed; but listening to ingest is disabled. " + + " No groups will be available until ingest is finished and listening is re-enabled.", + "ImageGalleryController.noGroupsDlg.msg2=No groups are fully analyzed yet, but ingest is still ongoing. Please Wait.", + "ImageGalleryController.noGroupsDlg.msg3=No groups are fully analyzed yet, but image / video data is still being populated. Please Wait.", + "ImageGalleryController.noGroupsDlg.msg4=There are no images/videos available from the added datasources; but listening to ingest is disabled. " + + " No groups will be available until ingest is finished and listening is re-enabled.", + "ImageGalleryController.noGroupsDlg.msg5=There are no images/videos in the added datasources.", + "ImageGalleryController.noGroupsDlg.msg6=There are no fully analyzed groups to display:" + + " the current Group By setting resulted in no groups, " + + "or no groups are fully analyzed but ingest is not running."}) public void checkForGroups() { if (groupManager.getAnalyzedGroups().isEmpty()) { if (IngestManager.getInstance().isIngestRunning()) { if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog("No groups are fully analyzed; but listening to ingest is disabled. " - + " No groups will be available until ingest is finished and listening is re-enabled.")); + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg1())); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog("No groups are fully analyzed yet, but ingest is still ongoing. Please Wait.", + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg2(), new ProgressIndicator())); } } else if (getFileUpdateQueueSizeProperty().get() > 0) { replaceNotification(fullUIStackPane, - new NoGroupsDialog("No groups are fully analyzed yet, but image / video data is still being populated. Please Wait.", + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg3(), new ProgressIndicator())); } else if (db != null && db.countAllFiles() <= 0) { // there are no files in db if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog("There are no images/videos available from the added datasources; but listening to ingest is disabled. " - + " No groups will be available until ingest is finished and listening is re-enabled.")); + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg4())); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog("There are no images/videos in the added datasources.")); + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg5())); } } else if (!groupManager.isRegrouping()) { replaceNotification(centralStackPane, - new NoGroupsDialog("There are no fully analyzed groups to display:" - + " the current Group By setting resulted in no groups, " - + "or no groups are fully analyzed but ingest is not running.")); + new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg6())); } } else { @@ -399,7 +406,7 @@ public final class ImageGalleryController implements Executor { * reset the state of the controller (eg if the case is closed) */ public synchronized void reset() { - LOGGER.info("resetting ImageGalleryControler to initial state."); + LOGGER.info("resetting ImageGalleryControler to initial state."); //NON-NLS selectionModel.clearSelection(); setListeningEnabled(false); ThumbnailCache.getDefault().clearCache(); @@ -436,7 +443,7 @@ public final class ImageGalleryController implements Executor { @Nullable synchronized public DrawableFile getFileFromId(Long fileID) throws TskCoreException { if (Objects.isNull(db)) { - LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); + LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); //NON-NLS return null; } return db.getFileFromID(fileID); @@ -462,7 +469,7 @@ public final class ImageGalleryController implements Executor { */ void onStart() { Platform.setImplicitExit(false); - LOGGER.info("setting up ImageGallery listeners"); + LOGGER.info("setting up ImageGallery listeners"); //NON-NLS //TODO can we do anything usefull in an InjestJobEventListener? //IngestManager.getInstance().addIngestJobEventListener((PropertyChangeEvent evt) -> {}); IngestManager.getInstance().addIngestModuleEventListener(new IngestModuleEventListener()); @@ -546,7 +553,7 @@ public final class ImageGalleryController implements Executor { }); } catch (InterruptedException ex) { - LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); + LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); //NON-NLS } } } @@ -559,6 +566,8 @@ public final class ImageGalleryController implements Executor { /** * Abstract base class for task to be done on {@link DBWorkerThread} */ + @NbBundle.Messages({"ImageGalleryController.InnerTask.progress.name=progress", + "ImageGalleryController.InnerTask.progress.name=status"}) static public abstract class InnerTask implements Runnable, Cancellable { public double getProgress() { @@ -577,8 +586,8 @@ public final class ImageGalleryController implements Executor { this.message.set(Status); } SimpleObjectProperty state = new SimpleObjectProperty<>(Worker.State.READY); - SimpleDoubleProperty progress = new SimpleDoubleProperty(this, "pregress"); - SimpleStringProperty message = new SimpleStringProperty(this, "status"); + SimpleDoubleProperty progress = new SimpleDoubleProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); + SimpleStringProperty message = new SimpleStringProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); public SimpleDoubleProperty progressProperty() { return progress; @@ -659,7 +668,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); + Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); //NON-NLS } } } @@ -685,7 +694,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); + Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); //NON-NLS } } @@ -699,6 +708,11 @@ public final class ImageGalleryController implements Executor { * adds them to the Drawable DB. Uses the presence of a mimetype as an * approximation to 'analyzed'. */ + @NbBundle.Messages({"CopyAnalyzedFiles.populatingDb.status=populating analyzed image/video database", + "CopyAnalyzedFiles.committingDb.status=commiting image/video database", + "CopyAnalyzedFiles.stopCopy.status=Stopping copy to drawable db task.", + "CopyAnalyzedFiles.errPopulating.errMsg=There was an error populating Image Gallery database.", + ""}) static private class CopyAnalyzedFiles extends InnerTask { private final ImageGalleryController controller; @@ -712,28 +726,28 @@ public final class ImageGalleryController implements Executor { } static private final String FILE_EXTENSION_CLAUSE = - "(name LIKE '%." - + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "(name LIKE '%." //NON-NLS + + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") //NON-NLS + "')"; static private final String MIMETYPE_CLAUSE = - "(mime_type LIKE '" - + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), "' OR mime_type LIKE '") + "(mime_type LIKE '" //NON-NLS + + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), "' OR mime_type LIKE '") //NON-NLS + "') "; static private final String DRAWABLE_QUERY = //grab files with supported extension FILE_EXTENSION_CLAUSE //grab files with supported mime-types - + " OR " + MIMETYPE_CLAUSE + + " OR " + MIMETYPE_CLAUSE //NON-NLS //grab files with image or video mime-types even if we don't officially support them - + " OR mime_type LIKE 'video/%' OR mime_type LIKE 'image/%'"; - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("populating analyzed image/video database"); + + " OR mime_type LIKE 'video/%' OR mime_type LIKE 'image/%'"; //NON-NLS + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.CopyAnalyzedFiles_populatingDb_status()); @Override public void run() { progressHandle.start(); - updateMessage("populating analyzed image/video database"); + updateMessage(Bundle.CopyAnalyzedFiles_populatingDb_status()); try { //grab all files with supported extension or detected mime types @@ -747,7 +761,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "Task cancelled: not all contents may be transfered to drawable database."); + LOGGER.log(Level.WARNING, "Task cancelled: not all contents may be transfered to drawable database."); //NON-NLS progressHandle.finish(); break; } @@ -784,17 +798,17 @@ public final class ImageGalleryController implements Executor { progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); - updateMessage("commiting image/video database"); + progressHandle = ProgressHandleFactory.createHandle(Bundle.CopyAnalyzedFiles_committingDb_status()); + updateMessage(Bundle.CopyAnalyzedFiles_committingDb_status()); updateProgress(1.0); progressHandle.start(); taskDB.commitTransaction(tr, true); } catch (TskCoreException ex) { - progressHandle.progress("Stopping copy to drawable db task."); - Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); - MessageNotifyUtil.Notify.warn("There was an error populating Image Gallery database.", ex.getMessage()); + progressHandle.progress(Bundle.CopyAnalyzedFiles_stopCopy_status()); + Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); //NON-NLS + MessageNotifyUtil.Notify.warn(Bundle.CopyAnalyzedFiles_errPopulating_errMsg(), ex.getMessage()); progressHandle.finish(); updateMessage(""); updateProgress(-1.0); @@ -816,6 +830,8 @@ public final class ImageGalleryController implements Executor { * TODO: create methods to simplify progress value/text updates to both * netbeans and ImageGallery progress/status */ + @NbBundle.Messages({"PrePopulateDataSourceFiles.prepopulatingDb.status=prepopulating image/video database", + "PrePopulateDataSourceFiles.committingDb.status=commiting image/video database"}) private class PrePopulateDataSourceFiles extends InnerTask { private final Content dataSource; @@ -826,9 +842,9 @@ public final class ImageGalleryController implements Executor { * check for supported images */ // (name like '.jpg' or name like '.png' ...) - private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; + private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; //NON-NLS - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("prepopulating image/video database", this); + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.PrePopulateDataSourceFiles_prepopulatingDb_status(), this); /** * @@ -848,10 +864,10 @@ public final class ImageGalleryController implements Executor { @Override public void run() { progressHandle.start(); - updateMessage("prepopulating image/video database"); + updateMessage(Bundle.PrePopulateDataSourceFiles_prepopulatingDb_status()); try { - String fsQuery = "(fs_obj_id IS NULL) "; //default clause + String fsQuery = "(fs_obj_id IS NULL) "; //default clause NON-NLS /* * NOTE: Logical files currently (Apr '15) have a null value for * fs_obj_id in DB. for them, we will not specify a fs_obj_id, @@ -872,10 +888,10 @@ public final class ImageGalleryController implements Executor { //use this clause to only grab files from the newly added filesystems. fsQuery = fileSystems.stream() .map(fileSystem -> String.valueOf(fileSystem.getId())) - .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); + .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); //NON-NLS } - final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); + final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); //NON-NLS progressHandle.switchToDeterminate(files.size()); //do in transaction @@ -883,7 +899,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); + LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); //NON-NLS progressHandle.finish(); break; } @@ -893,13 +909,13 @@ public final class ImageGalleryController implements Executor { } progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); + progressHandle = ProgressHandleFactory.createHandle(Bundle.PrePopulateDataSourceFiles_committingDb_status()); progressHandle.start(); db.commitTransaction(tr, false); } catch (TskCoreException ex) { - Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); + Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); //NON-NLS } progressHandle.finish(); @@ -954,7 +970,7 @@ public final class ImageGalleryController implements Executor { } } catch (TskCoreException ex) { //TODO: What to do here? - LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); + LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); //NON-NLS throw new RuntimeException(ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java index 0a37825f54..770df56132 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java @@ -22,6 +22,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.apache.commons.lang3.StringUtils; import static org.apache.commons.lang3.StringUtils.isNotBlank; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableDB; @@ -30,11 +32,12 @@ import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; /** static definitions and utilities for the ImageGallery module */ +@NbBundle.Messages({"ImageGalleryModule.moduleName=Image Gallery"}) public class ImageGalleryModule { private static final Logger LOGGER = Logger.getLogger(ImageGalleryModule.class.getName()); - private static final String MODULE_NAME = "Image Gallery"; + private static final String MODULE_NAME = Bundle.ImageGalleryModule_moduleName(); static String getModuleName() { return MODULE_NAME; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java index be83d9e236..bb44a60ec1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.imagegallery; +import java.awt.*; import java.awt.event.ActionEvent; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; @@ -83,17 +84,17 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel { furtherDescriptionArea.setBackground(new java.awt.Color(240, 240, 240)); furtherDescriptionArea.setColumns(20); - furtherDescriptionArea.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N + furtherDescriptionArea.setFont(furtherDescriptionArea.getFont().deriveFont(Font.PLAIN, 11)); // NOI18N furtherDescriptionArea.setLineWrap(true); furtherDescriptionArea.setRows(5); furtherDescriptionArea.setText(NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.furtherDescriptionArea.text")); // NOI18N furtherDescriptionArea.setWrapStyleWord(true); furtherDescriptionArea.setPreferredSize(new java.awt.Dimension(378, 74)); - infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N + infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(infoIconLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.infoIconLabel.text")); // NOI18N - unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N + unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(unavailableDuringInjestLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.unavailableDuringInjestLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java index 5a89b5f257..51c0b5cb85 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java @@ -29,7 +29,7 @@ class ImageGalleryPreferences { private static final Preferences preferences = NbPreferences.forModule(ImageGalleryPreferences.class); /** key for the listening enabled for new cases setting */ - private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; + private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; //NON-NLS /** * Return setting of whether Image Analyzer should be automatically enabled diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java index d1e8f3a236..e927312ee3 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java @@ -68,7 +68,7 @@ import org.sleuthkit.autopsy.imagegallery.gui.navpanel.HashHitGroupList; }) public final class ImageGalleryTopComponent extends TopComponent implements ExplorerManager.Provider, Lookup.Provider { - public final static String PREFERRED_ID = "ImageGalleryTopComponent"; + public final static String PREFERRED_ID = "ImageGalleryTopComponent"; // NON-NLS private static final Logger LOGGER = Logger.getLogger(ImageGalleryTopComponent.class.getName()); private static boolean topComponentInitialized = false; @@ -81,11 +81,11 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl // } // } // timeLineController.openTimeLine(); - final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); + final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent(PREFERRED_ID); if (tc != null) { topComponentInitialized = true; WindowManager.getDefault().isTopComponentFloating(tc); - Mode mode = WindowManager.getDefault().findMode("timeline"); + Mode mode = WindowManager.getDefault().findMode("timeline"); // NON-NLS if (mode != null) { mode.dockInto(tc); } @@ -96,12 +96,12 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl public static void closeTopComponent() { if (topComponentInitialized) { - final TopComponent etc = WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); + final TopComponent etc = WindowManager.getDefault().findTopComponent(PREFERRED_ID); if (etc != null) { try { etc.close(); } catch (Exception e) { - LOGGER.log(Level.SEVERE, "failed to close ImageGalleryTopComponent", e); + LOGGER.log(Level.SEVERE, "failed to close " + PREFERRED_ID, e); // NON-NLS } } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java index 75a35fc798..89a40977f3 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java @@ -37,9 +37,9 @@ import org.sleuthkit.autopsy.coreutils.Logger; */ class PerCaseProperties { - public static final String ENABLED = "enabled"; + public static final String ENABLED = "enabled"; //NON-NLS - public static final String STALE = "stale"; + public static final String STALE = "stale"; //NON-NLS private final Case theCase; @@ -88,7 +88,7 @@ class PerCaseProperties { * @return true if the config exists, false otherwise. */ public synchronized boolean configExists(String moduleName) { - Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); + Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); //NON-NLS return Files.exists(get); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java index 67c4a10dfa..a0c962c775 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java @@ -101,7 +101,7 @@ public enum ThumbnailCache { try { return cache.get(file.getId(), () -> load(file)); } catch (UncheckedExecutionException | CacheLoader.InvalidCacheLoadException | ExecutionException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); //NON-NLS return null; } } @@ -111,7 +111,7 @@ public enum ThumbnailCache { try { return get(ImageGalleryController.getDefault().getFileFromId(fileID)); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); //NON-NLS return null; } } @@ -142,9 +142,9 @@ public enum ThumbnailCache { return cachedThumbnail; } } catch (MalformedURLException ex) { - LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); + LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); //NON-NLS } catch (IOException ex) { - LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); + LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); //NON-NLS } } return null; @@ -176,7 +176,7 @@ public enum ThumbnailCache { return Optional.of(ImageUtils.getCachedThumbnailFile(file.getAbstractFile(), MAX_THUMBNAIL_SIZE)); } catch (Exception e) { - LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); + LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); //NON-NLS return Optional.empty(); } } @@ -193,7 +193,7 @@ public enum ThumbnailCache { try { cache.put(Long.MIN_VALUE, newGetThumbnailTask.get()); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); + LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); //NON-NLS } } }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java index 28a377aade..92e9a979c2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java @@ -28,6 +28,8 @@ import javafx.application.Platform; import javafx.scene.control.Alert; import javafx.scene.control.Menu; import javax.swing.SwingWorker; + +import org.openide.util.NbBundle; import org.openide.util.Utilities; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -59,8 +61,12 @@ public class AddDrawableTagAction extends AddTagAction { } @Override + @NbBundle.Messages({"AddDrawableTagAction.displayName.plural=Tag Files", + "AddDrawableTagAction.displayName.singular=Tag File"}) protected String getActionDisplayName() { - return Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1 ? "Tag Files" : "Tag File"; + return Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1 + ? Bundle.AddDrawableTagAction_displayName_plural() + : Bundle.AddDrawableTagAction_displayName_singular(); } @Override @@ -70,6 +76,8 @@ public class AddDrawableTagAction extends AddTagAction { } @Override + @NbBundle.Messages({"# {0} - fileID", + "AddDrawableTagAction.addTagsToFiles.alert=Unable to tag file {0}."}) public void addTagsToFiles(TagName tagName, String comment, Set selectedFiles) { new SwingWorker() { @@ -78,7 +86,7 @@ public class AddDrawableTagAction extends AddTagAction { for (Long fileID : selectedFiles) { try { final DrawableFile file = controller.getFileFromId(fileID); - LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); + LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); //NON-NLS // check if the same tag is being added for the same abstract file. DrawableTagsManager tagsManager = controller.getTagsManager(); @@ -89,16 +97,16 @@ public class AddDrawableTagAction extends AddTagAction { .findAny(); if (duplicateTagName.isPresent()) { - LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); + LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS } else { - LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); + LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS controller.getTagsManager().addContentTag(file, tagName, comment); } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); + LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); //NON-NLS Platform.runLater(() -> { - new Alert(Alert.AlertType.ERROR, "Unable to tag file " + fileID + ".").show(); + new Alert(Alert.AlertType.ERROR, Bundle.AddDrawableTagAction_addTagsToFiles_alert(fileID)).show(); }); } } @@ -111,7 +119,7 @@ public class AddDrawableTagAction extends AddTagAction { try { get(); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); + LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); //NON-NLS } } }.execute(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java index 91c2af6503..7742ec583c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java @@ -25,6 +25,8 @@ import javafx.event.ActionEvent; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javax.swing.SwingUtilities; + +import org.openide.util.NbBundle; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.actions.GetTagNameAndCommentDialog; @@ -71,13 +73,17 @@ abstract class AddTagAction { */ // @@@ This user interface has some significant usability issues and needs // to be reworked. + @NbBundle.Messages({"AddTagAction.menuItem.quickTag=Quick Tag", + "AddTagAction.menuItem.noTags=No tags", + "AddTagAction.menuItem.newTag=New Tag...", + "AddTagAction.menuItem.tagAndComment=Tag and Comment..."}) protected class TagMenu extends Menu { TagMenu(ImageGalleryController controller) { super(getActionDisplayName()); // Create a "Quick Tag" sub-menu. - Menu quickTagMenu = new Menu("Quick Tag"); + Menu quickTagMenu = new Menu(Bundle.AddTagAction_menuItem_quickTag()); getItems().add(quickTagMenu); /* @@ -87,7 +93,7 @@ abstract class AddTagAction { */ Collection tagNames = controller.getTagsManager().getNonCategoryTagNames(); if (tagNames.isEmpty()) { - MenuItem empty = new MenuItem("No tags"); + MenuItem empty = new MenuItem(Bundle.AddTagAction_menuItem_noTags()); empty.setDisable(true); quickTagMenu.getItems().add(empty); } else { @@ -105,7 +111,7 @@ abstract class AddTagAction { * Selecting this item initiates a dialog that can be used to create * or select a tag name and adds a tag with the resulting name. */ - MenuItem newTagMenuItem = new MenuItem("New Tag..."); + MenuItem newTagMenuItem = new MenuItem(Bundle.AddTagAction_menuItem_newTag()); newTagMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TagName tagName = GetTagNameDialog.doDialog(getIGWindow()); @@ -122,7 +128,7 @@ abstract class AddTagAction { * name with an optional comment and adds a tag with the resulting * name. */ - MenuItem tagAndCommentItem = new MenuItem("Tag and Comment..."); + MenuItem tagAndCommentItem = new MenuItem(Bundle.AddTagAction_menuItem_tagAndComment()); tagAndCommentItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { GetTagNameAndCommentDialog.TagNameAndComment tagNameAndComment = GetTagNameAndCommentDialog.doDialog(getIGWindow()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java index 4488d94967..1b051e6fb2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java @@ -24,6 +24,7 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -32,12 +33,13 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm public class Back extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); //NON-NLS private final ImageGalleryController controller; + @NbBundle.Messages({"Back.diplayName=Back"}) public Back(ImageGalleryController controller) { - super("Back"); + super(Bundle.Back_displayName()); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.LEFT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java index 9d89b4fb1b..8c819373c8 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java @@ -35,6 +35,8 @@ import javafx.scene.input.KeyCodeCombination; import javax.annotation.Nonnull; import javax.annotation.concurrent.Immutable; import javax.swing.JOptionPane; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.Category; @@ -52,6 +54,7 @@ import org.sleuthkit.datamodel.TskCoreException; * TODO: since we are not using actionsGlobalContext anymore and this has * diverged from autopsy action, make this extend from controlsfx Action */ +@NbBundle.Messages({"CategorizeAction.displayName=Categorize"}) public class CategorizeAction extends AddTagAction { private static final Logger LOGGER = Logger.getLogger(CategorizeAction.class.getName()); @@ -71,7 +74,7 @@ public class CategorizeAction extends AddTagAction { @Override protected String getActionDisplayName() { - return "Categorize"; + return Bundle.CategorizeAction_displayName(); } @Override @@ -86,7 +89,7 @@ public class CategorizeAction extends AddTagAction { } public void addTagsToFiles(TagName tagName, String comment, Set selectedFiles, boolean createUndo) { - Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); + Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); //NON-NLS controller.queueDBWorkerTask(new CategorizeTask(selectedFiles, tagName, comment, createUndo)); } @@ -97,7 +100,7 @@ public class CategorizeAction extends AddTagAction { static private class CategoryMenu extends Menu { CategoryMenu(ImageGalleryController controller) { - super("Categorize"); + super(Bundle.CategorizeAction_displayName()); // Each category get an item in the sub-menu. Selecting one of these menu items adds // a tag with the associated category. @@ -114,6 +117,9 @@ public class CategorizeAction extends AddTagAction { } } + @NbBundle.Messages({"# {0} - fileID number", + "CategorizeTask.errorUnable.msg=Unable to categorize {0}.", + "CategorizeTask.errorUnable.title=Categorizing Error"}) private class CategorizeTask extends ImageGalleryController.InnerTask { private final Set fileIDs; @@ -132,6 +138,7 @@ public class CategorizeAction extends AddTagAction { } + @Override public void run() { final DrawableTagsManager tagsManager = controller.getTagsManager(); @@ -157,7 +164,7 @@ public class CategorizeAction extends AddTagAction { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); + LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); //NON-NLS } }); } else { @@ -170,8 +177,11 @@ public class CategorizeAction extends AddTagAction { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error categorizing result", ex); - JOptionPane.showMessageDialog(null, "Unable to categorize " + fileID + ".", "Categorizing Error", JOptionPane.ERROR_MESSAGE); + LOGGER.log(Level.SEVERE, "Error categorizing result", ex); //NON-NLS + JOptionPane.showMessageDialog(null, + Bundle.CategorizeTask_errorUnable_msg(fileID), + Bundle.CategorizeTask_errorUnable_title(), + JOptionPane.ERROR_MESSAGE); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java index 27ab1cd8b1..57f8afa2cf 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java @@ -23,6 +23,7 @@ import java.util.logging.Level; import javafx.event.ActionEvent; import javax.swing.SwingWorker; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; @@ -38,8 +39,9 @@ public class DeleteFollowUpTagAction extends Action { private static final Logger LOGGER = Logger.getLogger(DeleteFollowUpTagAction.class.getName()); + @NbBundle.Messages("DeleteFollwUpTagAction.displayName=Delete Follow Up Tag") public DeleteFollowUpTagAction(final ImageGalleryController controller, final DrawableFile file) { - super("Delete Follow Up Tag"); + super(Bundle.DeleteFollwUpTagAction_displayName()); setEventHandler((ActionEvent t) -> { new SwingWorker() { @@ -57,7 +59,7 @@ public class DeleteFollowUpTagAction extends Action { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); + LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); //NON-NLS } return null; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java index c94cfc5ffb..1688d6e6d2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java @@ -24,20 +24,22 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * */ //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm +@NbBundle.Messages({"Forward.displayName=Forward"}) public class Forward extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); //NON-NLS private final ImageGalleryController controller; public Forward(ImageGalleryController controller) { - super("Forward"); + super(Bundle.Forward_displayName()); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.RIGHT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java index 0d446cda84..a5e9215a6b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java @@ -26,6 +26,7 @@ import javafx.event.ActionEvent; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; @@ -34,15 +35,17 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; * Marks the currently fisplayed group as "seen" and advances to the next unseen * group */ +@NbBundle.Messages({"NextUnseenGroup.markGroupSeen=Mark Group Seen", + "NextUnseenGroup.nextUnseenGroup=Next Unseen group"}) public class NextUnseenGroup extends Action { private static final Image END = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); //NON-NLS private static final Image ADVANCE = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); //NON-NLS - private static final String MARK_GROUP_SEEN = "Mark Group Seen"; - private static final String NEXT_UNSEEN_GROUP = "Next Unseen group"; + private static final String MARK_GROUP_SEEN = Bundle.NextUnseenGroup_markGroupSeen(); + private static final String NEXT_UNSEEN_GROUP = Bundle.NextUnseenGroup_nextUnseenGroup(); private final ImageGalleryController controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java index b1f1f651b7..a758107da5 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java @@ -41,10 +41,14 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryTopComponent; @ActionRegistration( // iconBase = "org/sleuthkit/autopsy/imagegallery/images/lightbulb.png", lazy = false, displayName = "#CTL_OpenAction") -@Messages("CTL_OpenAction=View Images/Videos") +@Messages({"CTL_OpenAction=View Images/Videos", + "OpenAction.stale.confDlg.msg=The image / video database may be out of date. " + + "Do you want to update and listen for further ingest results?\n" + + "Choosing 'yes' will update the database and enable listening to future ingests.", + "OpenAction.stale.confDlg.title=Image Gallery"}) public final class OpenAction extends CallableSystemAction { - private static final String VIEW_IMAGES_VIDEOS = "View Images/Videos"; + private static final String VIEW_IMAGES_VIDEOS = Bundle.CTL_OpenAction(); private static final boolean fxInited = Installer.isJavaFxInited(); @@ -83,11 +87,8 @@ public final class OpenAction extends CallableSystemAction { if (ImageGalleryModule.isDrawableDBStale(currentCase)) { //drawable db is stale, ask what to do - int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), "The image / video database may be out of date. " + "Do you want to update and listen for further ingest results?\n" - + "Choosing 'yes' will update the database and enable listening to future ingests." - + " Choosing 'no' will display the out of date results." - + " Choosing 'cancel' will close the image /video gallery", - "Image Gallery", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), Bundle.OpenAction.stale.confDlg.msg(), + Bundle.OpenAction_stale_confDlg.title(), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); switch (answer) { case JOptionPane.YES_OPTION: diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java index ba33d077ba..20d6357241 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java @@ -32,14 +32,15 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; * Wraps {@link ExternalViewerAction} in a ControlsFX {@link Action} with * appropriate text and graphic */ -@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer"}) +@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer", + "OpenExternalViewerAction.displayName=External Viewer"}) public class OpenExternalViewerAction extends Action { - private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); + private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); //NON-NLS private static final ActionEvent ACTION_EVENT = new ActionEvent(OpenExternalViewerAction.class, ActionEvent.ACTION_PERFORMED, ""); //Swing ActionEvent //NOI18N public OpenExternalViewerAction(DrawableFile file) { - super("External Viewer"); + super(Bundle.OpenExternalViewerAction_displayName()); /** * TODO: why is the name passed to the action? it means we duplicate diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java index a75a786317..265412146f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java @@ -44,9 +44,9 @@ public final class OpenHelpAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { try { - Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); + Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); //NON-NLS } catch (IOException ex) { - Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); + Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); //NON-NLS } } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java index e3ce54cd7c..2e0f4d0d9d 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java @@ -23,17 +23,19 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * Action that redoes the last undone command */ +@NbBundle.Messages({"RedoAction.name=Redo"}) public class RedoAction extends Action { - private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); + private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); //NON-NLS public RedoAction(ImageGalleryController controller) { - super("Redo"); + super(Bundle.RedoAction_name()); setGraphic(new ImageView(REDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Y, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().redo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java index 0285c57bb7..1cc673808f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java @@ -23,17 +23,19 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * Action that undoes the last undoable command */ +@NbBundle.Messages({"UndoAction.displayName=Undo"}) public class UndoAction extends Action { - private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); + private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); //NON-NLS public UndoAction(ImageGalleryController controller) { - super("Undo"); + super(Bundle.UndoAction_displayName()); setGraphic(new ImageView(UNDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Z, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().undo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java index 1567a1b2b4..5717828fe7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java @@ -24,10 +24,17 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import javafx.scene.paint.Color; +import org.openide.util.NbBundle; /** * Enum to represent the six categories in the DHS image categorization scheme. */ +@NbBundle.Messages({"Category.one=CAT-1: Child Exploitation (Illegal)", + "Category.two=CAT-2: Child Exploitation (Non-Illegal/Age Difficult)", + "Category.three=CAT-3: CGI/Animation (Child Exploitive)", + "Category.four=CAT-4: Exemplar/Comparison (Internal Use Only)", + "Category.five=CAT-5: Non-pertinent", + "Category.zero=CAT-0: Uncategorized"}) public enum Category { /* @@ -35,12 +42,12 @@ public enum Category { * preserves the fact that lower category numbers are first/most sever, * except 0 which is last */ - ONE(Color.RED, 1, "CAT-1: Child Exploitation (Illegal)"), - TWO(Color.ORANGE, 2, "CAT-2: Child Exploitation (Non-Illegal/Age Difficult)"), - THREE(Color.YELLOW, 3, "CAT-3: CGI/Animation (Child Exploitive)"), - FOUR(Color.BISQUE, 4, "CAT-4: Exemplar/Comparison (Internal Use Only)"), - FIVE(Color.GREEN, 5, "CAT-5: Non-pertinent"), - ZERO(Color.LIGHTGREY, 0, "CAT-0: Uncategorized"); + ONE(Color.RED, 1, Bundle.Category_one()), + TWO(Color.ORANGE, 2, Bundle.Category_two()), + THREE(Color.YELLOW, 3, Bundle.Category_three()), + FOUR(Color.BISQUE, 4, Bundle.Category_four()), + FIVE(Color.GREEN, 5, Bundle.Category_five()), + ZERO(Color.LIGHTGREY, 0, Bundle.Category_zero()); public static ImmutableList getNonZeroCategories() { return nonZeroCategories; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java index d2018d422c..464c2492b0 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java @@ -68,8 +68,8 @@ public class CategoryManager { * Used to distribute {@link CategoryChangeEvent}s */ private final EventBus categoryEventBus = new AsyncEventBus(Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { - LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); + new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS + LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); //NON-NLS }).build() )); @@ -176,7 +176,7 @@ public class CategoryManager { longAdder.add(db.getCategoryCount(cat)); longAdder.increment(); } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); + LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS } return longAdder; } @@ -210,8 +210,8 @@ public class CategoryManager { try { categoryEventBus.unregister(listener); } catch (IllegalArgumentException e) { - if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { - LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); + if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { //NON-NLS + LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); //NON-NLS } else { throw e; } @@ -254,12 +254,12 @@ public class CategoryManager { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); + LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); //NON-NLS } } } } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); + LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); //NON-NLS } Category newCat = CategoryManager.categoryFromTagName(addedTag.getName()); if (newCat != Category.ZERO) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java index eb3a7ed64d..8222c1effe 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java @@ -27,6 +27,7 @@ import javafx.beans.property.ReadOnlyStringWrapper; import javafx.beans.property.StringProperty; import javafx.scene.image.Image; import org.apache.commons.lang3.StringUtils; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.datamodel.ContentUtils; import org.sleuthkit.datamodel.TagName; @@ -37,22 +38,37 @@ import org.sleuthkit.datamodel.TagName; * TODO: Review and refactor DrawableAttribute related code with an eye to usage * of type paramaters and multivalued attributes */ +@NbBundle.Messages({"DrawableAttribute.md5hash=MD5 Hash", + "DrawableAttribute.name=Name", + "DrawableAttribute.analyzed=Analyzed", + "DrawableAttribute.category=Category", + "DrawableAttribute.tags=Tags", + "DrawableAttribute.path=Path", + "DrawableAttribute.createdTime=Created Time", + "DrawableAttribute.modifiedTime=Modified Time", + "DrawableAttribute.cameraMake=Camera Make", + "DrawableAttribute.cameraModel=Camera Model", + "DrawableAttribute.hashSet=Hashset", + "DrawableAttribute.intObjID=Internal Object ID", + "DrawableAttribute.width=Width", + "DrawableAttribute.height=Height", + "DrawableAttribute.mimeType=MIME type"}) public class DrawableAttribute> { public final static DrawableAttribute MD5_HASH = - new DrawableAttribute<>(AttributeName.MD5_HASH, "MD5 Hash", + new DrawableAttribute<>(AttributeName.MD5_HASH, Bundle.DrawableAttribute_md5hash(), false, - "icon-hashtag.png", + "icon-hashtag.png", // NON-NLS f -> Collections.singleton(f.getMd5Hash())); public final static DrawableAttribute NAME = - new DrawableAttribute<>(AttributeName.NAME, "Name", + new DrawableAttribute<>(AttributeName.NAME, Bundle.DrawableAttribute_name(), true, - "folder-rename.png", + "folder-rename.png", //NON-NLS f -> Collections.singleton(f.getName())); public final static DrawableAttribute ANALYZED = - new DrawableAttribute<>(AttributeName.ANALYZED, "Analyzed", + new DrawableAttribute<>(AttributeName.ANALYZED, Bundle.DrawableAttribute_analyzed(), true, "", f -> Collections.singleton(f.isAnalyzed())); @@ -66,75 +82,75 @@ public class DrawableAttribute> { * advantage. move categories into DrawableDB? */ public final static DrawableAttribute CATEGORY = - new DrawableAttribute<>(AttributeName.CATEGORY, "Category", + new DrawableAttribute<>(AttributeName.CATEGORY, Bundle.DrawableAttribute_category(), false, - "category-icon.png", + "category-icon.png", //NON-NLS f -> Collections.singleton(f.getCategory())); public final static DrawableAttribute TAGS = - new DrawableAttribute<>(AttributeName.TAGS, "Tags", + new DrawableAttribute<>(AttributeName.TAGS, Bundle.DrawableAttribute_tags(), false, - "tag_red.png", + "tag_red.png", //NON-NLS DrawableFile::getTagNames); public final static DrawableAttribute PATH = - new DrawableAttribute<>(AttributeName.PATH, "Path", + new DrawableAttribute<>(AttributeName.PATH, Bundle.DrawableAttribute_path(), true, - "folder_picture.png", + "folder_picture.png", //NON-NLS f -> Collections.singleton(f.getDrawablePath())); public final static DrawableAttribute CREATED_TIME = - new DrawableAttribute<>(AttributeName.CREATED_TIME, "Created Time", + new DrawableAttribute<>(AttributeName.CREATED_TIME, Bundle.DrawableAttribute_createdTime(), true, - "clock--plus.png", + "clock--plus.png", //NON-NLS f -> Collections.singleton(ContentUtils.getStringTime(f.getCrtime(), f))); public final static DrawableAttribute MODIFIED_TIME = - new DrawableAttribute<>(AttributeName.MODIFIED_TIME, "Modified Time", + new DrawableAttribute<>(AttributeName.MODIFIED_TIME, Bundle.DrawableAttribute_modifiedTime(), true, - "clock--pencil.png", + "clock--pencil.png", //NON-NLS f -> Collections.singleton(ContentUtils.getStringTime(f.getMtime(), f))); public final static DrawableAttribute MAKE = - new DrawableAttribute<>(AttributeName.MAKE, "Camera Make", + new DrawableAttribute<>(AttributeName.MAKE, Bundle.DrawableAttribute_cameraMake(), true, - "camera.png", + "camera.png", //NON-NLS f -> Collections.singleton(f.getMake())); public final static DrawableAttribute MODEL = - new DrawableAttribute<>(AttributeName.MODEL, "Camera Model", + new DrawableAttribute<>(AttributeName.MODEL, Bundle.DrawableAttribute_cameraModel(), true, - "camera.png", + "camera.png", //NON-NLS f -> Collections.singleton(f.getModel())); public final static DrawableAttribute HASHSET = - new DrawableAttribute<>(AttributeName.HASHSET, "Hashset", + new DrawableAttribute<>(AttributeName.HASHSET, Bundle.DrawableAttribute_hashSet(), true, - "hashset_hits.png", + "hashset_hits.png", //NON-NLS DrawableFile::getHashSetNamesUnchecked); public final static DrawableAttribute OBJ_ID = - new DrawableAttribute<>(AttributeName.OBJ_ID, "Internal Object ID", + new DrawableAttribute<>(AttributeName.OBJ_ID, Bundle.DrawableAttribute_intObjID(), true, "", f -> Collections.singleton(f.getId())); public final static DrawableAttribute WIDTH = - new DrawableAttribute<>(AttributeName.WIDTH, "Width", + new DrawableAttribute<>(AttributeName.WIDTH, Bundle.DrawableAttribute_width(), false, - "arrow-resize.png", + "arrow-resize.png", //NON-NLS f -> Collections.singleton(f.getWidth())); public final static DrawableAttribute HEIGHT = - new DrawableAttribute<>(AttributeName.HEIGHT, "Height", + new DrawableAttribute<>(AttributeName.HEIGHT, Bundle.DrawableAttribute_height(), false, - "arrow-resize-090.png", + "arrow-resize-090.png", //NON-NLS f -> Collections.singleton(f.getHeight())); public final static DrawableAttribute MIME_TYPE = - new DrawableAttribute<>(AttributeName.MIME_TYPE, "MIME type", + new DrawableAttribute<>(AttributeName.MIME_TYPE, Bundle.DrawableAttribute_mimeType(), false, - "mime_types.png", + "mime_types.png", //NON-NLS f -> Collections.singleton(f.getMIMEType())); final private static List< DrawableAttribute> groupables = @@ -170,7 +186,7 @@ public class DrawableAttribute> { * time they are needed */ if (null == icon && StringUtils.isNotBlank(imageName)) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS } return icon; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java index 61ef672bc2..079be33ff4 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java @@ -77,11 +77,11 @@ public final class DrawableDB { private static final org.sleuthkit.autopsy.coreutils.Logger LOGGER = Logger.getLogger(DrawableDB.class.getName()); //column name constants////////////////////// - private static final String ANALYZED = "analyzed"; + private static final String ANALYZED = "analyzed"; //NON-NLS - private static final String OBJ_ID = "obj_id"; + private static final String OBJ_ID = "obj_id"; //NON-NLS - private static final String HASH_SET_NAME = "hash_set_name"; + private static final String HASH_SET_NAME = "hash_set_name"; //NON-NLS private final PreparedStatement insertHashSetStmt; @@ -140,7 +140,7 @@ public final class DrawableDB { try { Class.forName("org.sqlite.JDBC"); } catch (ClassNotFoundException ex) { - LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); + LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); //NON-NLS } } private final SleuthkitCase tskCase; @@ -201,33 +201,33 @@ public final class DrawableDB { Files.createDirectories(dbPath.getParent()); if (initializeDBSchema()) { updateFileStmt = prepareStatement( - "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " - + "VALUES (?,?,?,?,?,?,?,?)"); + "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS + + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS insertFileStmt = prepareStatement( - "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " - + "VALUES (?,?,?,?,?,?,?,?)"); + "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS + + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS - removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); + removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); //NON-NLS - pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); - nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); - created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); - modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); - makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); - modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); - analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); - hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); + pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); //NON-NLS + nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); //NON-NLS + created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); //NON-NLS + modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); //NON-NLS + makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); //NON-NLS + modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); //NON-NLS + analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); //NON-NLS + hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); //NON-NLS - updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); - insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); + updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); //NON-NLS + insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); //NON-NLS - groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); + groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); //NON-NLS - selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); - insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); - selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); + selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); //NON-NLS + insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); //NON-NLS + selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); //NON-NLS - insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); + insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); //NON-NLS for (Category cat : Category.values()) { insertGroup(cat.getDisplayName(), DrawableAttribute.CATEGORY); @@ -289,12 +289,12 @@ public final class DrawableDB { public static DrawableDB getDrawableDB(Path dbPath, ImageGalleryController controller) { try { - return new DrawableDB(dbPath.resolve("drawable.db"), controller); + return new DrawableDB(dbPath.resolve("drawable.db"), controller); //NON-NLS } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); + LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); //NON-NLS return null; } catch (ExceptionInInitializerError | IOException ex) { - LOGGER.log(Level.SEVERE, "error creating database connection", ex); + LOGGER.log(Level.SEVERE, "error creating database connection", ex); //NON-NLS return null; } } @@ -304,33 +304,33 @@ public final class DrawableDB { //this should match Sleuthkit db setupt try (Statement statement = con.createStatement()) { //reduce i/o operations, we have no OS crash recovery anyway - statement.execute("PRAGMA synchronous = OFF;"); + statement.execute("PRAGMA synchronous = OFF;"); //NON-NLS //allow to query while in transaction - no need read locks - statement.execute("PRAGMA read_uncommitted = True;"); + statement.execute("PRAGMA read_uncommitted = True;"); //NON-NLS //TODO: do we need this? - statement.execute("PRAGMA foreign_keys = ON"); + statement.execute("PRAGMA foreign_keys = ON"); //NON-NLS //TODO: test this - statement.execute("PRAGMA journal_mode = MEMORY"); + statement.execute("PRAGMA journal_mode = MEMORY"); //NON-NLS // //we don't use this feature, so turn it off for minimal speed up on queries //this is deprecated and not recomended - statement.execute("PRAGMA count_changes = OFF;"); + statement.execute("PRAGMA count_changes = OFF;"); //NON-NLS //this made a big difference to query speed - statement.execute("PRAGMA temp_store = MEMORY"); + statement.execute("PRAGMA temp_store = MEMORY"); //NON-NLS //this made a modest improvement in query speeds - statement.execute("PRAGMA cache_size = 50000"); + statement.execute("PRAGMA cache_size = 50000"); //NON-NLS //we never delete anything so... - statement.execute("PRAGMA auto_vacuum = 0"); + statement.execute("PRAGMA auto_vacuum = 0"); //NON-NLS } try { - LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", + LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", //NON-NLS SQLiteJDBCLoader.getVersion(), SQLiteJDBCLoader.isNativeMode() - ? "native" : "pure-java")); + ? "native" : "pure-java")); //NON-NLS } catch (Exception exception) { - LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); + LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); //NON-NLS } } @@ -349,92 +349,92 @@ public final class DrawableDB { setPragmas(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem accessing database", ex); + LOGGER.log(Level.SEVERE, "problem accessing database", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists drawable_files " - + "( obj_id INTEGER PRIMARY KEY, " - + " path VARCHAR(255), " - + " name VARCHAR(255), " - + " created_time integer, " - + " modified_time integer, " - + " make VARCHAR(255), " - + " model VARCHAR(255), " - + " analyzed integer DEFAULT 0)"; + String sql = "CREATE TABLE if not exists drawable_files " //NON-NLS + + "( obj_id INTEGER PRIMARY KEY, " //NON-NLS + + " path VARCHAR(255), " //NON-NLS + + " name VARCHAR(255), " //NON-NLS + + " created_time integer, " //NON-NLS + + " modified_time integer, " //NON-NLS + + " make VARCHAR(255), " //NON-NLS + + " model VARCHAR(255), " //NON-NLS + + " analyzed integer DEFAULT 0)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); + LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists groups " - + "(group_id INTEGER PRIMARY KEY, " - + " value VARCHAR(255) not null, " - + " attribute VARCHAR(255) not null, " - + " seen integer DEFAULT 0, " - + " UNIQUE(value, attribute) )"; + String sql = "CREATE TABLE if not exists groups " //NON-NLS + + "(group_id INTEGER PRIMARY KEY, " //NON-NLS + + " value VARCHAR(255) not null, " //NON-NLS + + " attribute VARCHAR(255) not null, " //NON-NLS + + " seen integer DEFAULT 0, " //NON-NLS + + " UNIQUE(value, attribute) )"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating groups table", ex); + LOGGER.log(Level.SEVERE, "problem creating groups table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_sets " - + "( hash_set_id INTEGER primary key," - + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; + String sql = "CREATE TABLE if not exists hash_sets " //NON-NLS + + "( hash_set_id INTEGER primary key," //NON-NLS + + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); + LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_set_hits " - + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " - + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " - + " PRIMARY KEY (hash_set_id, obj_id))"; + String sql = "CREATE TABLE if not exists hash_set_hits " //NON-NLS + + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " //NON-NLS + + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " //NON-NLS + + " PRIMARY KEY (hash_set_id, obj_id))"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); + LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); //NON-NLS return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; + String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating path_idx", ex); + LOGGER.log(Level.WARNING, "problem creating path_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; + String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating name_idx", ex); + LOGGER.log(Level.WARNING, "problem creating name_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; + String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating make_idx", ex); + LOGGER.log(Level.WARNING, "problem creating make_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; + String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating model_idx", ex); + LOGGER.log(Level.WARNING, "problem creating model_idx", ex); //NON-NLS } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; + String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; //NON-NLS stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); + LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); //NON-NLS } return true; @@ -455,7 +455,7 @@ public final class DrawableDB { closeStatements(); con.close(); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); + LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); //NON-NLS } } con = null; @@ -464,10 +464,10 @@ public final class DrawableDB { public void openDBCon() { try { if (con == null || con.isClosed()) { - con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); + con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); //NON-NLS } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); + LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); //NON-NLS } } @@ -518,7 +518,7 @@ public final class DrawableDB { names.add(rs.getString(HASH_SET_NAME)); } } catch (SQLException sQLException) { - LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); + LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); //NON-NLS } finally { dbReadUnlock(); } @@ -533,11 +533,11 @@ public final class DrawableDB { groupSeenQueryStmt.setString(2, groupKey.getAttribute().attrName.toString()); try (ResultSet rs = groupSeenQueryStmt.executeQuery()) { while (rs.next()) { - return rs.getBoolean("seen"); + return rs.getBoolean("seen"); //NON-NLS } } } catch (SQLException ex) { - String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); + String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); //NON-NLS LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -555,7 +555,7 @@ public final class DrawableDB { updateGroupStmt.setString(3, gk.getAttribute().attrName.toString()); updateGroupStmt.execute(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); + LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); //NON-NLS } finally { dbWriteUnlock(); } @@ -623,7 +623,7 @@ public final class DrawableDB { selectHashSetStmt.setString(1, name); try (ResultSet rs = selectHashSetStmt.executeQuery()) { while (rs.next()) { - int hashsetID = rs.getInt("hash_set_id"); + int hashsetID = rs.getInt("hash_set_id"); //NON-NLS //"insert or ignore into hash_set_hits (hash_set_id, obj_id) values (?,?)"; insertHashHitStmt.setInt(1, hashsetID); insertHashHitStmt.setLong(2, f.getId()); @@ -633,7 +633,7 @@ public final class DrawableDB { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); + LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); //NON-NLS } //and update all groups this file is in @@ -650,7 +650,7 @@ public final class DrawableDB { // This is one of the places where we get an error if the case is closed during processing, // which doesn't need to be reported here. if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); + LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); //NON-NLS } } finally { @@ -676,12 +676,12 @@ public final class DrawableDB { public Boolean isFileAnalyzed(long fileId) { dbReadLock(); try (Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { //NON-NLS while (analyzedQuery.next()) { return analyzedQuery.getBoolean(ANALYZED); } } catch (SQLException ex) { - String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); + String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); //NON-NLS LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -695,12 +695,12 @@ public final class DrawableDB { dbReadLock(); try (Statement stmt = con.createStatement(); //Can't make this a preprared statement because of the IN ( ... ) - ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { + ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { //NON-NLS while (analyzedQuery.next()) { return analyzedQuery.getInt(ANALYZED) == fileIds.size(); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS } finally { dbReadUnlock(); } @@ -717,7 +717,7 @@ public final class DrawableDB { // In testing, this method appears to be a lot faster than doing one large select statement for (Long fileID : fileIDsInGroup) { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); //NON-NLS while (analyzedQuery.next()) { if (analyzedQuery.getInt(ANALYZED) == 0) { return false; @@ -727,10 +727,10 @@ public final class DrawableDB { } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); //NON-NLS } finally { dbReadUnlock(); } @@ -756,7 +756,7 @@ public final class DrawableDB { dbReadLock(); try { statement = con.createStatement(); - rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); + rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); //NON-NLS while (rs.next()) { ret.add(rs.getLong(1)); } @@ -767,14 +767,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); //NON-NLS } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); //NON-NLS } } dbReadUnlock(); @@ -808,14 +808,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); //NON-NLS } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); //NON-NLS } } dbReadUnlock(); @@ -845,14 +845,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); //NON-NLS } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); //NON-NLS } } dbReadUnlock(); @@ -883,15 +883,15 @@ public final class DrawableDB { default: dbReadLock(); //TODO: convert this to prepared statement - StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); + StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); //NON-NLS String orderByClause = ""; switch (sortBy) { case GROUP_BY_VALUE: - orderByClause = " ORDER BY " + groupBy.attrName.toString(); + orderByClause = " ORDER BY " + groupBy.attrName.toString(); //NON-NLS break; case FILE_COUNT: - orderByClause = " ORDER BY COUNT(*)"; + orderByClause = " ORDER BY COUNT(*)"; //NON-NLS break; case NONE: // case PRIORITY: @@ -905,10 +905,10 @@ public final class DrawableDB { switch (sortOrder) { case DESCENDING: - sortOrderClause = " DESC"; + sortOrderClause = " DESC"; //NON-NLS break; case ASCENDING: - sortOrderClause = " ASC"; + sortOrderClause = " ASC"; //NON-NLS break; default: orderByClause = ""; @@ -930,7 +930,7 @@ public final class DrawableDB { vals.add(value); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); + LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); //NON-NLS } finally { dbReadUnlock(); } @@ -951,7 +951,7 @@ public final class DrawableDB { } catch (SQLException sQLException) { // Don't need to report it if the case was closed if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); + LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); //NON-NLS } } finally { dbWriteUnlock(); @@ -972,7 +972,7 @@ public final class DrawableDB { AbstractFile f = tskCase.getAbstractFileById(id); return DrawableFile.create(f, analyzed, isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); //NON-NLS return null; } } @@ -991,7 +991,7 @@ public final class DrawableDB { return DrawableFile.create(f, areFilesAnalyzed(Collections.singleton(id)), isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); //NON-NLS return null; } } @@ -1020,7 +1020,7 @@ public final class DrawableDB { } } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); + LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); //NON-NLS } finally { dbReadUnlock(); } @@ -1042,14 +1042,14 @@ public final class DrawableDB { public int countAllFiles() { int result = -1; dbReadLock(); - try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { + try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { //NON-NLS while (rs.next()) { result = rs.getInt("COUNT"); break; } } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); + LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); //NON-NLS } finally { dbReadUnlock(); } @@ -1081,7 +1081,7 @@ public final class DrawableDB { //TODO: delete from hash_set_hits table also... } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); + LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); //NON-NLS } finally { dbWriteUnlock(); } @@ -1093,7 +1093,7 @@ public final class DrawableDB { public class MultipleTransactionException extends IllegalStateException { - private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; + private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; //NON-NLS public MultipleTransactionException() { super(CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO); @@ -1137,12 +1137,12 @@ public final class DrawableDB { dbReadLock(); try { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); + ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); //NON-NLS while (analyzedQuery.next()) { addImageFileToList(analyzedQuery.getLong(OBJ_ID)); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); + LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); //NON-NLS } finally { dbReadUnlock(); } @@ -1194,9 +1194,9 @@ public final class DrawableDB { .count(); } } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); + LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS } catch (TskCoreException ex1) { - LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); + LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); //NON-NLS } return -1; @@ -1231,15 +1231,15 @@ public final class DrawableDB { //count the fileids that are in the given list and don't have a non-zero category assigned to them. String name = - "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList - + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; + "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList //NON-NLS + + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; //NON-NLS try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(name); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - return resultSet.getLong("count(obj_id)"); + return resultSet.getLong("count(obj_id)"); //NON-NLS } } catch (SQLException | TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error getting category count.", ex); + LOGGER.log(Level.SEVERE, "Error getting category count.", ex); //NON-NLS } return -1; @@ -1274,7 +1274,7 @@ public final class DrawableDB { con.setAutoCommit(false); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); + LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); //NON-NLS } } @@ -1285,7 +1285,7 @@ public final class DrawableDB { con.rollback(); updatedFiles.clear(); } catch (SQLException ex1) { - LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); + LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); //NON-NLS } finally { close(); } @@ -1307,9 +1307,9 @@ public final class DrawableDB { } } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); + LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); //NON-NLS } else { - LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); + LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); //NON-NLS } rollback(); } @@ -1322,9 +1322,9 @@ public final class DrawableDB { con.setAutoCommit(true); } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); //NON-NLS } else { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); //NON-NLS } } finally { closed = true; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java index 14fbf4265c..979429b880 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java @@ -186,9 +186,9 @@ public abstract class DrawableFile extends AbstractFile .map(Tag::getName) .collect(Collectors.toSet()); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); //NON-NLS } catch (IllegalStateException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); + Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); //NON-NLS } return Collections.emptySet(); } @@ -223,7 +223,7 @@ public abstract class DrawableFile extends AbstractFile } } } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); //NON-NLS } return ""; } @@ -255,7 +255,7 @@ public abstract class DrawableFile extends AbstractFile .orElse(Category.ZERO) ); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); + LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); //NON-NLS } catch (IllegalStateException ex) { // We get here many times if the case is closed during ingest, so don't print out a ton of warnings. } @@ -333,7 +333,7 @@ public abstract class DrawableFile extends AbstractFile drawablePath = StringUtils.removeEnd(getUniquePath(), getName()); return drawablePath; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); + LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); //NON-NLS return ""; } } @@ -344,7 +344,7 @@ public abstract class DrawableFile extends AbstractFile try { return getHashSetNames(); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); + LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); //NON-NLS return Collections.emptySet(); } } @@ -362,7 +362,7 @@ public abstract class DrawableFile extends AbstractFile return this.getUniquePath(); } catch (TskCoreException tskCoreException) { String contentName = this.getName(); - LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N + LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N NON-NLS return contentName; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java index 0d122a6219..cdadb53b94 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java @@ -28,6 +28,7 @@ import java.util.logging.Level; import java.util.stream.Collectors; import javax.annotation.Nonnull; import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.casemodule.services.TagsManager; @@ -41,11 +42,12 @@ import org.sleuthkit.datamodel.TskCoreException; * Manages Tags, Tagging, and the relationship between Categories and Tags in * the autopsy Db. delegates some, work to the backing {@link TagsManager}. */ +@NbBundle.Messages({"DrawableTagsManager.followUp=Follow Up"}) public class DrawableTagsManager { private static final Logger LOGGER = Logger.getLogger(DrawableTagsManager.class.getName()); - private static final String FOLLOW_UP = "Follow Up"; + private static final String FOLLOW_UP = Bundle.DrawableTagsManager_followUp(); final private Object autopsyTagsManagerLock = new Object(); private TagsManager autopsyTagsManager; @@ -53,8 +55,8 @@ public class DrawableTagsManager { /** Used to distribute {@link TagsChangeEvent}s */ private final EventBus tagsEventBus = new AsyncEventBus( Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { - LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); + new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS + LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); //NON-NLS }).build() )); @@ -147,7 +149,7 @@ public class DrawableTagsManager { .distinct().sorted() .collect(Collectors.toList()); } catch (TskCoreException | IllegalStateException ex) { - LOGGER.log(Level.WARNING, "couldn't access case", ex); + LOGGER.log(Level.WARNING, "couldn't access case", ex); //NON-NLS } return Collections.emptyList(); } @@ -183,7 +185,7 @@ public class DrawableTagsManager { throw new TskCoreException("tagame exists but wasn't found", ex); } } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); + LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); //NON-NLS throw new TskCoreException("Case was closed out from underneath", ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java index a04646c310..9b3b3218f1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java @@ -46,7 +46,7 @@ public class HashSetManager { try { return db.getHashSetsForFile(fileID); } catch (TskCoreException ex) { - Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); + Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); //NON-NLS return Collections.emptySet(); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java index 4249fe3c24..01e5cfd983 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java @@ -46,7 +46,7 @@ public class ImageFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to read image {0}: " + exception.toString(); + return "Failed to read image {0}: " + exception.toString(); //NON-NLS } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java index 20724ef0bc..1da586f603 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java @@ -29,6 +29,7 @@ import javafx.scene.media.Media; import javafx.scene.media.MediaException; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.VideoUtils; @@ -39,7 +40,7 @@ public class VideoFile extends DrawableFile { private static final Logger LOGGER = Logger.getLogger(VideoFile.class.getName()); - private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); + private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); //NON-NLS VideoFile(T file, Boolean analyzed) { super(file, analyzed); @@ -53,7 +54,7 @@ public class VideoFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to get image preview for video {0}: " + exception.toString(); + return "Failed to get image preview for video {0}: " + exception.toString(); //NON-NLS } @Override @@ -63,6 +64,7 @@ public class VideoFile extends DrawableFile { private SoftReference mediaRef; + @NbBundle.Messages({"VideoFile.getMedia.progress=writing temporary file to disk"}) public Media getMedia() throws IOException, MediaException { Media media = (mediaRef != null) ? mediaRef.get() : null; @@ -73,7 +75,7 @@ public class VideoFile extends DrawableFile { if (cacheFile.exists() == false || cacheFile.length() < getAbstractFile().getSize()) { Files.createParentDirs(cacheFile); - ProgressHandle progressHandle = ProgressHandleFactory.createHandle("writing temporary file to disk"); + ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.VideoFile_getMedia_progress()); progressHandle.start(100); ContentUtils.writeToFile(this.getAbstractFile(), cacheFile, progressHandle, null, true); progressHandle.finish(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java index f3020830a9..1b8b7d72c8 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java @@ -126,7 +126,7 @@ public class DrawableGroup implements Comparable { .filter(Boolean::booleanValue) .count()); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS } } @@ -145,7 +145,7 @@ public class DrawableGroup implements Comparable { uncatCount.set(ImageGalleryController.getDefault().getDatabase().getCategoryCount(Category.ZERO, fileIDs)); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS } } @@ -202,7 +202,7 @@ public class DrawableGroup implements Comparable { @Override public String toString() { - return "Grouping{ keyProp=" + groupKey + '}'; + return "Grouping{ keyProp=" + groupKey + '}'; //NON-NLS } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java index 79cbb1fba2..1073d587da 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java @@ -57,7 +57,7 @@ public class GroupKey> implements Comparable @Override public String toString() { - return "GroupKey: " + getAttribute().attrName + " = " + getValue(); + return "GroupKey: " + getAttribute().attrName + " = " + getValue(); //NON-NLS } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java index 200ef32a16..cebcd6c222 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java @@ -62,6 +62,7 @@ import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Exceptions; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -195,10 +196,10 @@ public class GroupManager { DrawableFile file = db.getFileFromID(fileID); return getGroupKeysForFile(file); } else { - Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); + Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); //NON-NLS } } catch (TskCoreException ex) { - Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); + Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); //NON-NLS } return Collections.emptySet(); } @@ -347,11 +348,11 @@ public class GroupManager { break; case MIME_TYPE: HashSet types = new HashSet<>(); - try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); + try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); //NON-NLS ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final String mimeType = resultSet.getString("mime_type"); - String objIds = resultSet.getString("group_concat(obj_id)"); + final String mimeType = resultSet.getString("mime_type"); //NON-NLS + String objIds = resultSet.getString("group_concat(obj_id)"); //NON-NLS Pattern.compile(",").splitAsStream(objIds) .map(Long::valueOf) @@ -370,7 +371,7 @@ public class GroupManager { return values; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); + LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); //NON-NLS return Collections.emptyList(); } @@ -416,7 +417,7 @@ public class GroupManager { } } - return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); + return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); //NON-NLS } else { List contentTags = tagsManager.getContentTagsByTagName(tagsManager.getTagName(category)); @@ -428,7 +429,7 @@ public class GroupManager { } } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); + LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); //NON-NLS throw ex; } } @@ -444,7 +445,7 @@ public class GroupManager { } return files; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); + LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); //NON-NLS throw ex; } } @@ -531,7 +532,7 @@ public class GroupManager { /** * an executor to submit async ui related background tasks to. */ - final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); + final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); //NON-NLS public ReadOnlyDoubleProperty regroupProgress() { return regroupProgress.getReadOnlyProperty(); @@ -682,7 +683,7 @@ public class GroupManager { return group; } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); + LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); //NON-NLS } } } @@ -693,13 +694,13 @@ public class GroupManager { HashSet hashSet = new HashSet<>(); String query = (null == mimeType) - ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" - : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; + ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" //NON-NLS + : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; //NON-NLS try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(query); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final long fileID = resultSet.getLong("obj_id"); + final long fileID = resultSet.getLong("obj_id"); //NON-NLS if (db.isInDB(fileID)) { hashSet.add(fileID); } @@ -717,6 +718,13 @@ public class GroupManager { * {@link Groupings} for them */ @SuppressWarnings({"unchecked", "rawtypes"}) + @NbBundle.Messages({"# {0} - groupBy attribute Name", + "# {1} - sortBy name", + "# {2} - sort Order", + "ReGroupTask.displayTitle=regrouping files by {0} sorted by {1} in {2} order", + "# {0} - groupBy attribute Name", + "# {1} - atribute value", + "ReGroupTask.progressUpdate=regrouping files by {0} : {1}"}) private class ReGroupTask> extends LoggedTask { private ProgressHandle groupProgress; @@ -728,7 +736,7 @@ public class GroupManager { private final SortOrder sortOrder; public ReGroupTask(DrawableAttribute groupBy, GroupSortBy sortBy, SortOrder sortOrder) { - super("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", true); + super(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), true); this.groupBy = groupBy; this.sortBy = sortBy; @@ -747,7 +755,7 @@ public class GroupManager { return null; } - groupProgress = ProgressHandleFactory.createHandle("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", this); + groupProgress = ProgressHandleFactory.createHandle(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), this); Platform.runLater(() -> { analyzedGroups.clear(); unSeenGroups.clear(); @@ -765,9 +773,9 @@ public class GroupManager { return null;//abort } p++; - updateMessage("regrouping files by " + groupBy.attrName.toString() + " : " + val); + updateMessage(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), val)); updateProgress(p, vals.size()); - groupProgress.progress("regrouping files by " + groupBy.attrName.toString() + " : " + val, p); + groupProgress.progress(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), val), p); popuplateIfAnalyzed(new GroupKey(groupBy, val), this); } Platform.runLater(() -> FXCollections.sort(analyzedGroups, sortBy.getGrpComparator(sortOrder))); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java index 53f464dbb0..5d8740b343 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java @@ -27,6 +27,7 @@ import javax.swing.SortOrder; import static javax.swing.SortOrder.ASCENDING; import static javax.swing.SortOrder.DESCENDING; import org.apache.commons.lang3.StringUtils; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; @@ -35,13 +36,17 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; * down in Toolbar as well as each enum value having the stategy * ({@link Comparator}) for sorting the groups */ +@NbBundle.Messages({"GroupSortBy.groupSize=Group Size", + "GroupSortBy.groupName=Group Name", + "GroupSortBy.none=None", + "GroupSortBy.priority=Priority"}) public enum GroupSortBy implements ComparatorProvider { /** * sort the groups by the number of files in each sort the groups by the * number of files in each */ - FILE_COUNT("Group Size", true, "folder-open-image.png") { + FILE_COUNT(Bundle.GroupSortBy_groupSize(), true, "folder-open-image.png") { //NON-NLS @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparingInt(DrawableGroup::getSize)); @@ -56,7 +61,7 @@ public enum GroupSortBy implements ComparatorProvider { * sort the groups by the natural order of the grouping value ( eg group * them by path alphabetically ) */ - GROUP_BY_VALUE("Group Name", true, "folder-rename.png") { + GROUP_BY_VALUE(Bundle.GroupSortBy_groupName(), true, "folder-rename.png") { //NON-NLS @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparing(t -> t.getGroupByValueDislpayName())); @@ -71,7 +76,7 @@ public enum GroupSortBy implements ComparatorProvider { * don't sort the groups just use what ever order they come in (ingest * order) */ - NONE("None", false, "prohibition.png") { + NONE(Bundle.GroupSortBy_none(), false, "prohibition.png") { //NON-NLS @Override public Comparator getGrpComparator(SortOrder sortOrder) { return new NoOpComparator<>(); @@ -85,7 +90,7 @@ public enum GroupSortBy implements ComparatorProvider { /** * sort the groups by some priority metric to be determined and implemented */ - PRIORITY("Priority", false, "hashset_hits.png") { + PRIORITY(Bundle.GroupSortBy_priority(), false, "hashset_hits.png") { //NON-NLS @Override public Comparator getGrpComparator(SortOrder sortOrder) { return Comparator.nullsLast(Comparator.comparingDouble(DrawableGroup::getHashHitDensity).thenComparingInt(DrawableGroup::getSize).reversed()); @@ -128,7 +133,7 @@ public enum GroupSortBy implements ComparatorProvider { public Image getIcon() { if (icon == null) { if (StringUtils.isBlank(imageName) == false) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS } } return icon; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java index 402694bd07..872a2afc6b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java @@ -53,7 +53,7 @@ public class NoGroupsDialog extends GridPane { } private NoGroupsDialog() { - FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); + FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); //NON-NLS } public NoGroupsDialog(String message) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java index c1d2fe7a7b..0a0ce0f663 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java @@ -28,6 +28,7 @@ import javafx.scene.control.Label; import javafx.scene.control.ProgressBar; import javafx.scene.control.Tooltip; import javafx.scene.layout.AnchorPane; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -62,6 +63,10 @@ public class StatusBar extends AnchorPane { private ProgressBar bgTaskProgressBar; @FXML + @NbBundle.Messages({"# {0} - file update queue size", + "StatusBar.fileUpdateTaskLabel.text={0} File Update Tasks", + "StatusBar.bgTaskLabel.text=Regrouping", + "StatuBar.toolTip=Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data."}) void initialize() { assert fileTaskProgresBar != null : "fx:id=\"fileTaskProgresBar\" was not injected: check your FXML file 'StatusBar.fxml'."; assert fileUpdateTaskLabel != null : "fx:id=\"fileUpdateTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'."; @@ -69,7 +74,7 @@ public class StatusBar extends AnchorPane { assert bgTaskLabel != null : "fx:id=\"bgTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'."; assert bgTaskProgressBar != null : "fx:id=\"bgTaskProgressBar\" was not injected: check your FXML file 'StatusBar.fxml'."; - fileUpdateTaskLabel.textProperty().bind(controller.getFileUpdateQueueSizeProperty().asString().concat(" File Update Tasks"));//;setText(newSize.toString() + " File Update Tasks"); + fileUpdateTaskLabel.textProperty().bind(Bundle.StatusBar_fileUpdateTaskLabel_text(controller.getFileUpdateQueueSizeProperty().asString()));//;setText(newSize.toString() + " File Update Tasks"); fileTaskProgresBar.progressProperty().bind(controller.getFileUpdateQueueSizeProperty().negate()); // controller.getFileUpdateQueueSizeProperty().addListener((ov, oldSize, newSize) -> { // Platform.runLater(() -> { @@ -83,7 +88,7 @@ public class StatusBar extends AnchorPane { if(controller.regroupProgress().lessThan(1.0).get()){ // Regrouping in progress bgTaskProgressBar.progressProperty().setValue(-1.0); - bgTaskLabel.setText("Regrouping"); + bgTaskLabel.setText(Bundle.StatusBar_bgTaskLabel_text()); } else{ // Clear the progress bar bgTaskProgressBar.progressProperty().setValue(0.0); @@ -94,14 +99,14 @@ public class StatusBar extends AnchorPane { Platform.runLater(() -> { - staleLabel.setTooltip(new Tooltip("Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data.")); + staleLabel.setTooltip(new Tooltip(Bundle.StatuBar_toolTip())); }); staleLabel.visibleProperty().bind(controller.stale()); } public StatusBar(ImageGalleryController controller) { this.controller = controller; - FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); //NON-NLS fxmlLoader.setRoot(this); fxmlLoader.setController(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java index 6fe4ce9b44..b9b1c04813 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java @@ -79,7 +79,7 @@ public class SummaryTablePane extends AnchorPane { public SummaryTablePane(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "SummaryTablePane.fxml"); + FXMLConstructor.construct(this, "SummaryTablePane.fxml"); //NON-NLS } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java index 91ca4a142c..5c68a94436 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java @@ -142,7 +142,7 @@ public class Toolbar extends ToolBar { try { new TagGroupAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); + LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); //NON-NLS } }); @@ -213,7 +213,7 @@ public class Toolbar extends ToolBar { private Toolbar(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "Toolbar.fxml"); + FXMLConstructor.construct(this, "Toolbar.fxml"); //NON-NLS } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java index 9b60278865..01b0e5dd1b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java @@ -40,19 +40,20 @@ import javafx.scene.media.MediaView; import javafx.scene.text.Text; import javafx.util.Duration; import javafx.util.StringConverter; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.datamodel.VideoFile; public class VideoPlayer extends BorderPane { - private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); - private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); - private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); - private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); + private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); //NON-NLS + private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); //NON-NLS + private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); //NON-NLS + private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); //NON-NLS - private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); - private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); + private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); //NON-NLS + private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); //NON-NLS private final MediaPlayer mp; @@ -106,6 +107,8 @@ public class VideoPlayer extends BorderPane { private final VideoFile file; @FXML + @NbBundle.Messages({"# {0} - exception type", + "VideoPlayer.errNotice={0}\nSee the logs for details."}) void initialize() { assert controlButton != null : "fx:id=\"controlButton\" was not injected: check your FXML file 'MediaControl.fxml'."; assert timeSlider != null : "fx:id=\"timeSlider\" was not injected: check your FXML file 'MediaControl.fxml'."; @@ -114,14 +117,14 @@ public class VideoPlayer extends BorderPane { final MediaException ex = mp.getError(); if (ex != null) { Platform.runLater(() -> { - Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); - setCenter(new Text(ex.getType() + "\nSee the logs for details.")); + Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); //NON-NLS + setCenter(new Text(Bundle.VideoPlayer_errNotice(ex.getType()))); setBottom(null); }); } }); mp.statusProperty().addListener((observableStatus, oldStatus, newStatus) -> { - Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); + Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); //NON-NLS }); mediaView.setMediaPlayer(mp); mediaView.fitHeightProperty().bind(this.heightProperty().subtract(playControlBar.heightProperty())); @@ -236,7 +239,7 @@ public class VideoPlayer extends BorderPane { public VideoPlayer(MediaPlayer mp, VideoFile file) { this.file = file; this.mp = mp; - FXMLConstructor.construct(this, "MediaControl.fxml"); + FXMLConstructor.construct(this, "MediaControl.fxml"); //NON-NLS } protected void updateTime() { @@ -277,10 +280,10 @@ public class VideoPlayer extends BorderPane { int elapsedSeconds = totalSeconds - elapsedMinutes * 60; if (elapsedHours > 0) { - return String.format("%d:%02d:%02d", elapsedHours, + return String.format("%d:%02d:%02d", elapsedHours, //NON-NLS elapsedMinutes, elapsedSeconds); } else { - return String.format("%02d:%02d", elapsedMinutes, + return String.format("%02d:%02d", elapsedMinutes, //NON-NLS elapsedSeconds); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java index 674aad0260..badfc20b92 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java @@ -54,7 +54,7 @@ public class DrawableTile extends DrawableTileBase { try { setEffect(Objects.equals(newValue, getFileID()) ? LAST_SELECTED_EFFECT : null); } catch (java.lang.IllegalStateException ex) { - Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); + Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); //NON-NLS } }; @@ -78,7 +78,7 @@ public class DrawableTile extends DrawableTileBase { public DrawableTile(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "DrawableTile.fxml"); + FXMLConstructor.construct(this, "DrawableTile.fxml"); //NON-NLS } /** diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java index 2058737b3c..7cbc9350cb 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java @@ -95,8 +95,8 @@ public abstract class DrawableTileBase extends DrawableUIBase { private static final Border SELECTED_BORDER = new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, new CornerRadii(2), new BorderWidths(3))); //TODO: do this in CSS? -jm - protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); - protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); + protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); //NON-NLS + protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); //NON-NLS protected final FileIDSelectionModel selectionModel; private static ContextMenu contextMenu; @@ -197,6 +197,8 @@ public abstract class DrawableTileBase extends DrawableUIBase { t.consume(); } + @NbBundle.Messages({"DrawableTileBase.menuItem.extractFiles=Extract File(s)", + "DrawableTileBase.menuItem.showContentViewer=Show Content Viewer"}) private ContextMenu buildContextMenu(DrawableFile file) { final ArrayList menuItems = new ArrayList<>(); @@ -204,7 +206,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { menuItems.add(new AddDrawableTagAction(getController()).getPopupMenu()); - final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); + final MenuItem extractMenuItem = new MenuItem(Bundle.DrawableTileBase_menuItem_extractFiles()); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -213,10 +215,10 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); menuItems.add(extractMenuItem); - MenuItem contentViewer = new MenuItem("Show Content Viewer"); + MenuItem contentViewer = new MenuItem(Bundle.DrawableTileBase_menuItem_showContentViewer()); contentViewer.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { - new NewWindowViewAction("Show Content Viewer", new FileNode(file.getAbstractFile())).actionPerformed(null); + new NewWindowViewAction(Bundle.DrawableTileBase_menuItem_showContentViewer(), new FileNode(file.getAbstractFile())).actionPerformed(null); }); }); menuItems.add(contentViewer); @@ -260,7 +262,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { selectionModel.clearAndSelect(file.getId()); new AddDrawableTagAction(getController()).addTag(getController().getTagsManager().getFollowUpTagName(), ""); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); + LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); //NON-NLS } } else { new DeleteFollowUpTagAction(getController(), file).handle(event); @@ -276,7 +278,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { return DrawableAttribute.TAGS.getValue(getFile().get()).stream() .anyMatch(followUpTagName::equals); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); + LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); //NON-NLS return true; } } else { @@ -363,7 +365,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS } }); } @@ -380,7 +382,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { updateFollowUpIcon(); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS } }); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java index d77eee7f44..1a6bfd227e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java @@ -102,7 +102,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView try { fileOpt = Optional.ofNullable(getController().getFileFromId(fileIDOpt.get())); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); + Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); //NON-NLS fileOpt = Optional.empty(); } return fileOpt; @@ -147,7 +147,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView myTask.setOnFailed(failed -> { Throwable exception = myTask.getException(); if (exception instanceof OutOfMemoryError - && exception.getMessage().contains("Java heap space")) { + && exception.getMessage().contains("Java heap space")) { //NON-NLS showErrorNode(Bundle.DrawableUIBase_errorLabel_OOMText(), file); } else { showErrorNode(Bundle.DrawableUIBase_errorLabel_text(), file); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java index 96d30afd93..1219e2d1a8 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java @@ -92,7 +92,7 @@ public interface DrawableView { } catch (NullPointerException ex) { // I think this happens when we're in the process of removing images from the view while // also trying to update it? - Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); + Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); //NON-NLS return false; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java index a31001fd2f..7955368a9e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java @@ -89,6 +89,8 @@ import javafx.scene.layout.Priority; import javafx.scene.layout.Region; import javafx.scene.paint.Color; import javafx.util.Duration; + +import javax.ejb.MessageDriven; import javax.swing.Action; import javax.swing.SwingUtilities; import org.apache.commons.lang3.StringUtils; @@ -97,6 +99,7 @@ import org.controlsfx.control.GridView; import org.controlsfx.control.SegmentedButton; import org.controlsfx.control.action.ActionUtils; import org.openide.util.Lookup; +import org.openide.util.NbBundle; import org.openide.util.actions.Presenter; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; @@ -273,7 +276,7 @@ public class GroupPane extends BorderPane { undoAction = new UndoAction(controller); redoAction = new RedoAction(controller); - FXMLConstructor.construct(this, "GroupPane.fxml"); + FXMLConstructor.construct(this, "GroupPane.fxml"); //NON-NLS } @ThreadConfined(type = ThreadType.JFX) @@ -330,10 +333,14 @@ public class GroupPane extends BorderPane { /** * create the string to display in the group header */ + @NbBundle.Messages({"# {0} - default group name", + "# {1} - hashset hits count", + "# {2} - group size", + "GroupPane.headerString={0} -- {1} hash set hits / {2} files"}) protected String getHeaderString() { return isNull(getGroup()) ? "" - : StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()) + " -- " - + getGroup().getHashSetHitsCount() + " hash set hits / " + getGroup().getSize() + " files"; + : Bundle.GroupPane_headerString(StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()), + getGroup().getHashSetHitsCount(), getGroup().getSize()); } ContextMenu getContextMenu() { @@ -451,13 +458,13 @@ public class GroupPane extends BorderPane { try { tagSelectedSplitMenu.setText(controller.getTagsManager().getFollowUpTagName().getDisplayName()); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS } tagSelectedSplitMenu.setOnAction(actionEvent -> { try { new TagSelectedFilesAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS } }); @@ -512,6 +519,7 @@ public class GroupPane extends BorderPane { addEventFilter(KeyEvent.KEY_PRESSED, tileKeyboardNavigationHandler); gridView.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler() { + @NbBundle.Messages({"GroupPane.gridViewContextMenuItem.extractFiles=Extract File(s)"}) private ContextMenu buildContextMenu() { ArrayList menuItems = new ArrayList<>(); @@ -528,7 +536,7 @@ public class GroupPane extends BorderPane { } } } - final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); + final MenuItem extractMenuItem = new MenuItem(Bundle.GroupPane_gridViewContextMenuItem_extractFiles()); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -730,7 +738,7 @@ public class GroupPane extends BorderPane { if (gridView == null || gridView.getSkin() == null) { return Optional.empty(); } - return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); + return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); //NON-NLS } void makeSelection(Boolean shiftDown, Long newFileID) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java index 32b8b8c71f..24e2072aec 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java @@ -50,6 +50,7 @@ import javafx.scene.input.KeyEvent; import javafx.scene.layout.Region; import javafx.scene.text.Text; import javafx.util.Pair; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.coreutils.Logger; @@ -84,10 +85,11 @@ public class MetaDataPane extends DrawableUIBase { public MetaDataPane(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "MetaDataPane.fxml"); + FXMLConstructor.construct(this, "MetaDataPane.fxml"); //NON-NLS } @FXML + @NbBundle.Messages({"MetaDataPane.tableView.placeholder=Select a file to show its details here."}) void initialize() { assert attributeColumn != null : "fx:id=\"attributeColumn\" was not injected: check your FXML file 'MetaDataPane.fxml'."; assert imageView != null : "fx:id=\"imageView\" was not injected: check your FXML file 'MetaDataPane.fxml'."; @@ -116,7 +118,7 @@ public class MetaDataPane extends DrawableUIBase { }); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label("Select a file to show its details here.")); + tableView.setPlaceholder(new Label(Bundle.MetaDataPane_tableView_placeholder())); tableView.getColumns().setAll(Arrays.asList(attributeColumn, valueColumn)); attributeColumn.setPrefWidth(USE_COMPUTED_SIZE); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java index 59d747a655..1818f65521 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java @@ -77,7 +77,7 @@ public class SlideShowView extends DrawableTileBase { SlideShowView(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "SlideShowView.fxml"); + FXMLConstructor.construct(this, "SlideShowView.fxml"); //NON-NLS } @FXML @@ -137,7 +137,7 @@ public class SlideShowView extends DrawableTileBase { }); } catch (NullPointerException ex) { // The case has likely been closed - LOGGER.log(Level.WARNING, "Error accessing groupPane"); + LOGGER.log(Level.WARNING, "Error accessing groupPane"); //NON-NLS } } @@ -278,9 +278,12 @@ public class SlideShowView extends DrawableTileBase { * @return supplemental text to include in the label, specifically: "image x * of y" */ + @NbBundle.Messages({"# {0} - file id number", + "# {1} - number of file ids", + "SlideShowView.supplementalText={0} of {1} in group"}) private String getSupplementalText() { final ObservableList fileIds = getGroupPane().getGroup().getFileIDs(); - return getFileID().map(fileID -> " ( " + (fileIds.indexOf(fileID) + 1) + " of " + fileIds.size() + " in group )") + return getFileID().map(fileID -> " ( " + Bundle.SlideShowView_supplementalText(fileIds.indexOf(fileID) + 1, fileIds.size()) + " )") .orElse(""); } @@ -324,7 +327,7 @@ public class SlideShowView extends DrawableTileBase { final Media media = file.getMedia(); return new VideoPlayer(new MediaPlayer(media), file); } catch (MediaException | IOException | OutOfMemoryError ex) { - LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); + LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); //NON-NLS return doReadImageTask(file); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java index c7bce311c4..a5bbb40f49 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java @@ -21,27 +21,34 @@ package org.sleuthkit.autopsy.imagegallery.gui.navpanel; import com.google.common.collect.ImmutableList; import java.util.Comparator; import java.util.function.Function; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup; /** * */ +@NbBundle.Messages({"GroupComparators.uncategorizedCount=Uncategorized Count", + "GroupComparators.groupName=Group Name", + "GroupComparators.hitCount=Hit Count", + "GroupComparators.groupSize=Group Size", + "GroupComparators.hitDensity=Hit Density"}) final class GroupComparators> implements Comparator { static final GroupComparators UNCATEGORIZED_COUNT = - new GroupComparators<>("Uncategorized Count", DrawableGroup::getUncategorizedCount, String::valueOf, false); + new GroupComparators<>(Bundle.GroupComparators_uncategorizedCount(), DrawableGroup::getUncategorizedCount, String::valueOf, false); static final GroupComparators ALPHABETICAL = - new GroupComparators<>("Group Name", DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); + new GroupComparators<>(Bundle.GroupComparators_groupName(), DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); static final GroupComparators HIT_COUNT = - new GroupComparators<>("Hit Count", DrawableGroup::getHashSetHitsCount, String::valueOf, true); + new GroupComparators<>(Bundle.GroupComparators_hitCount(), DrawableGroup::getHashSetHitsCount, String::valueOf, true); static final GroupComparators FILE_COUNT = - new GroupComparators<>("Group Size", DrawableGroup::getSize, String::valueOf, true); + new GroupComparators<>(Bundle.GroupComparators_groupSize(), DrawableGroup::getSize, String::valueOf, true); static final GroupComparators HIT_FILE_RATIO = - new GroupComparators<>("Hit Density", DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); + new GroupComparators<>(Bundle.GroupComparators_hitDensity(), DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); //NON-NLS private final static ImmutableList> values = ImmutableList.of(UNCATEGORIZED_COUNT, ALPHABETICAL, HIT_COUNT, FILE_COUNT, HIT_FILE_RATIO); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java index 6951d67997..37caa8bd78 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java @@ -42,7 +42,7 @@ class GroupListCell extends ListCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS /** * reference to group files listener that allows us to remove it from a @@ -70,8 +70,8 @@ class GroupListCell extends ListCell { GroupListCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -145,7 +145,7 @@ class GroupListCell extends ListCell { private String getSeenStyleClass() { return Optional.ofNullable(getItem()) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") + .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java index e371644944..ffe9df9a51 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java @@ -32,6 +32,8 @@ import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; import javafx.scene.image.ImageView; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.Beta; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -53,15 +55,16 @@ final public class GroupTree extends NavPanel> { public GroupTree(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); + FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS } @FXML @Override + @NbBundle.Messages({"GroupTree.displayName.allGroups=All Groups"}) void initialize() { super.initialize(); - setText("All Groups"); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); + setText(Bundle.GroupTree_displayName_allGroups()); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); //NON-NLS getBorderPane().setCenter(groupTree); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java index 917aa35084..a26ec693c7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java @@ -47,7 +47,7 @@ class GroupTreeCell extends TreeCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS /** * reference to group files listener that allows us to remove it from a @@ -75,8 +75,8 @@ class GroupTreeCell extends TreeCell { GroupTreeCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -161,7 +161,7 @@ class GroupTreeCell extends TreeCell { return Optional.ofNullable(getItem()) .map(GroupTreeNode::getGroup) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") + .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java index 71f8aa026f..03c6663369 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java @@ -24,6 +24,7 @@ import javafx.fxml.FXML; import javafx.scene.control.ListView; import javafx.scene.control.SelectionModel; import javafx.scene.image.ImageView; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -47,7 +48,7 @@ final public class HashHitGroupList extends NavPanel { public HashHitGroupList(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); + FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS } @ThreadConfined(type = ThreadConfined.ThreadType.JFX) @@ -68,11 +69,12 @@ final public class HashHitGroupList extends NavPanel { @FXML @Override + @NbBundle.Messages({"HashHitGroupList.displayName.onlyHashHits=Only Hash Hits"}) void initialize() { super.initialize(); - setText("Only Hash Hits"); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); + setText(Bundle.HashHitGroupList_displayName_onlyHashHits()); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); //NON-NLS getBorderPane().setCenter(groupList); sorted = getController().getGroupManager().getAnalyzedGroups().filtered((DrawableGroup t) -> t.getHashSetHitsCount() > 0).sorted(getDefaultComparator()); From 16314868690e1664126ca14c291fb81fe6016327 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 1 Feb 2016 13:31:29 -0500 Subject: [PATCH 45/48] Revert "1501 ja image gallery - redo 2" --- .../autopsy/imagegallery/ImageGalleryController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index 426764b93b..34f46d643e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -567,7 +567,7 @@ public final class ImageGalleryController implements Executor { * Abstract base class for task to be done on {@link DBWorkerThread} */ @NbBundle.Messages({"ImageGalleryController.InnerTask.progress.name=progress", - "ImageGalleryController.InnerTask.message.name=status"}) + "ImageGalleryController.InnerTask.progress.name=status"}) static public abstract class InnerTask implements Runnable, Cancellable { public double getProgress() { @@ -587,7 +587,7 @@ public final class ImageGalleryController implements Executor { } SimpleObjectProperty state = new SimpleObjectProperty<>(Worker.State.READY); SimpleDoubleProperty progress = new SimpleDoubleProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); - SimpleStringProperty message = new SimpleStringProperty(this, Bundle.ImageGalleryController_InnerTask_message_name()); + SimpleStringProperty message = new SimpleStringProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); public SimpleDoubleProperty progressProperty() { return progress; @@ -711,7 +711,8 @@ public final class ImageGalleryController implements Executor { @NbBundle.Messages({"CopyAnalyzedFiles.populatingDb.status=populating analyzed image/video database", "CopyAnalyzedFiles.committingDb.status=commiting image/video database", "CopyAnalyzedFiles.stopCopy.status=Stopping copy to drawable db task.", - "CopyAnalyzedFiles.errPopulating.errMsg=There was an error populating Image Gallery database."}) + "CopyAnalyzedFiles.errPopulating.errMsg=There was an error populating Image Gallery database.", + ""}) static private class CopyAnalyzedFiles extends InnerTask { private final ImageGalleryController controller; From 96c966002ad25aa520443a3f8307820e55a62531 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 1 Feb 2016 13:32:20 -0500 Subject: [PATCH 46/48] Revert "Revert "Revert "1501 ja image gallery - redo 1""" --- .../autopsy/imagegallery/FXMLConstructor.java | 6 +- .../imagegallery/FileIDSelectionModel.java | 4 +- .../autopsy/imagegallery/FileTypeUtils.java | 50 ++-- .../imagegallery/ImageGalleryController.java | 100 +++---- .../imagegallery/ImageGalleryModule.java | 5 +- .../ImageGalleryOptionsPanel.java | 7 +- .../imagegallery/ImageGalleryPreferences.java | 2 +- .../ImageGalleryTopComponent.java | 10 +- .../imagegallery/PerCaseProperties.java | 6 +- .../autopsy/imagegallery/ThumbnailCache.java | 12 +- .../actions/AddDrawableTagAction.java | 22 +- .../imagegallery/actions/AddTagAction.java | 14 +- .../autopsy/imagegallery/actions/Back.java | 6 +- .../actions/CategorizeAction.java | 22 +- .../actions/DeleteFollowUpTagAction.java | 6 +- .../autopsy/imagegallery/actions/Forward.java | 6 +- .../imagegallery/actions/NextUnseenGroup.java | 11 +- .../imagegallery/actions/OpenAction.java | 15 +- .../actions/OpenExternalViewerAction.java | 7 +- .../imagegallery/actions/OpenHelpAction.java | 4 +- .../imagegallery/actions/RedoAction.java | 6 +- .../imagegallery/actions/UndoAction.java | 6 +- .../imagegallery/datamodel/Category.java | 19 +- .../datamodel/CategoryManager.java | 14 +- .../datamodel/DrawableAttribute.java | 74 ++--- .../imagegallery/datamodel/DrawableDB.java | 254 +++++++++--------- .../imagegallery/datamodel/DrawableFile.java | 14 +- .../datamodel/DrawableTagsManager.java | 12 +- .../datamodel/HashSetManager.java | 2 +- .../imagegallery/datamodel/ImageFile.java | 2 +- .../imagegallery/datamodel/VideoFile.java | 8 +- .../datamodel/grouping/DrawableGroup.java | 6 +- .../datamodel/grouping/GroupKey.java | 2 +- .../datamodel/grouping/GroupManager.java | 44 ++- .../datamodel/grouping/GroupSortBy.java | 15 +- .../imagegallery/gui/NoGroupsDialog.java | 2 +- .../autopsy/imagegallery/gui/StatusBar.java | 13 +- .../imagegallery/gui/SummaryTablePane.java | 2 +- .../autopsy/imagegallery/gui/Toolbar.java | 4 +- .../autopsy/imagegallery/gui/VideoPlayer.java | 27 +- .../gui/drawableviews/DrawableTile.java | 4 +- .../gui/drawableviews/DrawableTileBase.java | 20 +- .../gui/drawableviews/DrawableUIBase.java | 4 +- .../gui/drawableviews/DrawableView.java | 2 +- .../gui/drawableviews/GroupPane.java | 22 +- .../gui/drawableviews/MetaDataPane.java | 6 +- .../gui/drawableviews/SlideShowView.java | 11 +- .../gui/navpanel/GroupComparators.java | 17 +- .../gui/navpanel/GroupListCell.java | 8 +- .../imagegallery/gui/navpanel/GroupTree.java | 9 +- .../gui/navpanel/GroupTreeCell.java | 8 +- .../gui/navpanel/HashHitGroupList.java | 8 +- 52 files changed, 413 insertions(+), 547 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java index ec846c1f36..55d45ac5f5 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FXMLConstructor.java @@ -39,7 +39,7 @@ public class FXMLConstructor { private static Logger logger = Logger.getLogger(FXMLConstructor.class.getName()); static public void construct(Object n, String fxmlFileName) { - final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; //NON-NLS + final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName; try { FXMLLoader fxmlLoader = new FXMLLoader(new URL(name)); @@ -53,12 +53,12 @@ public class FXMLConstructor { fxmlLoader.setClassLoader(FXMLLoader.getDefaultClassLoader()); fxmlLoader.load(); } catch (IOException ex) { - String msg = String.format("Failed to load fxml file %s", fxmlFileName); //NON-NLS + String msg = String.format("Failed to load fxml file %s", fxmlFileName); logger.log(Level.SEVERE, msg, ex); } } } catch (MalformedURLException ex) { - String msg = String.format("Malformed URL %s", name); //NON-NLS + String msg = String.format("Malformed URL %s", name); logger.log(Level.SEVERE, msg, ex); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java index 812ace17e9..e2109389fd 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileIDSelectionModel.java @@ -72,7 +72,7 @@ public class FileIDSelectionModel { try { fileNodes.add(new FileNode(controller.getSleuthKitCase().getAbstractFileById(id))); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get abstract file by its ID", ex); } } FileNode[] fileNodeArray = fileNodes.stream().toArray(FileNode[]::new); @@ -84,7 +84,7 @@ public class FileIDSelectionModel { try { etc.getExplorerManager().setSelectedNodes(fileNodeArray); } catch (PropertyVetoException ex) { - LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Explorer manager selection was vetoed.", ex); } }); }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java index 83dc067ac6..4498021484 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/FileTypeUtils.java @@ -93,31 +93,31 @@ public enum FileTypeUtils { .collect(Collectors.toList())); //add list of known image extensions imageExtensions.addAll(Arrays.asList( - "bmp" //Bitmap NON-NLS - , "gif" //gif NON-NLS - , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants NON-NLS - , "pbm", "pgm", "ppm" // Portable image format variants NON-NLS - , "png" //portable network graphic NON-NLS - , "tga" //targa NON-NLS - , "psd" //photoshop NON-NLS - , "tif", "tiff" //tiff variants NON-NLS - , "yuv", "ico" //icons NON-NLS - , "ai" //illustrator NON-NLS - , "svg" //scalable vector graphics NON-NLS - , "sn", "ras" //sun raster NON-NLS - , "ico" //windows icons NON-NLS - , "tga" //targa NON-NLS + "bmp" //Bitmap + , "gif" //gif + , "jpg", "jpeg", "jpe", "jp2", "jpx" //jpeg variants + , "pbm", "pgm", "ppm" // Portable image format variants + , "png" //portable network graphic + , "tga" //targa + , "psd" //photoshop + , "tif", "tiff" //tiff variants + , "yuv", "ico" //icons + , "ai" //illustrator + , "svg" //scalable vector graphics + , "sn", "ras" //sun raster + , "ico" //windows icons + , "tga" //targa )); //add list of known video extensions - videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", //NON-NLS - "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", //NON-NLS - "rm", "wmv", "mpv", "flv", "swf")); //NON-NLS + videoExtensions.addAll(Arrays.asList("fxm", "aaf", "3gp", "asf", "avi", + "m1v", "m2v", "m4v", "mp4", "mov", "mpeg", "mpg", "mpe", "mp4", + "rm", "wmv", "mpv", "flv", "swf")); supportedExtensions = Sets.union(imageExtensions, videoExtensions); //add list of mimetypes to count as videos even though they aren't prefixed by video/ - videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); //NON-NLS + videoMimeTypes.addAll(Arrays.asList("application/x-shockwave-flash")); supportedMimeTypes.addAll(videoMimeTypes); @@ -128,14 +128,14 @@ public enum FileTypeUtils { * fixed, we should remove application/x-123 from the list of supported * mime types. */ - supportedMimeTypes.addAll(Arrays.asList("application/x-123")); //NON-NLS + supportedMimeTypes.addAll(Arrays.asList("application/x-123")); //add list of mimetypes ImageIO claims to support supportedMimeTypes.addAll(Stream.of(ImageIO.getReaderMIMETypes()) .map(String::toLowerCase) .collect(Collectors.toList())); - supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rarely usefull NON-NLS + supportedMimeTypes.removeIf("application/octet-stream"::equals); //this is rarely usefull } public static Set getAllSupportedMimeTypes() { @@ -151,7 +151,7 @@ public enum FileTypeUtils { try { FILE_TYPE_DETECTOR = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to initialize File Type Detector, will fall back on extensions in some situations.", ex); } } return FILE_TYPE_DETECTOR; @@ -196,8 +196,8 @@ public enum FileTypeUtils { return Optional.empty(); } else { mimeType = mimeType.toLowerCase(); - return Optional.of(mimeType.startsWith("image/") //NON-NLS - || mimeType.startsWith("video/") //NON-NLS + return Optional.of(mimeType.startsWith("image/") + || mimeType.startsWith("video/") || supportedMimeTypes.contains(mimeType)); } } @@ -221,11 +221,11 @@ public enum FileTypeUtils { String mimeType = fileTypeDetector.getFileType(file); if (nonNull(mimeType)) { mimeType = mimeType.toLowerCase(); - return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); //NON-NLS + return mimeType.startsWith("video/") || videoMimeTypes.contains(mimeType); } } } catch (TskCoreException ex) { - LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); //NON-NLS + LOGGER.log(Level.INFO, "failed to get mime type for " + file.getName(), ex); } return FileTypeUtils.videoExtensions.contains(file.getNameExtension()); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index 34f46d643e..b749c9cdde 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -58,7 +58,6 @@ import org.apache.commons.lang3.StringUtils; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Cancellable; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -290,44 +289,38 @@ public final class ImageGalleryController implements Executor { * aren't, add a blocking progress spinner with appropriate message. */ @ThreadConfined(type = ThreadConfined.ThreadType.JFX) - @NbBundle.Messages({"ImageGalleryController.noGroupsDlg.msg1=No groups are fully analyzed; but listening to ingest is disabled. " + - " No groups will be available until ingest is finished and listening is re-enabled.", - "ImageGalleryController.noGroupsDlg.msg2=No groups are fully analyzed yet, but ingest is still ongoing. Please Wait.", - "ImageGalleryController.noGroupsDlg.msg3=No groups are fully analyzed yet, but image / video data is still being populated. Please Wait.", - "ImageGalleryController.noGroupsDlg.msg4=There are no images/videos available from the added datasources; but listening to ingest is disabled. " + - " No groups will be available until ingest is finished and listening is re-enabled.", - "ImageGalleryController.noGroupsDlg.msg5=There are no images/videos in the added datasources.", - "ImageGalleryController.noGroupsDlg.msg6=There are no fully analyzed groups to display:" + - " the current Group By setting resulted in no groups, " + - "or no groups are fully analyzed but ingest is not running."}) public void checkForGroups() { if (groupManager.getAnalyzedGroups().isEmpty()) { if (IngestManager.getInstance().isIngestRunning()) { if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg1())); + new NoGroupsDialog("No groups are fully analyzed; but listening to ingest is disabled. " + + " No groups will be available until ingest is finished and listening is re-enabled.")); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg2(), + new NoGroupsDialog("No groups are fully analyzed yet, but ingest is still ongoing. Please Wait.", new ProgressIndicator())); } } else if (getFileUpdateQueueSizeProperty().get() > 0) { replaceNotification(fullUIStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg3(), + new NoGroupsDialog("No groups are fully analyzed yet, but image / video data is still being populated. Please Wait.", new ProgressIndicator())); } else if (db != null && db.countAllFiles() <= 0) { // there are no files in db if (listeningEnabled.get() == false) { replaceNotification(fullUIStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg4())); + new NoGroupsDialog("There are no images/videos available from the added datasources; but listening to ingest is disabled. " + + " No groups will be available until ingest is finished and listening is re-enabled.")); } else { replaceNotification(fullUIStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg5())); + new NoGroupsDialog("There are no images/videos in the added datasources.")); } } else if (!groupManager.isRegrouping()) { replaceNotification(centralStackPane, - new NoGroupsDialog(Bundle.ImageGalleryController_noGroupsDlg_msg6())); + new NoGroupsDialog("There are no fully analyzed groups to display:" + + " the current Group By setting resulted in no groups, " + + "or no groups are fully analyzed but ingest is not running.")); } } else { @@ -406,7 +399,7 @@ public final class ImageGalleryController implements Executor { * reset the state of the controller (eg if the case is closed) */ public synchronized void reset() { - LOGGER.info("resetting ImageGalleryControler to initial state."); //NON-NLS + LOGGER.info("resetting ImageGalleryControler to initial state."); selectionModel.clearSelection(); setListeningEnabled(false); ThumbnailCache.getDefault().clearCache(); @@ -443,7 +436,7 @@ public final class ImageGalleryController implements Executor { @Nullable synchronized public DrawableFile getFileFromId(Long fileID) throws TskCoreException { if (Objects.isNull(db)) { - LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); //NON-NLS + LOGGER.log(Level.WARNING, "Could not get file from id, no DB set. The case is probably closed."); return null; } return db.getFileFromID(fileID); @@ -469,7 +462,7 @@ public final class ImageGalleryController implements Executor { */ void onStart() { Platform.setImplicitExit(false); - LOGGER.info("setting up ImageGallery listeners"); //NON-NLS + LOGGER.info("setting up ImageGallery listeners"); //TODO can we do anything usefull in an InjestJobEventListener? //IngestManager.getInstance().addIngestJobEventListener((PropertyChangeEvent evt) -> {}); IngestManager.getInstance().addIngestModuleEventListener(new IngestModuleEventListener()); @@ -553,7 +546,7 @@ public final class ImageGalleryController implements Executor { }); } catch (InterruptedException ex) { - LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to run DB worker thread", ex); } } } @@ -566,8 +559,6 @@ public final class ImageGalleryController implements Executor { /** * Abstract base class for task to be done on {@link DBWorkerThread} */ - @NbBundle.Messages({"ImageGalleryController.InnerTask.progress.name=progress", - "ImageGalleryController.InnerTask.progress.name=status"}) static public abstract class InnerTask implements Runnable, Cancellable { public double getProgress() { @@ -586,8 +577,8 @@ public final class ImageGalleryController implements Executor { this.message.set(Status); } SimpleObjectProperty state = new SimpleObjectProperty<>(Worker.State.READY); - SimpleDoubleProperty progress = new SimpleDoubleProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); - SimpleStringProperty message = new SimpleStringProperty(this, Bundle.ImageGalleryController_InnerTask_progress_name()); + SimpleDoubleProperty progress = new SimpleDoubleProperty(this, "pregress"); + SimpleStringProperty message = new SimpleStringProperty(this, "status"); public SimpleDoubleProperty progressProperty() { return progress; @@ -668,7 +659,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); //NON-NLS + Logger.getLogger(UpdateFileTask.class.getName()).log(Level.SEVERE, "Error in UpdateFile task"); } } } @@ -694,7 +685,7 @@ public final class ImageGalleryController implements Executor { // This is one of the places where we get many errors if the case is closed during processing. // We don't want to print out a ton of exceptions if this is the case. if (Case.isCaseOpen()) { - Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); //NON-NLS + Logger.getLogger(RemoveFileTask.class.getName()).log(Level.SEVERE, "Case was closed out from underneath RemoveFile task"); } } @@ -708,11 +699,6 @@ public final class ImageGalleryController implements Executor { * adds them to the Drawable DB. Uses the presence of a mimetype as an * approximation to 'analyzed'. */ - @NbBundle.Messages({"CopyAnalyzedFiles.populatingDb.status=populating analyzed image/video database", - "CopyAnalyzedFiles.committingDb.status=commiting image/video database", - "CopyAnalyzedFiles.stopCopy.status=Stopping copy to drawable db task.", - "CopyAnalyzedFiles.errPopulating.errMsg=There was an error populating Image Gallery database.", - ""}) static private class CopyAnalyzedFiles extends InnerTask { private final ImageGalleryController controller; @@ -726,28 +712,28 @@ public final class ImageGalleryController implements Executor { } static private final String FILE_EXTENSION_CLAUSE = - "(name LIKE '%." //NON-NLS - + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") //NON-NLS + "(name LIKE '%." + + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "')"; static private final String MIMETYPE_CLAUSE = - "(mime_type LIKE '" //NON-NLS - + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), "' OR mime_type LIKE '") //NON-NLS + "(mime_type LIKE '" + + StringUtils.join(FileTypeUtils.getAllSupportedMimeTypes(), "' OR mime_type LIKE '") + "') "; static private final String DRAWABLE_QUERY = //grab files with supported extension FILE_EXTENSION_CLAUSE //grab files with supported mime-types - + " OR " + MIMETYPE_CLAUSE //NON-NLS + + " OR " + MIMETYPE_CLAUSE //grab files with image or video mime-types even if we don't officially support them - + " OR mime_type LIKE 'video/%' OR mime_type LIKE 'image/%'"; //NON-NLS - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.CopyAnalyzedFiles_populatingDb_status()); + + " OR mime_type LIKE 'video/%' OR mime_type LIKE 'image/%'"; + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("populating analyzed image/video database"); @Override public void run() { progressHandle.start(); - updateMessage(Bundle.CopyAnalyzedFiles_populatingDb_status()); + updateMessage("populating analyzed image/video database"); try { //grab all files with supported extension or detected mime types @@ -761,7 +747,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "Task cancelled: not all contents may be transfered to drawable database."); //NON-NLS + LOGGER.log(Level.WARNING, "Task cancelled: not all contents may be transfered to drawable database."); progressHandle.finish(); break; } @@ -798,17 +784,17 @@ public final class ImageGalleryController implements Executor { progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle(Bundle.CopyAnalyzedFiles_committingDb_status()); - updateMessage(Bundle.CopyAnalyzedFiles_committingDb_status()); + progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); + updateMessage("commiting image/video database"); updateProgress(1.0); progressHandle.start(); taskDB.commitTransaction(tr, true); } catch (TskCoreException ex) { - progressHandle.progress(Bundle.CopyAnalyzedFiles_stopCopy_status()); - Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); //NON-NLS - MessageNotifyUtil.Notify.warn(Bundle.CopyAnalyzedFiles_errPopulating_errMsg(), ex.getMessage()); + progressHandle.progress("Stopping copy to drawable db task."); + Logger.getLogger(CopyAnalyzedFiles.class.getName()).log(Level.WARNING, "Stopping copy to drawable db task. Failed to transfer all database contents: " + ex.getMessage()); + MessageNotifyUtil.Notify.warn("There was an error populating Image Gallery database.", ex.getMessage()); progressHandle.finish(); updateMessage(""); updateProgress(-1.0); @@ -830,8 +816,6 @@ public final class ImageGalleryController implements Executor { * TODO: create methods to simplify progress value/text updates to both * netbeans and ImageGallery progress/status */ - @NbBundle.Messages({"PrePopulateDataSourceFiles.prepopulatingDb.status=prepopulating image/video database", - "PrePopulateDataSourceFiles.committingDb.status=commiting image/video database"}) private class PrePopulateDataSourceFiles extends InnerTask { private final Content dataSource; @@ -842,9 +826,9 @@ public final class ImageGalleryController implements Executor { * check for supported images */ // (name like '.jpg' or name like '.png' ...) - private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; //NON-NLS + private final String DRAWABLE_QUERY = "(name LIKE '%." + StringUtils.join(FileTypeUtils.getAllSupportedExtensions(), "' OR name LIKE '%.") + "') "; - private ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.PrePopulateDataSourceFiles_prepopulatingDb_status(), this); + private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("prepopulating image/video database", this); /** * @@ -864,10 +848,10 @@ public final class ImageGalleryController implements Executor { @Override public void run() { progressHandle.start(); - updateMessage(Bundle.PrePopulateDataSourceFiles_prepopulatingDb_status()); + updateMessage("prepopulating image/video database"); try { - String fsQuery = "(fs_obj_id IS NULL) "; //default clause NON-NLS + String fsQuery = "(fs_obj_id IS NULL) "; //default clause /* * NOTE: Logical files currently (Apr '15) have a null value for * fs_obj_id in DB. for them, we will not specify a fs_obj_id, @@ -888,10 +872,10 @@ public final class ImageGalleryController implements Executor { //use this clause to only grab files from the newly added filesystems. fsQuery = fileSystems.stream() .map(fileSystem -> String.valueOf(fileSystem.getId())) - .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); //NON-NLS + .collect(Collectors.joining(" OR fs_obj_id = ", "(fs_obj_id = ", ") ")); } - final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); //NON-NLS + final List files = getSleuthKitCase().findAllFilesWhere(fsQuery + " AND " + DRAWABLE_QUERY); progressHandle.switchToDeterminate(files.size()); //do in transaction @@ -899,7 +883,7 @@ public final class ImageGalleryController implements Executor { int units = 0; for (final AbstractFile f : files) { if (isCancelled()) { - LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); //NON-NLS + LOGGER.log(Level.WARNING, "task cancelled: not all contents may be transfered to database"); progressHandle.finish(); break; } @@ -909,13 +893,13 @@ public final class ImageGalleryController implements Executor { } progressHandle.finish(); - progressHandle = ProgressHandleFactory.createHandle(Bundle.PrePopulateDataSourceFiles_committingDb_status()); + progressHandle = ProgressHandleFactory.createHandle("commiting image/video database"); progressHandle.start(); db.commitTransaction(tr, false); } catch (TskCoreException ex) { - Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); //NON-NLS + Logger.getLogger(PrePopulateDataSourceFiles.class.getName()).log(Level.WARNING, "failed to transfer all database contents", ex); } progressHandle.finish(); @@ -970,7 +954,7 @@ public final class ImageGalleryController implements Executor { } } catch (TskCoreException ex) { //TODO: What to do here? - LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to determine if file is drawable and not known. Not making any changes to DB", ex); throw new RuntimeException(ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java index 770df56132..0a37825f54 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java @@ -22,8 +22,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.apache.commons.lang3.StringUtils; import static org.apache.commons.lang3.StringUtils.isNotBlank; - -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableDB; @@ -32,12 +30,11 @@ import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; /** static definitions and utilities for the ImageGallery module */ -@NbBundle.Messages({"ImageGalleryModule.moduleName=Image Gallery"}) public class ImageGalleryModule { private static final Logger LOGGER = Logger.getLogger(ImageGalleryModule.class.getName()); - private static final String MODULE_NAME = Bundle.ImageGalleryModule_moduleName(); + private static final String MODULE_NAME = "Image Gallery"; static String getModuleName() { return MODULE_NAME; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java index bb44a60ec1..be83d9e236 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java @@ -18,7 +18,6 @@ */ package org.sleuthkit.autopsy.imagegallery; -import java.awt.*; import java.awt.event.ActionEvent; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; @@ -84,17 +83,17 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel { furtherDescriptionArea.setBackground(new java.awt.Color(240, 240, 240)); furtherDescriptionArea.setColumns(20); - furtherDescriptionArea.setFont(furtherDescriptionArea.getFont().deriveFont(Font.PLAIN, 11)); // NOI18N + furtherDescriptionArea.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N furtherDescriptionArea.setLineWrap(true); furtherDescriptionArea.setRows(5); furtherDescriptionArea.setText(NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.furtherDescriptionArea.text")); // NOI18N furtherDescriptionArea.setWrapStyleWord(true); furtherDescriptionArea.setPreferredSize(new java.awt.Dimension(378, 74)); - infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N NON-NLS + infoIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/info-icon-16.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(infoIconLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.infoIconLabel.text")); // NOI18N - unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N NON-NLS + unavailableDuringInjestLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/imagegallery/images/warning16.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(unavailableDuringInjestLabel, NbBundle.getMessage(ImageGalleryOptionsPanel.class, "ImageGalleryOptionsPanel.unavailableDuringInjestLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java index 51c0b5cb85..5a89b5f257 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryPreferences.java @@ -29,7 +29,7 @@ class ImageGalleryPreferences { private static final Preferences preferences = NbPreferences.forModule(ImageGalleryPreferences.class); /** key for the listening enabled for new cases setting */ - private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; //NON-NLS + private static final String ENABLED_BY_DEFAULT = "enabled_by_default"; /** * Return setting of whether Image Analyzer should be automatically enabled diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java index e927312ee3..d1e8f3a236 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java @@ -68,7 +68,7 @@ import org.sleuthkit.autopsy.imagegallery.gui.navpanel.HashHitGroupList; }) public final class ImageGalleryTopComponent extends TopComponent implements ExplorerManager.Provider, Lookup.Provider { - public final static String PREFERRED_ID = "ImageGalleryTopComponent"; // NON-NLS + public final static String PREFERRED_ID = "ImageGalleryTopComponent"; private static final Logger LOGGER = Logger.getLogger(ImageGalleryTopComponent.class.getName()); private static boolean topComponentInitialized = false; @@ -81,11 +81,11 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl // } // } // timeLineController.openTimeLine(); - final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent(PREFERRED_ID); + final ImageGalleryTopComponent tc = (ImageGalleryTopComponent) WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); if (tc != null) { topComponentInitialized = true; WindowManager.getDefault().isTopComponentFloating(tc); - Mode mode = WindowManager.getDefault().findMode("timeline"); // NON-NLS + Mode mode = WindowManager.getDefault().findMode("timeline"); if (mode != null) { mode.dockInto(tc); } @@ -96,12 +96,12 @@ public final class ImageGalleryTopComponent extends TopComponent implements Expl public static void closeTopComponent() { if (topComponentInitialized) { - final TopComponent etc = WindowManager.getDefault().findTopComponent(PREFERRED_ID); + final TopComponent etc = WindowManager.getDefault().findTopComponent("ImageGalleryTopComponent"); if (etc != null) { try { etc.close(); } catch (Exception e) { - LOGGER.log(Level.SEVERE, "failed to close " + PREFERRED_ID, e); // NON-NLS + LOGGER.log(Level.SEVERE, "failed to close ImageGalleryTopComponent", e); } } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java index 89a40977f3..75a35fc798 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java @@ -37,9 +37,9 @@ import org.sleuthkit.autopsy.coreutils.Logger; */ class PerCaseProperties { - public static final String ENABLED = "enabled"; //NON-NLS + public static final String ENABLED = "enabled"; - public static final String STALE = "stale"; //NON-NLS + public static final String STALE = "stale"; private final Case theCase; @@ -88,7 +88,7 @@ class PerCaseProperties { * @return true if the config exists, false otherwise. */ public synchronized boolean configExists(String moduleName) { - Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); //NON-NLS + Path get = Paths.get(theCase.getModuleDirectory(), moduleName, theCase.getName() + ".properties"); return Files.exists(get); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java index a0c962c775..67c4a10dfa 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java @@ -101,7 +101,7 @@ public enum ThumbnailCache { try { return cache.get(file.getId(), () -> load(file)); } catch (UncheckedExecutionException | CacheLoader.InvalidCacheLoadException | ExecutionException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + file.getName(), ex.getCause()); return null; } } @@ -111,7 +111,7 @@ public enum ThumbnailCache { try { return get(ImageGalleryController.getDefault().getFileFromId(fileID)); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to load thumbnail for file: " + fileID, ex.getCause()); return null; } } @@ -142,9 +142,9 @@ public enum ThumbnailCache { return cachedThumbnail; } } catch (MalformedURLException ex) { - LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to parse cache file path: " + cachFile.getPath(), ex); } catch (IOException ex) { - LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to read cache file " + cachFile.getPath(), ex); } } return null; @@ -176,7 +176,7 @@ public enum ThumbnailCache { return Optional.of(ImageUtils.getCachedThumbnailFile(file.getAbstractFile(), MAX_THUMBNAIL_SIZE)); } catch (Exception e) { - LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to create cache file.{0}", e.getLocalizedMessage()); return Optional.empty(); } } @@ -193,7 +193,7 @@ public enum ThumbnailCache { try { cache.put(Long.MIN_VALUE, newGetThumbnailTask.get()); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "There was an exception even though thumbnail task succedded for. This should not be possible.", ex); } } }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java index 92e9a979c2..28a377aade 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddDrawableTagAction.java @@ -28,8 +28,6 @@ import javafx.application.Platform; import javafx.scene.control.Alert; import javafx.scene.control.Menu; import javax.swing.SwingWorker; - -import org.openide.util.NbBundle; import org.openide.util.Utilities; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -61,12 +59,8 @@ public class AddDrawableTagAction extends AddTagAction { } @Override - @NbBundle.Messages({"AddDrawableTagAction.displayName.plural=Tag Files", - "AddDrawableTagAction.displayName.singular=Tag File"}) protected String getActionDisplayName() { - return Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1 - ? Bundle.AddDrawableTagAction_displayName_plural() - : Bundle.AddDrawableTagAction_displayName_singular(); + return Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size() > 1 ? "Tag Files" : "Tag File"; } @Override @@ -76,8 +70,6 @@ public class AddDrawableTagAction extends AddTagAction { } @Override - @NbBundle.Messages({"# {0} - fileID", - "AddDrawableTagAction.addTagsToFiles.alert=Unable to tag file {0}."}) public void addTagsToFiles(TagName tagName, String comment, Set selectedFiles) { new SwingWorker() { @@ -86,7 +78,7 @@ public class AddDrawableTagAction extends AddTagAction { for (Long fileID : selectedFiles) { try { final DrawableFile file = controller.getFileFromId(fileID); - LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); //NON-NLS + LOGGER.log(Level.INFO, "tagging {0} with {1} and comment {2}", new Object[]{file.getName(), tagName.getDisplayName(), comment}); // check if the same tag is being added for the same abstract file. DrawableTagsManager tagsManager = controller.getTagsManager(); @@ -97,16 +89,16 @@ public class AddDrawableTagAction extends AddTagAction { .findAny(); if (duplicateTagName.isPresent()) { - LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS + LOGGER.log(Level.INFO, "{0} already tagged as {1}. Skipping.", new Object[]{file.getName(), tagName.getDisplayName()}); } else { - LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); //NON-NLS + LOGGER.log(Level.INFO, "Tagging {0} as {1}", new Object[]{file.getName(), tagName.getDisplayName()}); controller.getTagsManager().addContentTag(file, tagName, comment); } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); //NON-NLS + LOGGER.log(Level.SEVERE, "Error tagging file", tskCoreException); Platform.runLater(() -> { - new Alert(Alert.AlertType.ERROR, Bundle.AddDrawableTagAction_addTagsToFiles_alert(fileID)).show(); + new Alert(Alert.AlertType.ERROR, "Unable to tag file " + fileID + ".").show(); }); } } @@ -119,7 +111,7 @@ public class AddDrawableTagAction extends AddTagAction { try { get(); } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "unexpected exception while tagging files", ex); } } }.execute(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java index 7742ec583c..91c2af6503 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/AddTagAction.java @@ -25,8 +25,6 @@ import javafx.event.ActionEvent; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javax.swing.SwingUtilities; - -import org.openide.util.NbBundle; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.actions.GetTagNameAndCommentDialog; @@ -73,17 +71,13 @@ abstract class AddTagAction { */ // @@@ This user interface has some significant usability issues and needs // to be reworked. - @NbBundle.Messages({"AddTagAction.menuItem.quickTag=Quick Tag", - "AddTagAction.menuItem.noTags=No tags", - "AddTagAction.menuItem.newTag=New Tag...", - "AddTagAction.menuItem.tagAndComment=Tag and Comment..."}) protected class TagMenu extends Menu { TagMenu(ImageGalleryController controller) { super(getActionDisplayName()); // Create a "Quick Tag" sub-menu. - Menu quickTagMenu = new Menu(Bundle.AddTagAction_menuItem_quickTag()); + Menu quickTagMenu = new Menu("Quick Tag"); getItems().add(quickTagMenu); /* @@ -93,7 +87,7 @@ abstract class AddTagAction { */ Collection tagNames = controller.getTagsManager().getNonCategoryTagNames(); if (tagNames.isEmpty()) { - MenuItem empty = new MenuItem(Bundle.AddTagAction_menuItem_noTags()); + MenuItem empty = new MenuItem("No tags"); empty.setDisable(true); quickTagMenu.getItems().add(empty); } else { @@ -111,7 +105,7 @@ abstract class AddTagAction { * Selecting this item initiates a dialog that can be used to create * or select a tag name and adds a tag with the resulting name. */ - MenuItem newTagMenuItem = new MenuItem(Bundle.AddTagAction_menuItem_newTag()); + MenuItem newTagMenuItem = new MenuItem("New Tag..."); newTagMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TagName tagName = GetTagNameDialog.doDialog(getIGWindow()); @@ -128,7 +122,7 @@ abstract class AddTagAction { * name with an optional comment and adds a tag with the resulting * name. */ - MenuItem tagAndCommentItem = new MenuItem(Bundle.AddTagAction_menuItem_tagAndComment()); + MenuItem tagAndCommentItem = new MenuItem("Tag and Comment..."); tagAndCommentItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { GetTagNameAndCommentDialog.TagNameAndComment tagNameAndComment = GetTagNameAndCommentDialog.doDialog(getIGWindow()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java index 1b051e6fb2..4488d94967 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Back.java @@ -24,7 +24,6 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -33,13 +32,12 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm public class Back extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); //NON-NLS + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow-180.png", 16, 16, true, true, true); private final ImageGalleryController controller; - @NbBundle.Messages({"Back.diplayName=Back"}) public Back(ImageGalleryController controller) { - super(Bundle.Back_displayName()); + super("Back"); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.LEFT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java index 8c819373c8..9d89b4fb1b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/CategorizeAction.java @@ -35,8 +35,6 @@ import javafx.scene.input.KeyCodeCombination; import javax.annotation.Nonnull; import javax.annotation.concurrent.Immutable; import javax.swing.JOptionPane; - -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.Category; @@ -54,7 +52,6 @@ import org.sleuthkit.datamodel.TskCoreException; * TODO: since we are not using actionsGlobalContext anymore and this has * diverged from autopsy action, make this extend from controlsfx Action */ -@NbBundle.Messages({"CategorizeAction.displayName=Categorize"}) public class CategorizeAction extends AddTagAction { private static final Logger LOGGER = Logger.getLogger(CategorizeAction.class.getName()); @@ -74,7 +71,7 @@ public class CategorizeAction extends AddTagAction { @Override protected String getActionDisplayName() { - return Bundle.CategorizeAction_displayName(); + return "Categorize"; } @Override @@ -89,7 +86,7 @@ public class CategorizeAction extends AddTagAction { } public void addTagsToFiles(TagName tagName, String comment, Set selectedFiles, boolean createUndo) { - Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); //NON-NLS + Logger.getAnonymousLogger().log(Level.INFO, "categorizing{0} as {1}", new Object[]{selectedFiles.toString(), tagName.getDisplayName()}); controller.queueDBWorkerTask(new CategorizeTask(selectedFiles, tagName, comment, createUndo)); } @@ -100,7 +97,7 @@ public class CategorizeAction extends AddTagAction { static private class CategoryMenu extends Menu { CategoryMenu(ImageGalleryController controller) { - super(Bundle.CategorizeAction_displayName()); + super("Categorize"); // Each category get an item in the sub-menu. Selecting one of these menu items adds // a tag with the associated category. @@ -117,9 +114,6 @@ public class CategorizeAction extends AddTagAction { } } - @NbBundle.Messages({"# {0} - fileID number", - "CategorizeTask.errorUnable.msg=Unable to categorize {0}.", - "CategorizeTask.errorUnable.title=Categorizing Error"}) private class CategorizeTask extends ImageGalleryController.InnerTask { private final Set fileIDs; @@ -138,7 +132,6 @@ public class CategorizeAction extends AddTagAction { } - @Override public void run() { final DrawableTagsManager tagsManager = controller.getTagsManager(); @@ -164,7 +157,7 @@ public class CategorizeAction extends AddTagAction { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error removing old categories result", ex); } }); } else { @@ -177,11 +170,8 @@ public class CategorizeAction extends AddTagAction { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error categorizing result", ex); //NON-NLS - JOptionPane.showMessageDialog(null, - Bundle.CategorizeTask_errorUnable_msg(fileID), - Bundle.CategorizeTask_errorUnable_title(), - JOptionPane.ERROR_MESSAGE); + LOGGER.log(Level.SEVERE, "Error categorizing result", ex); + JOptionPane.showMessageDialog(null, "Unable to categorize " + fileID + ".", "Categorizing Error", JOptionPane.ERROR_MESSAGE); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java index 57f8afa2cf..27ab1cd8b1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteFollowUpTagAction.java @@ -23,7 +23,6 @@ import java.util.logging.Level; import javafx.event.ActionEvent; import javax.swing.SwingWorker; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; @@ -39,9 +38,8 @@ public class DeleteFollowUpTagAction extends Action { private static final Logger LOGGER = Logger.getLogger(DeleteFollowUpTagAction.class.getName()); - @NbBundle.Messages("DeleteFollwUpTagAction.displayName=Delete Follow Up Tag") public DeleteFollowUpTagAction(final ImageGalleryController controller, final DrawableFile file) { - super(Bundle.DeleteFollwUpTagAction_displayName()); + super("Delete Follow Up Tag"); setEventHandler((ActionEvent t) -> { new SwingWorker() { @@ -59,7 +57,7 @@ public class DeleteFollowUpTagAction extends Action { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); } return null; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java index 1688d6e6d2..c94cfc5ffb 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/Forward.java @@ -24,22 +24,20 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * */ //TODO: This and the corresponding timeline action are identical except for the type of the controller... abstract something! -jm -@NbBundle.Messages({"Forward.displayName=Forward"}) public class Forward extends Action { - private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); //NON-NLS + private static final Image BACK_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/arrow.png", 16, 16, true, true, true); private final ImageGalleryController controller; public Forward(ImageGalleryController controller) { - super(Bundle.Forward_displayName()); + super("Forward"); setGraphic(new ImageView(BACK_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.RIGHT, KeyCodeCombination.ALT_DOWN)); this.controller = controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java index a5e9215a6b..0d446cda84 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java @@ -26,7 +26,6 @@ import javafx.event.ActionEvent; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; @@ -35,17 +34,15 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; * Marks the currently fisplayed group as "seen" and advances to the next unseen * group */ -@NbBundle.Messages({"NextUnseenGroup.markGroupSeen=Mark Group Seen", - "NextUnseenGroup.nextUnseenGroup=Next Unseen group"}) public class NextUnseenGroup extends Action { private static final Image END = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); //NON-NLS + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-stop.png")); private static final Image ADVANCE = - new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); //NON-NLS + new Image(NextUnseenGroup.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/control-double.png")); - private static final String MARK_GROUP_SEEN = Bundle.NextUnseenGroup_markGroupSeen(); - private static final String NEXT_UNSEEN_GROUP = Bundle.NextUnseenGroup_nextUnseenGroup(); + private static final String MARK_GROUP_SEEN = "Mark Group Seen"; + private static final String NEXT_UNSEEN_GROUP = "Next Unseen group"; private final ImageGalleryController controller; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java index a758107da5..b1f1f651b7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java @@ -41,14 +41,10 @@ import org.sleuthkit.autopsy.imagegallery.ImageGalleryTopComponent; @ActionRegistration( // iconBase = "org/sleuthkit/autopsy/imagegallery/images/lightbulb.png", lazy = false, displayName = "#CTL_OpenAction") -@Messages({"CTL_OpenAction=View Images/Videos", - "OpenAction.stale.confDlg.msg=The image / video database may be out of date. " + - "Do you want to update and listen for further ingest results?\n" + - "Choosing 'yes' will update the database and enable listening to future ingests.", - "OpenAction.stale.confDlg.title=Image Gallery"}) +@Messages("CTL_OpenAction=View Images/Videos") public final class OpenAction extends CallableSystemAction { - private static final String VIEW_IMAGES_VIDEOS = Bundle.CTL_OpenAction(); + private static final String VIEW_IMAGES_VIDEOS = "View Images/Videos"; private static final boolean fxInited = Installer.isJavaFxInited(); @@ -87,8 +83,11 @@ public final class OpenAction extends CallableSystemAction { if (ImageGalleryModule.isDrawableDBStale(currentCase)) { //drawable db is stale, ask what to do - int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), Bundle.OpenAction.stale.confDlg.msg(), - Bundle.OpenAction_stale_confDlg.title(), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + int answer = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), "The image / video database may be out of date. " + "Do you want to update and listen for further ingest results?\n" + + "Choosing 'yes' will update the database and enable listening to future ingests." + + " Choosing 'no' will display the out of date results." + + " Choosing 'cancel' will close the image /video gallery", + "Image Gallery", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); switch (answer) { case JOptionPane.YES_OPTION: diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java index 20d6357241..ba33d077ba 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenExternalViewerAction.java @@ -32,15 +32,14 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; * Wraps {@link ExternalViewerAction} in a ControlsFX {@link Action} with * appropriate text and graphic */ -@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer", - "OpenExternalViewerAction.displayName=External Viewer"}) +@NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer"}) public class OpenExternalViewerAction extends Action { - private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); //NON-NLS + private static final Image EXTERNAL = new Image(OpenExternalViewerAction.class.getResource("/org/sleuthkit/autopsy/imagegallery/images/external.png").toExternalForm()); private static final ActionEvent ACTION_EVENT = new ActionEvent(OpenExternalViewerAction.class, ActionEvent.ACTION_PERFORMED, ""); //Swing ActionEvent //NOI18N public OpenExternalViewerAction(DrawableFile file) { - super(Bundle.OpenExternalViewerAction_displayName()); + super("External Viewer"); /** * TODO: why is the name passed to the action? it means we duplicate diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java index 265412146f..a75a786317 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenHelpAction.java @@ -44,9 +44,9 @@ public final class OpenHelpAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { try { - Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); //NON-NLS + Desktop.getDesktop().browse(URI.create("http://sleuthkit.org/autopsy/docs/user-docs/4.0/image_gallery_page.html")); } catch (IOException ex) { - Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); //NON-NLS + Logger.getLogger(OpenHelpAction.class.getName()).log(Level.SEVERE, "failed to open help page", ex); } } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java index 2e0f4d0d9d..e3ce54cd7c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/RedoAction.java @@ -23,19 +23,17 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * Action that redoes the last undone command */ -@NbBundle.Messages({"RedoAction.name=Redo"}) public class RedoAction extends Action { - private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); //NON-NLS + private static final Image REDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/redo.png", 16, 16, true, true, true); public RedoAction(ImageGalleryController controller) { - super(Bundle.RedoAction_name()); + super("Redo"); setGraphic(new ImageView(REDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Y, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().redo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java index 1cc673808f..0285c57bb7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/UndoAction.java @@ -23,19 +23,17 @@ import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import org.controlsfx.control.action.Action; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** * Action that undoes the last undoable command */ -@NbBundle.Messages({"UndoAction.displayName=Undo"}) public class UndoAction extends Action { - private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); //NON-NLS + private static final Image UNDO_IMAGE = new Image("/org/sleuthkit/autopsy/imagegallery/images/undo.png", 16, 16, true, true, true); public UndoAction(ImageGalleryController controller) { - super(Bundle.UndoAction_displayName()); + super("Undo"); setGraphic(new ImageView(UNDO_IMAGE)); setAccelerator(new KeyCodeCombination(KeyCode.Z, KeyCodeCombination.CONTROL_DOWN)); setEventHandler(actionEvent -> controller.getUndoManager().undo()); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java index 5717828fe7..1567a1b2b4 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/Category.java @@ -24,17 +24,10 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import javafx.scene.paint.Color; -import org.openide.util.NbBundle; /** * Enum to represent the six categories in the DHS image categorization scheme. */ -@NbBundle.Messages({"Category.one=CAT-1: Child Exploitation (Illegal)", - "Category.two=CAT-2: Child Exploitation (Non-Illegal/Age Difficult)", - "Category.three=CAT-3: CGI/Animation (Child Exploitive)", - "Category.four=CAT-4: Exemplar/Comparison (Internal Use Only)", - "Category.five=CAT-5: Non-pertinent", - "Category.zero=CAT-0: Uncategorized"}) public enum Category { /* @@ -42,12 +35,12 @@ public enum Category { * preserves the fact that lower category numbers are first/most sever, * except 0 which is last */ - ONE(Color.RED, 1, Bundle.Category_one()), - TWO(Color.ORANGE, 2, Bundle.Category_two()), - THREE(Color.YELLOW, 3, Bundle.Category_three()), - FOUR(Color.BISQUE, 4, Bundle.Category_four()), - FIVE(Color.GREEN, 5, Bundle.Category_five()), - ZERO(Color.LIGHTGREY, 0, Bundle.Category_zero()); + ONE(Color.RED, 1, "CAT-1: Child Exploitation (Illegal)"), + TWO(Color.ORANGE, 2, "CAT-2: Child Exploitation (Non-Illegal/Age Difficult)"), + THREE(Color.YELLOW, 3, "CAT-3: CGI/Animation (Child Exploitive)"), + FOUR(Color.BISQUE, 4, "CAT-4: Exemplar/Comparison (Internal Use Only)"), + FIVE(Color.GREEN, 5, "CAT-5: Non-pertinent"), + ZERO(Color.LIGHTGREY, 0, "CAT-0: Uncategorized"); public static ImmutableList getNonZeroCategories() { return nonZeroCategories; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java index 464c2492b0..d2018d422c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java @@ -68,8 +68,8 @@ public class CategoryManager { * Used to distribute {@link CategoryChangeEvent}s */ private final EventBus categoryEventBus = new AsyncEventBus(Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS - LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); //NON-NLS + new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { + LOGGER.log(Level.SEVERE, "Uncaught exception in category event bus handler", e); }).build() )); @@ -176,7 +176,7 @@ public class CategoryManager { longAdder.add(db.getCategoryCount(cat)); longAdder.increment(); } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS + LOGGER.log(Level.WARNING, "Case closed while getting files"); } return longAdder; } @@ -210,8 +210,8 @@ public class CategoryManager { try { categoryEventBus.unregister(listener); } catch (IllegalArgumentException e) { - if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { //NON-NLS - LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); //NON-NLS + if (e.getMessage().contains("missing event subscriber for an annotated method. Is " + listener + " registered?")) { + LOGGER.log(Level.WARNING, "Attempted to unregister {0} for category change events, but it was not registered.", listener.toString()); } else { throw e; } @@ -254,12 +254,12 @@ public class CategoryManager { try { tagsManager.deleteContentTag(ct); } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to delete content tag. Unable to maintain categories in a consistent state.", tskException); } } } } catch (TskCoreException tskException) { - LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get content tags for content. Unable to maintain category in a consistent state.", tskException); } Category newCat = CategoryManager.categoryFromTagName(addedTag.getName()); if (newCat != Category.ZERO) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java index 8222c1effe..eb3a7ed64d 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableAttribute.java @@ -27,7 +27,6 @@ import javafx.beans.property.ReadOnlyStringWrapper; import javafx.beans.property.StringProperty; import javafx.scene.image.Image; import org.apache.commons.lang3.StringUtils; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.datamodel.ContentUtils; import org.sleuthkit.datamodel.TagName; @@ -38,37 +37,22 @@ import org.sleuthkit.datamodel.TagName; * TODO: Review and refactor DrawableAttribute related code with an eye to usage * of type paramaters and multivalued attributes */ -@NbBundle.Messages({"DrawableAttribute.md5hash=MD5 Hash", - "DrawableAttribute.name=Name", - "DrawableAttribute.analyzed=Analyzed", - "DrawableAttribute.category=Category", - "DrawableAttribute.tags=Tags", - "DrawableAttribute.path=Path", - "DrawableAttribute.createdTime=Created Time", - "DrawableAttribute.modifiedTime=Modified Time", - "DrawableAttribute.cameraMake=Camera Make", - "DrawableAttribute.cameraModel=Camera Model", - "DrawableAttribute.hashSet=Hashset", - "DrawableAttribute.intObjID=Internal Object ID", - "DrawableAttribute.width=Width", - "DrawableAttribute.height=Height", - "DrawableAttribute.mimeType=MIME type"}) public class DrawableAttribute> { public final static DrawableAttribute MD5_HASH = - new DrawableAttribute<>(AttributeName.MD5_HASH, Bundle.DrawableAttribute_md5hash(), + new DrawableAttribute<>(AttributeName.MD5_HASH, "MD5 Hash", false, - "icon-hashtag.png", // NON-NLS + "icon-hashtag.png", f -> Collections.singleton(f.getMd5Hash())); public final static DrawableAttribute NAME = - new DrawableAttribute<>(AttributeName.NAME, Bundle.DrawableAttribute_name(), + new DrawableAttribute<>(AttributeName.NAME, "Name", true, - "folder-rename.png", //NON-NLS + "folder-rename.png", f -> Collections.singleton(f.getName())); public final static DrawableAttribute ANALYZED = - new DrawableAttribute<>(AttributeName.ANALYZED, Bundle.DrawableAttribute_analyzed(), + new DrawableAttribute<>(AttributeName.ANALYZED, "Analyzed", true, "", f -> Collections.singleton(f.isAnalyzed())); @@ -82,75 +66,75 @@ public class DrawableAttribute> { * advantage. move categories into DrawableDB? */ public final static DrawableAttribute CATEGORY = - new DrawableAttribute<>(AttributeName.CATEGORY, Bundle.DrawableAttribute_category(), + new DrawableAttribute<>(AttributeName.CATEGORY, "Category", false, - "category-icon.png", //NON-NLS + "category-icon.png", f -> Collections.singleton(f.getCategory())); public final static DrawableAttribute TAGS = - new DrawableAttribute<>(AttributeName.TAGS, Bundle.DrawableAttribute_tags(), + new DrawableAttribute<>(AttributeName.TAGS, "Tags", false, - "tag_red.png", //NON-NLS + "tag_red.png", DrawableFile::getTagNames); public final static DrawableAttribute PATH = - new DrawableAttribute<>(AttributeName.PATH, Bundle.DrawableAttribute_path(), + new DrawableAttribute<>(AttributeName.PATH, "Path", true, - "folder_picture.png", //NON-NLS + "folder_picture.png", f -> Collections.singleton(f.getDrawablePath())); public final static DrawableAttribute CREATED_TIME = - new DrawableAttribute<>(AttributeName.CREATED_TIME, Bundle.DrawableAttribute_createdTime(), + new DrawableAttribute<>(AttributeName.CREATED_TIME, "Created Time", true, - "clock--plus.png", //NON-NLS + "clock--plus.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getCrtime(), f))); public final static DrawableAttribute MODIFIED_TIME = - new DrawableAttribute<>(AttributeName.MODIFIED_TIME, Bundle.DrawableAttribute_modifiedTime(), + new DrawableAttribute<>(AttributeName.MODIFIED_TIME, "Modified Time", true, - "clock--pencil.png", //NON-NLS + "clock--pencil.png", f -> Collections.singleton(ContentUtils.getStringTime(f.getMtime(), f))); public final static DrawableAttribute MAKE = - new DrawableAttribute<>(AttributeName.MAKE, Bundle.DrawableAttribute_cameraMake(), + new DrawableAttribute<>(AttributeName.MAKE, "Camera Make", true, - "camera.png", //NON-NLS + "camera.png", f -> Collections.singleton(f.getMake())); public final static DrawableAttribute MODEL = - new DrawableAttribute<>(AttributeName.MODEL, Bundle.DrawableAttribute_cameraModel(), + new DrawableAttribute<>(AttributeName.MODEL, "Camera Model", true, - "camera.png", //NON-NLS + "camera.png", f -> Collections.singleton(f.getModel())); public final static DrawableAttribute HASHSET = - new DrawableAttribute<>(AttributeName.HASHSET, Bundle.DrawableAttribute_hashSet(), + new DrawableAttribute<>(AttributeName.HASHSET, "Hashset", true, - "hashset_hits.png", //NON-NLS + "hashset_hits.png", DrawableFile::getHashSetNamesUnchecked); public final static DrawableAttribute OBJ_ID = - new DrawableAttribute<>(AttributeName.OBJ_ID, Bundle.DrawableAttribute_intObjID(), + new DrawableAttribute<>(AttributeName.OBJ_ID, "Internal Object ID", true, "", f -> Collections.singleton(f.getId())); public final static DrawableAttribute WIDTH = - new DrawableAttribute<>(AttributeName.WIDTH, Bundle.DrawableAttribute_width(), + new DrawableAttribute<>(AttributeName.WIDTH, "Width", false, - "arrow-resize.png", //NON-NLS + "arrow-resize.png", f -> Collections.singleton(f.getWidth())); public final static DrawableAttribute HEIGHT = - new DrawableAttribute<>(AttributeName.HEIGHT, Bundle.DrawableAttribute_height(), + new DrawableAttribute<>(AttributeName.HEIGHT, "Height", false, - "arrow-resize-090.png", //NON-NLS + "arrow-resize-090.png", f -> Collections.singleton(f.getHeight())); public final static DrawableAttribute MIME_TYPE = - new DrawableAttribute<>(AttributeName.MIME_TYPE, Bundle.DrawableAttribute_mimeType(), + new DrawableAttribute<>(AttributeName.MIME_TYPE, "MIME type", false, - "mime_types.png", //NON-NLS + "mime_types.png", f -> Collections.singleton(f.getMIMEType())); final private static List< DrawableAttribute> groupables = @@ -186,7 +170,7 @@ public class DrawableAttribute> { * time they are needed */ if (null == icon && StringUtils.isNotBlank(imageName)) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); } return icon; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java index 079be33ff4..61ef672bc2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java @@ -77,11 +77,11 @@ public final class DrawableDB { private static final org.sleuthkit.autopsy.coreutils.Logger LOGGER = Logger.getLogger(DrawableDB.class.getName()); //column name constants////////////////////// - private static final String ANALYZED = "analyzed"; //NON-NLS + private static final String ANALYZED = "analyzed"; - private static final String OBJ_ID = "obj_id"; //NON-NLS + private static final String OBJ_ID = "obj_id"; - private static final String HASH_SET_NAME = "hash_set_name"; //NON-NLS + private static final String HASH_SET_NAME = "hash_set_name"; private final PreparedStatement insertHashSetStmt; @@ -140,7 +140,7 @@ public final class DrawableDB { try { Class.forName("org.sqlite.JDBC"); } catch (ClassNotFoundException ex) { - LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to load sqlite JDBC driver", ex); } } private final SleuthkitCase tskCase; @@ -201,33 +201,33 @@ public final class DrawableDB { Files.createDirectories(dbPath.getParent()); if (initializeDBSchema()) { updateFileStmt = prepareStatement( - "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS - + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS + "INSERT OR REPLACE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " + + "VALUES (?,?,?,?,?,?,?,?)"); insertFileStmt = prepareStatement( - "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " //NON-NLS - + "VALUES (?,?,?,?,?,?,?,?)"); //NON-NLS + "INSERT OR IGNORE INTO drawable_files (obj_id , path, name, created_time, modified_time, make, model, analyzed) " + + "VALUES (?,?,?,?,?,?,?,?)"); - removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); //NON-NLS + removeFileStmt = prepareStatement("DELETE FROM drawable_files WHERE obj_id = ?"); - pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); //NON-NLS - nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); //NON-NLS - created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); //NON-NLS - modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); //NON-NLS - makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); //NON-NLS - modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); //NON-NLS - analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); //NON-NLS - hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); //NON-NLS + pathGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE path = ? ", DrawableAttribute.PATH); + nameGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE name = ? ", DrawableAttribute.NAME); + created_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE created_time = ? ", DrawableAttribute.CREATED_TIME); + modified_timeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE modified_time = ? ", DrawableAttribute.MODIFIED_TIME); + makeGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE make = ? ", DrawableAttribute.MAKE); + modelGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE model = ? ", DrawableAttribute.MODEL); + analyzedGroupStmt = prepareStatement("SELECT obj_id , analyzed FROM drawable_files WHERE analyzed = ?", DrawableAttribute.ANALYZED); + hashSetGroupStmt = prepareStatement("SELECT drawable_files.obj_id AS obj_id, analyzed FROM drawable_files , hash_sets , hash_set_hits WHERE drawable_files.obj_id = hash_set_hits.obj_id AND hash_sets.hash_set_id = hash_set_hits.hash_set_id AND hash_sets.hash_set_name = ?", DrawableAttribute.HASHSET); - updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); //NON-NLS - insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); //NON-NLS + updateGroupStmt = prepareStatement("insert or replace into groups (seen, value, attribute) values( ?, ? , ?)"); + insertGroupStmt = prepareStatement("insert or ignore into groups (value, attribute) values (?,?)"); - groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); //NON-NLS + groupSeenQueryStmt = prepareStatement("SELECT seen FROM groups WHERE value = ? AND attribute = ?"); - selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); //NON-NLS - insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); //NON-NLS - selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); //NON-NLS + selectHashSetNamesStmt = prepareStatement("SELECT DISTINCT hash_set_name FROM hash_sets"); + insertHashSetStmt = prepareStatement("INSERT OR IGNORE INTO hash_sets (hash_set_name) VALUES (?)"); + selectHashSetStmt = prepareStatement("SELECT hash_set_id FROM hash_sets WHERE hash_set_name = ?"); - insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); //NON-NLS + insertHashHitStmt = prepareStatement("INSERT OR IGNORE INTO hash_set_hits (hash_set_id, obj_id) VALUES (?,?)"); for (Category cat : Category.values()) { insertGroup(cat.getDisplayName(), DrawableAttribute.CATEGORY); @@ -289,12 +289,12 @@ public final class DrawableDB { public static DrawableDB getDrawableDB(Path dbPath, ImageGalleryController controller) { try { - return new DrawableDB(dbPath.resolve("drawable.db"), controller); //NON-NLS + return new DrawableDB(dbPath.resolve("drawable.db"), controller); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "sql error creating database connection", ex); return null; } catch (ExceptionInInitializerError | IOException ex) { - LOGGER.log(Level.SEVERE, "error creating database connection", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "error creating database connection", ex); return null; } } @@ -304,33 +304,33 @@ public final class DrawableDB { //this should match Sleuthkit db setupt try (Statement statement = con.createStatement()) { //reduce i/o operations, we have no OS crash recovery anyway - statement.execute("PRAGMA synchronous = OFF;"); //NON-NLS + statement.execute("PRAGMA synchronous = OFF;"); //allow to query while in transaction - no need read locks - statement.execute("PRAGMA read_uncommitted = True;"); //NON-NLS + statement.execute("PRAGMA read_uncommitted = True;"); //TODO: do we need this? - statement.execute("PRAGMA foreign_keys = ON"); //NON-NLS + statement.execute("PRAGMA foreign_keys = ON"); //TODO: test this - statement.execute("PRAGMA journal_mode = MEMORY"); //NON-NLS + statement.execute("PRAGMA journal_mode = MEMORY"); // //we don't use this feature, so turn it off for minimal speed up on queries //this is deprecated and not recomended - statement.execute("PRAGMA count_changes = OFF;"); //NON-NLS + statement.execute("PRAGMA count_changes = OFF;"); //this made a big difference to query speed - statement.execute("PRAGMA temp_store = MEMORY"); //NON-NLS + statement.execute("PRAGMA temp_store = MEMORY"); //this made a modest improvement in query speeds - statement.execute("PRAGMA cache_size = 50000"); //NON-NLS + statement.execute("PRAGMA cache_size = 50000"); //we never delete anything so... - statement.execute("PRAGMA auto_vacuum = 0"); //NON-NLS + statement.execute("PRAGMA auto_vacuum = 0"); } try { - LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", //NON-NLS + LOGGER.log(Level.INFO, String.format("sqlite-jdbc version %s loaded in %s mode", SQLiteJDBCLoader.getVersion(), SQLiteJDBCLoader.isNativeMode() - ? "native" : "pure-java")); //NON-NLS + ? "native" : "pure-java")); } catch (Exception exception) { - LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); //NON-NLS + LOGGER.log(Level.WARNING, "exception while checking sqlite-jdbc version and mode", exception); } } @@ -349,92 +349,92 @@ public final class DrawableDB { setPragmas(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem accessing database", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem accessing database", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists drawable_files " //NON-NLS - + "( obj_id INTEGER PRIMARY KEY, " //NON-NLS - + " path VARCHAR(255), " //NON-NLS - + " name VARCHAR(255), " //NON-NLS - + " created_time integer, " //NON-NLS - + " modified_time integer, " //NON-NLS - + " make VARCHAR(255), " //NON-NLS - + " model VARCHAR(255), " //NON-NLS - + " analyzed integer DEFAULT 0)"; //NON-NLS + String sql = "CREATE TABLE if not exists drawable_files " + + "( obj_id INTEGER PRIMARY KEY, " + + " path VARCHAR(255), " + + " name VARCHAR(255), " + + " created_time integer, " + + " modified_time integer, " + + " make VARCHAR(255), " + + " model VARCHAR(255), " + + " analyzed integer DEFAULT 0)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating drawable_files table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists groups " //NON-NLS - + "(group_id INTEGER PRIMARY KEY, " //NON-NLS - + " value VARCHAR(255) not null, " //NON-NLS - + " attribute VARCHAR(255) not null, " //NON-NLS - + " seen integer DEFAULT 0, " //NON-NLS - + " UNIQUE(value, attribute) )"; //NON-NLS + String sql = "CREATE TABLE if not exists groups " + + "(group_id INTEGER PRIMARY KEY, " + + " value VARCHAR(255) not null, " + + " attribute VARCHAR(255) not null, " + + " seen integer DEFAULT 0, " + + " UNIQUE(value, attribute) )"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating groups table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating groups table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_sets " //NON-NLS - + "( hash_set_id INTEGER primary key," //NON-NLS - + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; //NON-NLS + String sql = "CREATE TABLE if not exists hash_sets " + + "( hash_set_id INTEGER primary key," + + " hash_set_name VARCHAR(255) UNIQUE NOT NULL)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating hash_sets table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE TABLE if not exists hash_set_hits " //NON-NLS - + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " //NON-NLS - + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " //NON-NLS - + " PRIMARY KEY (hash_set_id, obj_id))"; //NON-NLS + String sql = "CREATE TABLE if not exists hash_set_hits " + + "(hash_set_id INTEGER REFERENCES hash_sets(hash_set_id) not null, " + + " obj_id INTEGER REFERENCES drawable_files(obj_id) not null, " + + " PRIMARY KEY (hash_set_id, obj_id))"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "problem creating hash_set_hits table", ex); return false; } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; //NON-NLS + String sql = "CREATE INDEX if not exists path_idx ON drawable_files(path)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating path_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating path_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; //NON-NLS + String sql = "CREATE INDEX if not exists name_idx ON drawable_files(name)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating name_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating name_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; //NON-NLS + String sql = "CREATE INDEX if not exists make_idx ON drawable_files(make)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating make_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating make_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; //NON-NLS + String sql = "CREATE INDEX if not exists model_idx ON drawable_files(model)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating model_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating model_idx", ex); } try (Statement stmt = con.createStatement()) { - String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; //NON-NLS + String sql = "CREATE INDEX if not exists analyzed_idx ON drawable_files(analyzed)"; stmt.execute(sql); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem creating analyzed_idx", ex); } return true; @@ -455,7 +455,7 @@ public final class DrawableDB { closeStatements(); con.close(); } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to close connection to drawable.db", ex); } } con = null; @@ -464,10 +464,10 @@ public final class DrawableDB { public void openDBCon() { try { if (con == null || con.isClosed()) { - con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); //NON-NLS + con = DriverManager.getConnection("jdbc:sqlite:" + dbPath.toString()); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to open connection to drawable.db", ex); } } @@ -518,7 +518,7 @@ public final class DrawableDB { names.add(rs.getString(HASH_SET_NAME)); } } catch (SQLException sQLException) { - LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get hash set names", sQLException); } finally { dbReadUnlock(); } @@ -533,11 +533,11 @@ public final class DrawableDB { groupSeenQueryStmt.setString(2, groupKey.getAttribute().attrName.toString()); try (ResultSet rs = groupSeenQueryStmt.executeQuery()) { while (rs.next()) { - return rs.getBoolean("seen"); //NON-NLS + return rs.getBoolean("seen"); } } } catch (SQLException ex) { - String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); //NON-NLS + String msg = String.format("Failed to get is group seen for group key %s", groupKey.getValueDisplayName()); LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -555,7 +555,7 @@ public final class DrawableDB { updateGroupStmt.setString(3, gk.getAttribute().attrName.toString()); updateGroupStmt.execute(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error marking group as seen", ex); } finally { dbWriteUnlock(); } @@ -623,7 +623,7 @@ public final class DrawableDB { selectHashSetStmt.setString(1, name); try (ResultSet rs = selectHashSetStmt.executeQuery()) { while (rs.next()) { - int hashsetID = rs.getInt("hash_set_id"); //NON-NLS + int hashsetID = rs.getInt("hash_set_id"); //"insert or ignore into hash_set_hits (hash_set_id, obj_id) values (?,?)"; insertHashHitStmt.setInt(1, hashsetID); insertHashHitStmt.setLong(2, f.getId()); @@ -633,7 +633,7 @@ public final class DrawableDB { } } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to insert/update hash hits for file" + f.getName(), ex); } //and update all groups this file is in @@ -650,7 +650,7 @@ public final class DrawableDB { // This is one of the places where we get an error if the case is closed during processing, // which doesn't need to be reported here. if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to insert/update file" + f.getName(), ex); } } finally { @@ -676,12 +676,12 @@ public final class DrawableDB { public Boolean isFileAnalyzed(long fileId) { dbReadLock(); try (Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileId)) { while (analyzedQuery.next()) { return analyzedQuery.getBoolean(ANALYZED); } } catch (SQLException ex) { - String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); //NON-NLS + String msg = String.format("Failed to determine if file %s is finalized", String.valueOf(fileId)); LOGGER.log(Level.WARNING, msg, ex); } finally { dbReadUnlock(); @@ -695,12 +695,12 @@ public final class DrawableDB { dbReadLock(); try (Statement stmt = con.createStatement(); //Can't make this a preprared statement because of the IN ( ... ) - ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("SELECT COUNT(analyzed) AS analyzed FROM drawable_files WHERE analyzed = 1 AND obj_id IN (" + StringUtils.join(fileIds, ", ") + ")")) { while (analyzedQuery.next()) { return analyzedQuery.getInt(ANALYZED) == fileIds.size(); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); } finally { dbReadUnlock(); } @@ -717,7 +717,7 @@ public final class DrawableDB { // In testing, this method appears to be a lot faster than doing one large select statement for (Long fileID : fileIDsInGroup) { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("SELECT analyzed FROM drawable_files WHERE obj_id = " + fileID); while (analyzedQuery.next()) { if (analyzedQuery.getInt(ANALYZED) == 0) { return false; @@ -727,10 +727,10 @@ public final class DrawableDB { } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex); } } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); //NON-NLS + LOGGER.log(Level.WARNING, "problem counting analyzed files: ", tskCoreException); } finally { dbReadUnlock(); } @@ -756,7 +756,7 @@ public final class DrawableDB { dbReadLock(); try { statement = con.createStatement(); - rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); //NON-NLS + rs = statement.executeQuery("SELECT obj_id FROM drawable_files WHERE " + sqlWhereClause); while (rs.next()) { ret.add(rs.getLong(1)); } @@ -767,14 +767,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing result set after executing findAllFileIdsWhere", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing statement after executing findAllFileIdsWhere", ex); } } dbReadUnlock(); @@ -808,14 +808,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFilesWhere", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFilesWhere", ex); } } dbReadUnlock(); @@ -845,14 +845,14 @@ public final class DrawableDB { try { rs.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); } } dbReadUnlock(); @@ -883,15 +883,15 @@ public final class DrawableDB { default: dbReadLock(); //TODO: convert this to prepared statement - StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); //NON-NLS + StringBuilder query = new StringBuilder("SELECT " + groupBy.attrName.toString() + ", COUNT(*) FROM drawable_files GROUP BY " + groupBy.attrName.toString()); String orderByClause = ""; switch (sortBy) { case GROUP_BY_VALUE: - orderByClause = " ORDER BY " + groupBy.attrName.toString(); //NON-NLS + orderByClause = " ORDER BY " + groupBy.attrName.toString(); break; case FILE_COUNT: - orderByClause = " ORDER BY COUNT(*)"; //NON-NLS + orderByClause = " ORDER BY COUNT(*)"; break; case NONE: // case PRIORITY: @@ -905,10 +905,10 @@ public final class DrawableDB { switch (sortOrder) { case DESCENDING: - sortOrderClause = " DESC"; //NON-NLS + sortOrderClause = " DESC"; break; case ASCENDING: - sortOrderClause = " ASC"; //NON-NLS + sortOrderClause = " ASC"; break; default: orderByClause = ""; @@ -930,7 +930,7 @@ public final class DrawableDB { vals.add(value); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Unable to get values for attribute", ex); } finally { dbReadUnlock(); } @@ -951,7 +951,7 @@ public final class DrawableDB { } catch (SQLException sQLException) { // Don't need to report it if the case was closed if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); //NON-NLS + LOGGER.log(Level.SEVERE, "Unable to insert group", sQLException); } } finally { dbWriteUnlock(); @@ -972,7 +972,7 @@ public final class DrawableDB { AbstractFile f = tskCase.getAbstractFileById(id); return DrawableFile.create(f, analyzed, isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); //NON-NLS + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); return null; } } @@ -991,7 +991,7 @@ public final class DrawableDB { return DrawableFile.create(f, areFilesAnalyzed(Collections.singleton(id)), isVideoFile(f)); } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); //NON-NLS + LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: {0}", id); return null; } } @@ -1020,7 +1020,7 @@ public final class DrawableDB { } } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get file for group:" + groupKey.getAttribute() + " == " + groupKey.getValue(), ex); } finally { dbReadUnlock(); } @@ -1042,14 +1042,14 @@ public final class DrawableDB { public int countAllFiles() { int result = -1; dbReadLock(); - try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { //NON-NLS + try (ResultSet rs = con.createStatement().executeQuery("SELECT COUNT(*) AS COUNT FROM drawable_files")) { while (rs.next()) { result = rs.getInt("COUNT"); break; } } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); //NON-NLS + LOGGER.log(Level.SEVERE, "Error accessing SQLite database"); } finally { dbReadUnlock(); } @@ -1081,7 +1081,7 @@ public final class DrawableDB { //TODO: delete from hash_set_hits table also... } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); //NON-NLS + LOGGER.log(Level.WARNING, "failed to delete row for obj_id = " + id, ex); } finally { dbWriteUnlock(); } @@ -1093,7 +1093,7 @@ public final class DrawableDB { public class MultipleTransactionException extends IllegalStateException { - private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; //NON-NLS + private static final String CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO = "cannot have more than one open transaction"; public MultipleTransactionException() { super(CANNOT_HAVE_MORE_THAN_ONE_OPEN_TRANSACTIO); @@ -1137,12 +1137,12 @@ public final class DrawableDB { dbReadLock(); try { Statement stmt = con.createStatement(); - ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); //NON-NLS + ResultSet analyzedQuery = stmt.executeQuery("select obj_id from drawable_files"); while (analyzedQuery.next()) { addImageFileToList(analyzedQuery.getLong(OBJ_ID)); } } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "problem loading file IDs: ", ex); } finally { dbReadUnlock(); } @@ -1194,9 +1194,9 @@ public final class DrawableDB { .count(); } } catch (IllegalStateException ex) { - LOGGER.log(Level.WARNING, "Case closed while getting files"); //NON-NLS + LOGGER.log(Level.WARNING, "Case closed while getting files"); } catch (TskCoreException ex1) { - LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get content tags by tag name.", ex1); } return -1; @@ -1231,15 +1231,15 @@ public final class DrawableDB { //count the fileids that are in the given list and don't have a non-zero category assigned to them. String name = - "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList //NON-NLS - + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; //NON-NLS + "SELECT COUNT(obj_id) FROM tsk_files where obj_id IN " + fileIdsList + + " AND obj_id NOT IN (SELECT obj_id FROM content_tags WHERE content_tags.tag_name_id IN " + catTagNameIDs + ")"; try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(name); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - return resultSet.getLong("count(obj_id)"); //NON-NLS + return resultSet.getLong("count(obj_id)"); } } catch (SQLException | TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error getting category count.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error getting category count.", ex); } return -1; @@ -1274,7 +1274,7 @@ public final class DrawableDB { con.setAutoCommit(false); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to set auto-commit to to false", ex); } } @@ -1285,7 +1285,7 @@ public final class DrawableDB { con.rollback(); updatedFiles.clear(); } catch (SQLException ex1) { - LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); //NON-NLS + LOGGER.log(Level.SEVERE, "Exception while attempting to rollback!!", ex1); } finally { close(); } @@ -1307,9 +1307,9 @@ public final class DrawableDB { } } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error commiting drawable.db.", ex); } else { - LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); //NON-NLS + LOGGER.log(Level.WARNING, "Error commiting drawable.db - case is closed."); } rollback(); } @@ -1322,9 +1322,9 @@ public final class DrawableDB { con.setAutoCommit(true); } catch (SQLException ex) { if (Case.isCaseOpen()) { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true.", ex); } else { - LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); //NON-NLS + LOGGER.log(Level.SEVERE, "Error setting auto-commit to true - case is closed"); } } finally { closed = true; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java index 979429b880..14fbf4265c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java @@ -186,9 +186,9 @@ public abstract class DrawableFile extends AbstractFile .map(Tag::getName) .collect(Collectors.toSet()); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName(), ex); } catch (IllegalStateException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "there is no case open; failed to look up " + DrawableAttribute.TAGS.getDisplayName() + " for " + file.getName()); } return Collections.emptySet(); } @@ -223,7 +223,7 @@ public abstract class DrawableFile extends AbstractFile } } } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "problem looking up {0}/{1}" + " " + " for {2}", new Object[]{artType.getDisplayName(), attrType.getDisplayName(), getName()}); } return ""; } @@ -255,7 +255,7 @@ public abstract class DrawableFile extends AbstractFile .orElse(Category.ZERO) ); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); //NON-NLS + LOGGER.log(Level.WARNING, "problem looking up category for file " + this.getName() + ex.getLocalizedMessage()); } catch (IllegalStateException ex) { // We get here many times if the case is closed during ingest, so don't print out a ton of warnings. } @@ -333,7 +333,7 @@ public abstract class DrawableFile extends AbstractFile drawablePath = StringUtils.removeEnd(getUniquePath(), getName()); return drawablePath; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get drawablePath from {0}", getName()); return ""; } } @@ -344,7 +344,7 @@ public abstract class DrawableFile extends AbstractFile try { return getHashSetNames(); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to get hash set names", ex); return Collections.emptySet(); } } @@ -362,7 +362,7 @@ public abstract class DrawableFile extends AbstractFile return this.getUniquePath(); } catch (TskCoreException tskCoreException) { String contentName = this.getName(); - LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N return contentName; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java index cdadb53b94..0d122a6219 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableTagsManager.java @@ -28,7 +28,6 @@ import java.util.logging.Level; import java.util.stream.Collectors; import javax.annotation.Nonnull; import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.casemodule.services.TagsManager; @@ -42,12 +41,11 @@ import org.sleuthkit.datamodel.TskCoreException; * Manages Tags, Tagging, and the relationship between Categories and Tags in * the autopsy Db. delegates some, work to the backing {@link TagsManager}. */ -@NbBundle.Messages({"DrawableTagsManager.followUp=Follow Up"}) public class DrawableTagsManager { private static final Logger LOGGER = Logger.getLogger(DrawableTagsManager.class.getName()); - private static final String FOLLOW_UP = Bundle.DrawableTagsManager_followUp(); + private static final String FOLLOW_UP = "Follow Up"; final private Object autopsyTagsManagerLock = new Object(); private TagsManager autopsyTagsManager; @@ -55,8 +53,8 @@ public class DrawableTagsManager { /** Used to distribute {@link TagsChangeEvent}s */ private final EventBus tagsEventBus = new AsyncEventBus( Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { //NON-NLS - LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); //NON-NLS + new BasicThreadFactory.Builder().namingPattern("Tags Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { + LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); }).build() )); @@ -149,7 +147,7 @@ public class DrawableTagsManager { .distinct().sorted() .collect(Collectors.toList()); } catch (TskCoreException | IllegalStateException ex) { - LOGGER.log(Level.WARNING, "couldn't access case", ex); //NON-NLS + LOGGER.log(Level.WARNING, "couldn't access case", ex); } return Collections.emptyList(); } @@ -185,7 +183,7 @@ public class DrawableTagsManager { throw new TskCoreException("tagame exists but wasn't found", ex); } } catch (IllegalStateException ex) { - LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); throw new TskCoreException("Case was closed out from underneath", ex); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java index 9b3b3218f1..a04646c310 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/HashSetManager.java @@ -46,7 +46,7 @@ public class HashSetManager { try { return db.getHashSetsForFile(fileID); } catch (TskCoreException ex) { - Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); //NON-NLS + Logger.getLogger(HashSetManager.class.getName()).log(Level.SEVERE, "Failed to get Hash Sets for file", ex); return Collections.emptySet(); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java index 01e5cfd983..4249fe3c24 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/ImageFile.java @@ -46,7 +46,7 @@ public class ImageFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to read image {0}: " + exception.toString(); //NON-NLS + return "Failed to read image {0}: " + exception.toString(); } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java index 1da586f603..20724ef0bc 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java @@ -29,7 +29,6 @@ import javafx.scene.media.Media; import javafx.scene.media.MediaException; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.VideoUtils; @@ -40,7 +39,7 @@ public class VideoFile extends DrawableFile { private static final Logger LOGGER = Logger.getLogger(VideoFile.class.getName()); - private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); //NON-NLS + private static final Image VIDEO_ICON = new Image("org/sleuthkit/autopsy/imagegallery/images/Clapperboard.png"); VideoFile(T file, Boolean analyzed) { super(file, analyzed); @@ -54,7 +53,7 @@ public class VideoFile extends DrawableFile { @Override String getMessageTemplate(final Exception exception) { - return "Failed to get image preview for video {0}: " + exception.toString(); //NON-NLS + return "Failed to get image preview for video {0}: " + exception.toString(); } @Override @@ -64,7 +63,6 @@ public class VideoFile extends DrawableFile { private SoftReference mediaRef; - @NbBundle.Messages({"VideoFile.getMedia.progress=writing temporary file to disk"}) public Media getMedia() throws IOException, MediaException { Media media = (mediaRef != null) ? mediaRef.get() : null; @@ -75,7 +73,7 @@ public class VideoFile extends DrawableFile { if (cacheFile.exists() == false || cacheFile.length() < getAbstractFile().getSize()) { Files.createParentDirs(cacheFile); - ProgressHandle progressHandle = ProgressHandleFactory.createHandle(Bundle.VideoFile_getMedia_progress()); + ProgressHandle progressHandle = ProgressHandleFactory.createHandle("writing temporary file to disk"); progressHandle.start(100); ContentUtils.writeToFile(this.getAbstractFile(), cacheFile, progressHandle, null, true); progressHandle.finish(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java index 1b8b7d72c8..f3020830a9 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/DrawableGroup.java @@ -126,7 +126,7 @@ public class DrawableGroup implements Comparable { .filter(Boolean::booleanValue) .count()); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); } } @@ -145,7 +145,7 @@ public class DrawableGroup implements Comparable { uncatCount.set(ImageGalleryController.getDefault().getDatabase().getCategoryCount(Category.ZERO, fileIDs)); } catch (IllegalStateException | NullPointerException ex) { - LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); //NON-NLS + LOGGER.log(Level.WARNING, "could not access case during getFilesWithHashSetHitsCount()"); } } @@ -202,7 +202,7 @@ public class DrawableGroup implements Comparable { @Override public String toString() { - return "Grouping{ keyProp=" + groupKey + '}'; //NON-NLS + return "Grouping{ keyProp=" + groupKey + '}'; } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java index 1073d587da..79cbb1fba2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupKey.java @@ -57,7 +57,7 @@ public class GroupKey> implements Comparable @Override public String toString() { - return "GroupKey: " + getAttribute().attrName + " = " + getValue(); //NON-NLS + return "GroupKey: " + getAttribute().attrName + " = " + getValue(); } @Override diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java index cebcd6c222..200ef32a16 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java @@ -62,7 +62,6 @@ import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.util.Exceptions; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; @@ -196,10 +195,10 @@ public class GroupManager { DrawableFile file = db.getFileFromID(fileID); return getGroupKeysForFile(file); } else { - Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); //NON-NLS + Logger.getLogger(GroupManager.class.getName()).log(Level.WARNING, "Failed to load file with id: {0} from database. There is no database assigned.", fileID); } } catch (TskCoreException ex) { - Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); //NON-NLS + Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, "failed to load file with id: " + fileID + " from database", ex); } return Collections.emptySet(); } @@ -348,11 +347,11 @@ public class GroupManager { break; case MIME_TYPE: HashSet types = new HashSet<>(); - try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); //NON-NLS + try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery("select group_concat(obj_id), mime_type from tsk_files group by mime_type "); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final String mimeType = resultSet.getString("mime_type"); //NON-NLS - String objIds = resultSet.getString("group_concat(obj_id)"); //NON-NLS + final String mimeType = resultSet.getString("mime_type"); + String objIds = resultSet.getString("group_concat(obj_id)"); Pattern.compile(",").splitAsStream(objIds) .map(Long::valueOf) @@ -371,7 +370,7 @@ public class GroupManager { return values; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); //NON-NLS + LOGGER.log(Level.WARNING, "TSK error getting list of type {0}", groupBy.getDisplayName()); return Collections.emptyList(); } @@ -417,7 +416,7 @@ public class GroupManager { } } - return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); //NON-NLS + return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")"); } else { List contentTags = tagsManager.getContentTagsByTagName(tagsManager.getTagName(category)); @@ -429,7 +428,7 @@ public class GroupManager { } } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "TSK error getting files in Category:" + category.getDisplayName(), ex); throw ex; } } @@ -445,7 +444,7 @@ public class GroupManager { } return files; } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); //NON-NLS + LOGGER.log(Level.WARNING, "TSK error getting files with Tag:" + tagName.getDisplayName(), ex); throw ex; } } @@ -532,7 +531,7 @@ public class GroupManager { /** * an executor to submit async ui related background tasks to. */ - final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); //NON-NLS + final ExecutorService regroupExecutor = Executors.newSingleThreadExecutor(new BasicThreadFactory.Builder().namingPattern("ui task -%d").build()); public ReadOnlyDoubleProperty regroupProgress() { return regroupProgress.getReadOnlyProperty(); @@ -683,7 +682,7 @@ public class GroupManager { return group; } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); //NON-NLS + LOGGER.log(Level.SEVERE, "failed to get files for group: " + groupKey.getAttribute().attrName.toString() + " = " + groupKey.getValue(), ex); } } } @@ -694,13 +693,13 @@ public class GroupManager { HashSet hashSet = new HashSet<>(); String query = (null == mimeType) - ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" //NON-NLS - : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; //NON-NLS + ? "SELECT obj_id FROM tsk_files WHERE mime_type IS NULL" + : "SELECT obj_id FROM tsk_files WHERE mime_type = '" + mimeType + "'"; try (SleuthkitCase.CaseDbQuery executeQuery = controller.getSleuthKitCase().executeQuery(query); ResultSet resultSet = executeQuery.getResultSet();) { while (resultSet.next()) { - final long fileID = resultSet.getLong("obj_id"); //NON-NLS + final long fileID = resultSet.getLong("obj_id"); if (db.isInDB(fileID)) { hashSet.add(fileID); } @@ -718,13 +717,6 @@ public class GroupManager { * {@link Groupings} for them */ @SuppressWarnings({"unchecked", "rawtypes"}) - @NbBundle.Messages({"# {0} - groupBy attribute Name", - "# {1} - sortBy name", - "# {2} - sort Order", - "ReGroupTask.displayTitle=regrouping files by {0} sorted by {1} in {2} order", - "# {0} - groupBy attribute Name", - "# {1} - atribute value", - "ReGroupTask.progressUpdate=regrouping files by {0} : {1}"}) private class ReGroupTask> extends LoggedTask { private ProgressHandle groupProgress; @@ -736,7 +728,7 @@ public class GroupManager { private final SortOrder sortOrder; public ReGroupTask(DrawableAttribute groupBy, GroupSortBy sortBy, SortOrder sortOrder) { - super(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), true); + super("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", true); this.groupBy = groupBy; this.sortBy = sortBy; @@ -755,7 +747,7 @@ public class GroupManager { return null; } - groupProgress = ProgressHandleFactory.createHandle(Bundle.ReGroupTask_displayTitle(groupBy.attrName.toString(), sortBy.name(), sortOrder.toString()), this); + groupProgress = ProgressHandleFactory.createHandle("regrouping files by " + groupBy.attrName.toString() + " sorted by " + sortBy.name() + " in " + sortOrder.toString() + " order", this); Platform.runLater(() -> { analyzedGroups.clear(); unSeenGroups.clear(); @@ -773,9 +765,9 @@ public class GroupManager { return null;//abort } p++; - updateMessage(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), val)); + updateMessage("regrouping files by " + groupBy.attrName.toString() + " : " + val); updateProgress(p, vals.size()); - groupProgress.progress(Bundle.ReGroupTask_progressUpdate(groupBy.attrName.toString(), val), p); + groupProgress.progress("regrouping files by " + groupBy.attrName.toString() + " : " + val, p); popuplateIfAnalyzed(new GroupKey(groupBy, val), this); } Platform.runLater(() -> FXCollections.sort(analyzedGroups, sortBy.getGrpComparator(sortOrder))); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java index 5d8740b343..53f464dbb0 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupSortBy.java @@ -27,7 +27,6 @@ import javax.swing.SortOrder; import static javax.swing.SortOrder.ASCENDING; import static javax.swing.SortOrder.DESCENDING; import org.apache.commons.lang3.StringUtils; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; @@ -36,17 +35,13 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; * down in Toolbar as well as each enum value having the stategy * ({@link Comparator}) for sorting the groups */ -@NbBundle.Messages({"GroupSortBy.groupSize=Group Size", - "GroupSortBy.groupName=Group Name", - "GroupSortBy.none=None", - "GroupSortBy.priority=Priority"}) public enum GroupSortBy implements ComparatorProvider { /** * sort the groups by the number of files in each sort the groups by the * number of files in each */ - FILE_COUNT(Bundle.GroupSortBy_groupSize(), true, "folder-open-image.png") { //NON-NLS + FILE_COUNT("Group Size", true, "folder-open-image.png") { @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparingInt(DrawableGroup::getSize)); @@ -61,7 +56,7 @@ public enum GroupSortBy implements ComparatorProvider { * sort the groups by the natural order of the grouping value ( eg group * them by path alphabetically ) */ - GROUP_BY_VALUE(Bundle.GroupSortBy_groupName(), true, "folder-rename.png") { //NON-NLS + GROUP_BY_VALUE("Group Name", true, "folder-rename.png") { @Override public Comparator getGrpComparator(final SortOrder sortOrder) { return applySortOrder(sortOrder, Comparator.comparing(t -> t.getGroupByValueDislpayName())); @@ -76,7 +71,7 @@ public enum GroupSortBy implements ComparatorProvider { * don't sort the groups just use what ever order they come in (ingest * order) */ - NONE(Bundle.GroupSortBy_none(), false, "prohibition.png") { //NON-NLS + NONE("None", false, "prohibition.png") { @Override public Comparator getGrpComparator(SortOrder sortOrder) { return new NoOpComparator<>(); @@ -90,7 +85,7 @@ public enum GroupSortBy implements ComparatorProvider { /** * sort the groups by some priority metric to be determined and implemented */ - PRIORITY(Bundle.GroupSortBy_priority(), false, "hashset_hits.png") { //NON-NLS + PRIORITY("Priority", false, "hashset_hits.png") { @Override public Comparator getGrpComparator(SortOrder sortOrder) { return Comparator.nullsLast(Comparator.comparingDouble(DrawableGroup::getHashHitDensity).thenComparingInt(DrawableGroup::getSize).reversed()); @@ -133,7 +128,7 @@ public enum GroupSortBy implements ComparatorProvider { public Image getIcon() { if (icon == null) { if (StringUtils.isBlank(imageName) == false) { - this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); //NON-NLS + this.icon = new Image("org/sleuthkit/autopsy/imagegallery/images/" + imageName, true); } } return icon; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java index 872a2afc6b..402694bd07 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/NoGroupsDialog.java @@ -53,7 +53,7 @@ public class NoGroupsDialog extends GridPane { } private NoGroupsDialog() { - FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); //NON-NLS + FXMLConstructor.construct(this, "NoGroupsDialog.fxml"); } public NoGroupsDialog(String message) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java index 0a0ce0f663..c1d2fe7a7b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/StatusBar.java @@ -28,7 +28,6 @@ import javafx.scene.control.Label; import javafx.scene.control.ProgressBar; import javafx.scene.control.Tooltip; import javafx.scene.layout.AnchorPane; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; /** @@ -63,10 +62,6 @@ public class StatusBar extends AnchorPane { private ProgressBar bgTaskProgressBar; @FXML - @NbBundle.Messages({"# {0} - file update queue size", - "StatusBar.fileUpdateTaskLabel.text={0} File Update Tasks", - "StatusBar.bgTaskLabel.text=Regrouping", - "StatuBar.toolTip=Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data."}) void initialize() { assert fileTaskProgresBar != null : "fx:id=\"fileTaskProgresBar\" was not injected: check your FXML file 'StatusBar.fxml'."; assert fileUpdateTaskLabel != null : "fx:id=\"fileUpdateTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'."; @@ -74,7 +69,7 @@ public class StatusBar extends AnchorPane { assert bgTaskLabel != null : "fx:id=\"bgTaskLabel\" was not injected: check your FXML file 'StatusBar.fxml'."; assert bgTaskProgressBar != null : "fx:id=\"bgTaskProgressBar\" was not injected: check your FXML file 'StatusBar.fxml'."; - fileUpdateTaskLabel.textProperty().bind(Bundle.StatusBar_fileUpdateTaskLabel_text(controller.getFileUpdateQueueSizeProperty().asString()));//;setText(newSize.toString() + " File Update Tasks"); + fileUpdateTaskLabel.textProperty().bind(controller.getFileUpdateQueueSizeProperty().asString().concat(" File Update Tasks"));//;setText(newSize.toString() + " File Update Tasks"); fileTaskProgresBar.progressProperty().bind(controller.getFileUpdateQueueSizeProperty().negate()); // controller.getFileUpdateQueueSizeProperty().addListener((ov, oldSize, newSize) -> { // Platform.runLater(() -> { @@ -88,7 +83,7 @@ public class StatusBar extends AnchorPane { if(controller.regroupProgress().lessThan(1.0).get()){ // Regrouping in progress bgTaskProgressBar.progressProperty().setValue(-1.0); - bgTaskLabel.setText(Bundle.StatusBar_bgTaskLabel_text()); + bgTaskLabel.setText("Regrouping"); } else{ // Clear the progress bar bgTaskProgressBar.progressProperty().setValue(0.0); @@ -99,14 +94,14 @@ public class StatusBar extends AnchorPane { Platform.runLater(() -> { - staleLabel.setTooltip(new Tooltip(Bundle.StatuBar_toolTip())); + staleLabel.setTooltip(new Tooltip("Some data may be out of date. Enable Image Gallery in Tools | Options | Image /Video Gallery , after ingest is complete to update the Image Gallery data.")); }); staleLabel.visibleProperty().bind(controller.stale()); } public StatusBar(ImageGalleryController controller) { this.controller = controller; - FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); //NON-NLS + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml")); fxmlLoader.setRoot(this); fxmlLoader.setController(this); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java index b9b1c04813..6fe4ce9b44 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SummaryTablePane.java @@ -79,7 +79,7 @@ public class SummaryTablePane extends AnchorPane { public SummaryTablePane(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "SummaryTablePane.fxml"); //NON-NLS + FXMLConstructor.construct(this, "SummaryTablePane.fxml"); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java index 5c68a94436..91ca4a142c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java @@ -142,7 +142,7 @@ public class Toolbar extends ToolBar { try { new TagGroupAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Could create follow up tag menu item", ex); } }); @@ -213,7 +213,7 @@ public class Toolbar extends ToolBar { private Toolbar(ImageGalleryController controller) { this.controller = controller; - FXMLConstructor.construct(this, "Toolbar.fxml"); //NON-NLS + FXMLConstructor.construct(this, "Toolbar.fxml"); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java index 01b0e5dd1b..9b60278865 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/VideoPlayer.java @@ -40,20 +40,19 @@ import javafx.scene.media.MediaView; import javafx.scene.text.Text; import javafx.util.Duration; import javafx.util.StringConverter; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.datamodel.VideoFile; public class VideoPlayer extends BorderPane { - private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); //NON-NLS - private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); //NON-NLS - private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); //NON-NLS - private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); //NON-NLS + private static final Image VOLUME_HIGH = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume.png"); + private static final Image VOLUME_LOW = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-low.png"); + private static final Image VOLUME_ZERO = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-none.png"); + private static final Image VOLUME_MUTE = new Image("/org/sleuthkit/autopsy/imagegallery/images/speaker-volume-control-mute.png"); - private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); //NON-NLS - private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); //NON-NLS + private static final Image PLAY = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_play_small.png", true); + private static final Image PAUSE = new Image("/org/sleuthkit/autopsy/imagegallery/images/media_controls_pause_small.png", true); private final MediaPlayer mp; @@ -107,8 +106,6 @@ public class VideoPlayer extends BorderPane { private final VideoFile file; @FXML - @NbBundle.Messages({"# {0} - exception type", - "VideoPlayer.errNotice={0}\nSee the logs for details."}) void initialize() { assert controlButton != null : "fx:id=\"controlButton\" was not injected: check your FXML file 'MediaControl.fxml'."; assert timeSlider != null : "fx:id=\"timeSlider\" was not injected: check your FXML file 'MediaControl.fxml'."; @@ -117,14 +114,14 @@ public class VideoPlayer extends BorderPane { final MediaException ex = mp.getError(); if (ex != null) { Platform.runLater(() -> { - Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); //NON-NLS - setCenter(new Text(Bundle.VideoPlayer_errNotice(ex.getType()))); + Logger.getLogger(VideoFile.class.getName()).log(Level.WARNING, ex.getType() + " Failed to initialize MediaControl for file " + file.getName(), ex); + setCenter(new Text(ex.getType() + "\nSee the logs for details.")); setBottom(null); }); } }); mp.statusProperty().addListener((observableStatus, oldStatus, newStatus) -> { - Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); //NON-NLS + Logger.getAnonymousLogger().log(Level.INFO, "media player: {0}", newStatus); }); mediaView.setMediaPlayer(mp); mediaView.fitHeightProperty().bind(this.heightProperty().subtract(playControlBar.heightProperty())); @@ -239,7 +236,7 @@ public class VideoPlayer extends BorderPane { public VideoPlayer(MediaPlayer mp, VideoFile file) { this.file = file; this.mp = mp; - FXMLConstructor.construct(this, "MediaControl.fxml"); //NON-NLS + FXMLConstructor.construct(this, "MediaControl.fxml"); } protected void updateTime() { @@ -280,10 +277,10 @@ public class VideoPlayer extends BorderPane { int elapsedSeconds = totalSeconds - elapsedMinutes * 60; if (elapsedHours > 0) { - return String.format("%d:%02d:%02d", elapsedHours, //NON-NLS + return String.format("%d:%02d:%02d", elapsedHours, elapsedMinutes, elapsedSeconds); } else { - return String.format("%02d:%02d", elapsedMinutes, //NON-NLS + return String.format("%02d:%02d", elapsedMinutes, elapsedSeconds); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java index badfc20b92..674aad0260 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTile.java @@ -54,7 +54,7 @@ public class DrawableTile extends DrawableTileBase { try { setEffect(Objects.equals(newValue, getFileID()) ? LAST_SELECTED_EFFECT : null); } catch (java.lang.IllegalStateException ex) { - Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); //NON-NLS + Logger.getLogger(DrawableTile.class.getName()).log(Level.WARNING, "Error displaying tile"); } }; @@ -78,7 +78,7 @@ public class DrawableTile extends DrawableTileBase { public DrawableTile(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "DrawableTile.fxml"); //NON-NLS + FXMLConstructor.construct(this, "DrawableTile.fxml"); } /** diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java index 7cbc9350cb..2058737b3c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableTileBase.java @@ -95,8 +95,8 @@ public abstract class DrawableTileBase extends DrawableUIBase { private static final Border SELECTED_BORDER = new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, new CornerRadii(2), new BorderWidths(3))); //TODO: do this in CSS? -jm - protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); //NON-NLS - protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); //NON-NLS + protected static final Image followUpIcon = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_red.png"); + protected static final Image followUpGray = new Image("org/sleuthkit/autopsy/imagegallery/images/flag_gray.png"); protected final FileIDSelectionModel selectionModel; private static ContextMenu contextMenu; @@ -197,8 +197,6 @@ public abstract class DrawableTileBase extends DrawableUIBase { t.consume(); } - @NbBundle.Messages({"DrawableTileBase.menuItem.extractFiles=Extract File(s)", - "DrawableTileBase.menuItem.showContentViewer=Show Content Viewer"}) private ContextMenu buildContextMenu(DrawableFile file) { final ArrayList menuItems = new ArrayList<>(); @@ -206,7 +204,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { menuItems.add(new AddDrawableTagAction(getController()).getPopupMenu()); - final MenuItem extractMenuItem = new MenuItem(Bundle.DrawableTileBase_menuItem_extractFiles()); + final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -215,10 +213,10 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); menuItems.add(extractMenuItem); - MenuItem contentViewer = new MenuItem(Bundle.DrawableTileBase_menuItem_showContentViewer()); + MenuItem contentViewer = new MenuItem("Show Content Viewer"); contentViewer.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { - new NewWindowViewAction(Bundle.DrawableTileBase_menuItem_showContentViewer(), new FileNode(file.getAbstractFile())).actionPerformed(null); + new NewWindowViewAction("Show Content Viewer", new FileNode(file.getAbstractFile())).actionPerformed(null); }); }); menuItems.add(contentViewer); @@ -262,7 +260,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { selectionModel.clearAndSelect(file.getId()); new AddDrawableTagAction(getController()).addTag(getController().getTagsManager().getFollowUpTagName(), ""); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to add Follow Up tag. Could not load TagName.", ex); } } else { new DeleteFollowUpTagAction(getController(), file).handle(event); @@ -278,7 +276,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { return DrawableAttribute.TAGS.getValue(getFile().get()).stream() .anyMatch(followUpTagName::equals); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "failed to get follow up tag name ", ex); return true; } } else { @@ -365,7 +363,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { }); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); } }); } @@ -382,7 +380,7 @@ public abstract class DrawableTileBase extends DrawableUIBase { updateFollowUpIcon(); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get followup tag name. Unable to update follow up status for file. ", ex); } }); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java index 1a6bfd227e..d77eee7f44 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableUIBase.java @@ -102,7 +102,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView try { fileOpt = Optional.ofNullable(getController().getFileFromId(fileIDOpt.get())); } catch (TskCoreException ex) { - Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); //NON-NLS + Logger.getAnonymousLogger().log(Level.WARNING, "failed to get DrawableFile for obj_id" + fileIDOpt.get(), ex); fileOpt = Optional.empty(); } return fileOpt; @@ -147,7 +147,7 @@ abstract public class DrawableUIBase extends AnchorPane implements DrawableView myTask.setOnFailed(failed -> { Throwable exception = myTask.getException(); if (exception instanceof OutOfMemoryError - && exception.getMessage().contains("Java heap space")) { //NON-NLS + && exception.getMessage().contains("Java heap space")) { showErrorNode(Bundle.DrawableUIBase_errorLabel_OOMText(), file); } else { showErrorNode(Bundle.DrawableUIBase_errorLabel_text(), file); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java index 1219e2d1a8..96d30afd93 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/DrawableView.java @@ -92,7 +92,7 @@ public interface DrawableView { } catch (NullPointerException ex) { // I think this happens when we're in the process of removing images from the view while // also trying to update it? - Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); //NON-NLS + Logger.getLogger(DrawableView.class.getName()).log(Level.WARNING, "Error looking up hash set hits"); return false; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java index 7955368a9e..a31001fd2f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java @@ -89,8 +89,6 @@ import javafx.scene.layout.Priority; import javafx.scene.layout.Region; import javafx.scene.paint.Color; import javafx.util.Duration; - -import javax.ejb.MessageDriven; import javax.swing.Action; import javax.swing.SwingUtilities; import org.apache.commons.lang3.StringUtils; @@ -99,7 +97,6 @@ import org.controlsfx.control.GridView; import org.controlsfx.control.SegmentedButton; import org.controlsfx.control.action.ActionUtils; import org.openide.util.Lookup; -import org.openide.util.NbBundle; import org.openide.util.actions.Presenter; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; @@ -276,7 +273,7 @@ public class GroupPane extends BorderPane { undoAction = new UndoAction(controller); redoAction = new RedoAction(controller); - FXMLConstructor.construct(this, "GroupPane.fxml"); //NON-NLS + FXMLConstructor.construct(this, "GroupPane.fxml"); } @ThreadConfined(type = ThreadType.JFX) @@ -333,14 +330,10 @@ public class GroupPane extends BorderPane { /** * create the string to display in the group header */ - @NbBundle.Messages({"# {0} - default group name", - "# {1} - hashset hits count", - "# {2} - group size", - "GroupPane.headerString={0} -- {1} hash set hits / {2} files"}) protected String getHeaderString() { return isNull(getGroup()) ? "" - : Bundle.GroupPane_headerString(StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()), - getGroup().getHashSetHitsCount(), getGroup().getSize()); + : StringUtils.defaultIfBlank(getGroup().getGroupByValueDislpayName(), DrawableGroup.getBlankGroupName()) + " -- " + + getGroup().getHashSetHitsCount() + " hash set hits / " + getGroup().getSize() + " files"; } ContextMenu getContextMenu() { @@ -458,13 +451,13 @@ public class GroupPane extends BorderPane { try { tagSelectedSplitMenu.setText(controller.getTagsManager().getFollowUpTagName().getDisplayName()); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); } tagSelectedSplitMenu.setOnAction(actionEvent -> { try { new TagSelectedFilesAction(controller.getTagsManager().getFollowUpTagName(), controller).handle(actionEvent); } catch (TskCoreException tskCoreException) { - LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS + LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); } }); @@ -519,7 +512,6 @@ public class GroupPane extends BorderPane { addEventFilter(KeyEvent.KEY_PRESSED, tileKeyboardNavigationHandler); gridView.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler() { - @NbBundle.Messages({"GroupPane.gridViewContextMenuItem.extractFiles=Extract File(s)"}) private ContextMenu buildContextMenu() { ArrayList menuItems = new ArrayList<>(); @@ -536,7 +528,7 @@ public class GroupPane extends BorderPane { } } } - final MenuItem extractMenuItem = new MenuItem(Bundle.GroupPane_gridViewContextMenuItem_extractFiles()); + final MenuItem extractMenuItem = new MenuItem("Extract File(s)"); extractMenuItem.setOnAction((ActionEvent t) -> { SwingUtilities.invokeLater(() -> { TopComponent etc = WindowManager.getDefault().findTopComponent(ImageGalleryTopComponent.PREFERRED_ID); @@ -738,7 +730,7 @@ public class GroupPane extends BorderPane { if (gridView == null || gridView.getSkin() == null) { return Optional.empty(); } - return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); //NON-NLS + return Optional.ofNullable((ScrollBar) gridView.getSkin().getNode().lookup(".scroll-bar")); } void makeSelection(Boolean shiftDown, Long newFileID) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java index 24e2072aec..32b8b8c71f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/MetaDataPane.java @@ -50,7 +50,6 @@ import javafx.scene.input.KeyEvent; import javafx.scene.layout.Region; import javafx.scene.text.Text; import javafx.util.Pair; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; import org.sleuthkit.autopsy.coreutils.Logger; @@ -85,11 +84,10 @@ public class MetaDataPane extends DrawableUIBase { public MetaDataPane(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "MetaDataPane.fxml"); //NON-NLS + FXMLConstructor.construct(this, "MetaDataPane.fxml"); } @FXML - @NbBundle.Messages({"MetaDataPane.tableView.placeholder=Select a file to show its details here."}) void initialize() { assert attributeColumn != null : "fx:id=\"attributeColumn\" was not injected: check your FXML file 'MetaDataPane.fxml'."; assert imageView != null : "fx:id=\"imageView\" was not injected: check your FXML file 'MetaDataPane.fxml'."; @@ -118,7 +116,7 @@ public class MetaDataPane extends DrawableUIBase { }); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); - tableView.setPlaceholder(new Label(Bundle.MetaDataPane_tableView_placeholder())); + tableView.setPlaceholder(new Label("Select a file to show its details here.")); tableView.getColumns().setAll(Arrays.asList(attributeColumn, valueColumn)); attributeColumn.setPrefWidth(USE_COMPUTED_SIZE); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java index 1818f65521..59d747a655 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java @@ -77,7 +77,7 @@ public class SlideShowView extends DrawableTileBase { SlideShowView(GroupPane gp, ImageGalleryController controller) { super(gp, controller); - FXMLConstructor.construct(this, "SlideShowView.fxml"); //NON-NLS + FXMLConstructor.construct(this, "SlideShowView.fxml"); } @FXML @@ -137,7 +137,7 @@ public class SlideShowView extends DrawableTileBase { }); } catch (NullPointerException ex) { // The case has likely been closed - LOGGER.log(Level.WARNING, "Error accessing groupPane"); //NON-NLS + LOGGER.log(Level.WARNING, "Error accessing groupPane"); } } @@ -278,12 +278,9 @@ public class SlideShowView extends DrawableTileBase { * @return supplemental text to include in the label, specifically: "image x * of y" */ - @NbBundle.Messages({"# {0} - file id number", - "# {1} - number of file ids", - "SlideShowView.supplementalText={0} of {1} in group"}) private String getSupplementalText() { final ObservableList fileIds = getGroupPane().getGroup().getFileIDs(); - return getFileID().map(fileID -> " ( " + Bundle.SlideShowView_supplementalText(fileIds.indexOf(fileID) + 1, fileIds.size()) + " )") + return getFileID().map(fileID -> " ( " + (fileIds.indexOf(fileID) + 1) + " of " + fileIds.size() + " in group )") .orElse(""); } @@ -327,7 +324,7 @@ public class SlideShowView extends DrawableTileBase { final Media media = file.getMedia(); return new VideoPlayer(new MediaPlayer(media), file); } catch (MediaException | IOException | OutOfMemoryError ex) { - LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); //NON-NLS + LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); return doReadImageTask(file); } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java index a5bbb40f49..c7bce311c4 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupComparators.java @@ -21,34 +21,27 @@ package org.sleuthkit.autopsy.imagegallery.gui.navpanel; import com.google.common.collect.ImmutableList; import java.util.Comparator; import java.util.function.Function; - -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup; /** * */ -@NbBundle.Messages({"GroupComparators.uncategorizedCount=Uncategorized Count", - "GroupComparators.groupName=Group Name", - "GroupComparators.hitCount=Hit Count", - "GroupComparators.groupSize=Group Size", - "GroupComparators.hitDensity=Hit Density"}) final class GroupComparators> implements Comparator { static final GroupComparators UNCATEGORIZED_COUNT = - new GroupComparators<>(Bundle.GroupComparators_uncategorizedCount(), DrawableGroup::getUncategorizedCount, String::valueOf, false); + new GroupComparators<>("Uncategorized Count", DrawableGroup::getUncategorizedCount, String::valueOf, false); static final GroupComparators ALPHABETICAL = - new GroupComparators<>(Bundle.GroupComparators_groupName(), DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); + new GroupComparators<>("Group Name", DrawableGroup::getGroupByValueDislpayName, String::valueOf, false); static final GroupComparators HIT_COUNT = - new GroupComparators<>(Bundle.GroupComparators_hitCount(), DrawableGroup::getHashSetHitsCount, String::valueOf, true); + new GroupComparators<>("Hit Count", DrawableGroup::getHashSetHitsCount, String::valueOf, true); static final GroupComparators FILE_COUNT = - new GroupComparators<>(Bundle.GroupComparators_groupSize(), DrawableGroup::getSize, String::valueOf, true); + new GroupComparators<>("Group Size", DrawableGroup::getSize, String::valueOf, true); static final GroupComparators HIT_FILE_RATIO = - new GroupComparators<>(Bundle.GroupComparators_hitDensity(), DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); //NON-NLS + new GroupComparators<>("Hit Density", DrawableGroup::getHashHitDensity, density -> String.format("%.2f", density) + "%", true); private final static ImmutableList> values = ImmutableList.of(UNCATEGORIZED_COUNT, ALPHABETICAL, HIT_COUNT, FILE_COUNT, HIT_FILE_RATIO); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java index 37caa8bd78..6951d67997 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupListCell.java @@ -42,7 +42,7 @@ class GroupListCell extends ListCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); /** * reference to group files listener that allows us to remove it from a @@ -70,8 +70,8 @@ class GroupListCell extends ListCell { GroupListCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -145,7 +145,7 @@ class GroupListCell extends ListCell { private String getSeenStyleClass() { return Optional.ofNullable(getItem()) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS + .map(seen -> seen ? "" : "-fx-font-weight:bold;") .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java index ffe9df9a51..e371644944 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java @@ -32,8 +32,6 @@ import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; import javafx.scene.image.ImageView; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.util.Beta; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -55,16 +53,15 @@ final public class GroupTree extends NavPanel> { public GroupTree(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS + FXMLConstructor.construct(this, "NavPanel.fxml"); } @FXML @Override - @NbBundle.Messages({"GroupTree.displayName.allGroups=All Groups"}) void initialize() { super.initialize(); - setText(Bundle.GroupTree_displayName_allGroups()); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); //NON-NLS + setText("All Groups"); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); getBorderPane().setCenter(groupTree); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java index a26ec693c7..917aa35084 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java @@ -47,7 +47,7 @@ class GroupTreeCell extends TreeCell { * folder(with no DrawableFiles) in the file system hierarchy. */ private static final Image EMPTY_FOLDER_ICON = - new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); //NON-NLS + new Image(GroupTreeCell.class.getResourceAsStream("/org/sleuthkit/autopsy/imagegallery/images/folder.png")); /** * reference to group files listener that allows us to remove it from a @@ -75,8 +75,8 @@ class GroupTreeCell extends TreeCell { GroupTreeCell(ReadOnlyObjectProperty> sortOrderProperty) { this.sortOrder = sortOrderProperty; - getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); //NON-NLS - getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. NON-NLS + getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm()); + getStyleClass().add("groupTreeCell"); //reduce indent to 5, default is 10 which uses up a lot of space. //since end of path is probably more interesting put ellipsis at front setTextOverrun(OverrunStyle.LEADING_ELLIPSIS); @@ -161,7 +161,7 @@ class GroupTreeCell extends TreeCell { return Optional.ofNullable(getItem()) .map(GroupTreeNode::getGroup) .map(DrawableGroup::isSeen) - .map(seen -> seen ? "" : "-fx-font-weight:bold;") //NON-NLS + .map(seen -> seen ? "" : "-fx-font-weight:bold;") .orElse(""); //if item is null or group is null } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java index 03c6663369..71f8aa026f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/HashHitGroupList.java @@ -24,7 +24,6 @@ import javafx.fxml.FXML; import javafx.scene.control.ListView; import javafx.scene.control.SelectionModel; import javafx.scene.image.ImageView; -import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -48,7 +47,7 @@ final public class HashHitGroupList extends NavPanel { public HashHitGroupList(ImageGalleryController controller) { super(controller); - FXMLConstructor.construct(this, "NavPanel.fxml"); //NON-NLS + FXMLConstructor.construct(this, "NavPanel.fxml"); } @ThreadConfined(type = ThreadConfined.ThreadType.JFX) @@ -69,12 +68,11 @@ final public class HashHitGroupList extends NavPanel { @FXML @Override - @NbBundle.Messages({"HashHitGroupList.displayName.onlyHashHits=Only Hash Hits"}) void initialize() { super.initialize(); - setText(Bundle.HashHitGroupList_displayName_onlyHashHits()); - setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); //NON-NLS + setText("Only Hash Hits"); + setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/hashset_hits.png")); getBorderPane().setCenter(groupList); sorted = getController().getGroupManager().getAnalyzedGroups().filtered((DrawableGroup t) -> t.getHashSetHitsCount() > 0).sorted(getDefaultComparator()); From 8e1b7c612ea9c8bd4cfb263526c488865f47495d Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 1 Feb 2016 16:03:07 -0500 Subject: [PATCH 47/48] Revert "Make IngestibleFileFilter.isIngestible public" This reverts commit e7bcd3987b8aaa16c36915f2c938d852ed2e49c6. --- Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java index 994491375b..853e4fb294 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java @@ -42,7 +42,7 @@ public class IngestibleFileFilter { * * @return */ - public static boolean isIngestible(AbstractFile candidateFile, boolean excludeUnallocSpaceFiles) { + static boolean isIngestible(AbstractFile candidateFile, boolean excludeUnallocSpaceFiles) { /* * Filter out synthesized unallocated space files. */ From d97120467ea7b19cc1ab25cbfc16bec2ee75374c Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 1 Feb 2016 16:03:43 -0500 Subject: [PATCH 48/48] Revert "Factor IngestibleFileFilter util out of IngestTasksScheduler" This reverts commit 57594e2bdb58878a5e3b13f1c22be211e29c8fb2. --- .../autopsy/ingest/IngestTasksScheduler.java | 60 +++++++++- .../autopsy/ingest/IngestibleFileFilter.java | 111 ------------------ 2 files changed, 58 insertions(+), 113 deletions(-) delete mode 100644 Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java index 924b8a9913..766891ae86 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestTasksScheduler.java @@ -395,8 +395,64 @@ final class IngestTasksScheduler { * @return True or false. */ private static boolean shouldEnqueueFileTask(final FileIngestTask task) { - AbstractFile file = task.getFile(); - return IngestibleFileFilter.isIngestible(task.getFile(), !task.getIngestJob().shouldProcessUnallocatedSpace()); + final AbstractFile file = task.getFile(); + + // Skip the task if the file is an unallocated space file and the + // process unallocated space flag is not set for this job. + if (!task.getIngestJob().shouldProcessUnallocatedSpace() + && file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)) { + return false; + } + + // Skip the task if the file is actually the pseudo-file for the parent + // or current directory. + String fileName = file.getName(); + if (fileName.equals(".") || fileName.equals("..")) { + return false; + } + + // Skip the task if the file is one of a select group of special, large + // NTFS or FAT file system files. + if (file instanceof org.sleuthkit.datamodel.File) { + final org.sleuthkit.datamodel.File f = (org.sleuthkit.datamodel.File) file; + + // Get the type of the file system, if any, that owns the file. + TskData.TSK_FS_TYPE_ENUM fsType = TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_UNSUPP; + try { + FileSystem fs = f.getFileSystem(); + if (fs != null) { + fsType = fs.getFsType(); + } + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error querying file system for " + f, ex); //NON-NLS + } + + // If the file system is not NTFS or FAT, don't skip the file. + if ((fsType.getValue() & FAT_NTFS_FLAGS) == 0) { + return true; + } + + // Find out whether the file is in a root directory. + boolean isInRootDir = false; + try { + AbstractFile parent = f.getParentDirectory(); + isInRootDir = parent.isRoot(); + } catch (TskCoreException ex) { + logger.log(Level.WARNING, "Error querying parent directory for" + f.getName(), ex); //NON-NLS + } + + // If the file is in the root directory of an NTFS or FAT file + // system, check its meta-address and check its name for the '$' + // character and a ':' character (not a default attribute). + if (isInRootDir && f.getMetaAddr() < 32) { + String name = f.getName(); + if (name.length() > 0 && name.charAt(0) == '$' && name.contains(":")) { + return false; + } + } + } + + return true; } /** diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java deleted file mode 100644 index 853e4fb294..0000000000 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestibleFileFilter.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2012-2015 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.ingest; - -import java.util.logging.Level; -import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.datamodel.AbstractFile; -import org.sleuthkit.datamodel.FileSystem; -import org.sleuthkit.datamodel.TskCoreException; -import org.sleuthkit.datamodel.TskData; - -/** - * Utility class for identifying files that should not be ingested: synthesized - * unallocated space files, pseudo-files, and special NTFS or FAT file system - * files. - */ -public class IngestibleFileFilter { - - private static final Logger logger = Logger.getLogger(IngestibleFileFilter.class.getName()); - private static final int FAT_NTFS_FLAGS = TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_FAT12.getValue() | TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_FAT16.getValue() | TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_FAT32.getValue() | TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_NTFS.getValue(); - - /** - * - * @param candidateFile - * @param excludeUnallocSpaceFiles - * - * @return - */ - static boolean isIngestible(AbstractFile candidateFile, boolean excludeUnallocSpaceFiles) { - /* - * Filter out synthesized unallocated space files. - */ - if (excludeUnallocSpaceFiles && candidateFile.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)) { - return false; - } - - /* - * Filter out pseudo-files. - */ - String fileName = candidateFile.getName(); - if (fileName.equals(".") || fileName.equals("..")) { - return false; - } - - if (candidateFile instanceof org.sleuthkit.datamodel.File) { - /* - * Is the file in an NTFS or FAT file system? - */ - org.sleuthkit.datamodel.File file = (org.sleuthkit.datamodel.File) candidateFile; - TskData.TSK_FS_TYPE_ENUM fileSystemType = TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_UNSUPP; - try { - FileSystem fileSystem = file.getFileSystem(); - if (null != fileSystem) { - fileSystemType = fileSystem.getFsType(); - } - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error querying file system for " + file, ex); //NON-NLS - } - if ((fileSystemType.getValue() & FAT_NTFS_FLAGS) == 0) { - return true; - } - - /* - * Is the NTFS or FAT file in the root directory? - */ - boolean isInRootDir = false; - try { - AbstractFile parent = file.getParentDirectory(); - isInRootDir = parent.isRoot(); - } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Error querying parent directory for" + file.getName(), ex); //NON-NLS - } - - /* - * Check its meta-address and check its name for the '$' character - * and a ':' character (not a default attribute). - */ - if (isInRootDir && file.getMetaAddr() < 32) { - String name = file.getName(); - if (name.length() > 0 && name.charAt(0) == '$' && name.contains(":")) { - return false; - } - } - } - - return true; - } - - /** - * Prevents instantiation of this class. - */ - private IngestibleFileFilter() { - } - -}