1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-02 23:15:51 +00:00

Merge branch 'develop' into zip-proper-filename-decoding

This commit is contained in:
Ethan Roseman
2019-08-13 16:52:45 -04:00
15 changed files with 138 additions and 116 deletions

View File

@@ -60,7 +60,6 @@ Case.progressMessage.cancelling=Cancelling...
Case.progressMessage.clearingTempDirectory=Clearing case temp directory...
Case.progressMessage.closingApplicationServiceResources=Closing case-specific application service resources...
Case.progressMessage.closingCaseDatabase=Closing case database...
Case.progressMessage.closingCaseLevelServices=Closing case-level services...
Case.progressMessage.connectingToCoordSvc=Connecting to coordination service...
Case.progressMessage.creatingCaseDatabase=Creating case database...
Case.progressMessage.creatingCaseDirectory=Creating case directory...

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2019 Basis Technology Corp.
* Copyright 2012-2019 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,7 +27,6 @@ import java.awt.event.ActionListener;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.File;
import java.io.IOException;
import java.nio.file.InvalidPathException;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -36,7 +35,6 @@ import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
@@ -2413,7 +2411,6 @@ public class Case {
@Messages({
"Case.progressMessage.shuttingDownNetworkCommunications=Shutting down network communications...",
"Case.progressMessage.closingApplicationServiceResources=Closing case-specific application service resources...",
"Case.progressMessage.closingCaseLevelServices=Closing case-level services...",
"Case.progressMessage.closingCaseDatabase=Closing case database..."
})
private void close(ProgressIndicator progressIndicator) {
@@ -2439,19 +2436,7 @@ public class Case {
closeAppServiceCaseResources();
/*
* Close the case-level services.
*/
if (null != caseServices) {
progressIndicator.progress(Bundle.Case_progressMessage_closingCaseLevelServices());
try {
this.caseServices.close();
} catch (IOException ex) {
logger.log(Level.SEVERE, String.format("Error closing internal case services for %s at %s", this.getName(), this.getCaseDirectory()), ex);
}
}
/*
* Close the case database
* Close the case database.
*/
if (null != caseDb) {
progressIndicator.progress(Bundle.Case_progressMessage_closingCaseDatabase());

View File

@@ -15,9 +15,13 @@
* 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.
*
* TODO (AUT-2158): This class should not extend Closeable.
*/
package org.sleuthkit.autopsy.casemodule.services;
import java.io.Closeable;
import java.io.IOException;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute;
@@ -29,7 +33,7 @@ import org.sleuthkit.datamodel.BlackboardAttribute;
* @deprecated Use org.sleuthkit.datamodel.Blackboard instead.
*/
@Deprecated
public final class Blackboard {
public final class Blackboard implements Closeable {
/**
* Constructs a representation of the blackboard, a place where artifacts
@@ -105,6 +109,21 @@ public final class Blackboard {
}
}
/**
* Closes the artifacts blackboard.
*
* @throws IOException If there is a problem closing the artifacts
* blackboard.
* @deprecated Do not use.
*/
@Deprecated
public void close() throws IOException {
/*
* No-op maintained for backwards compatibility. Clients should not
* attempt to close case services.
*/
}
/**
* A blackboard exception.
*

View File

@@ -2,8 +2,7 @@
*
* Autopsy Forensic Browser
*
* Copyright 2011-2018 Basis Technology Corp.
*
* Copyright 2012-2019 Basis Technology Corp.
* Copyright 2012 42six Solutions.
* Contact: aebadirad <at> 42six <dot> com
* Project Contact/Architect: carrier <at> sleuthkit <dot> org
@@ -19,6 +18,8 @@
* 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.
*
* TODO (AUT-2158): This class should not extend Closeable.
*/
package org.sleuthkit.autopsy.casemodule.services;
@@ -87,25 +88,26 @@ public class FileManager implements Closeable {
}
return caseDb.findAllFilesWhere(createFileTypeInCondition(mimeTypes));
}
/**
* Finds all parent_paths that match the specified parentPath and are in the specified data source.
*
* Finds all parent_paths that match the specified parentPath and are in the
* specified data source.
*
* @param dataSourceObjectID - the id of the data source to get files from
* @param parentPath - the parent path that all files should be like
*
* @param parentPath - the parent path that all files should be like
*
* @return The list of files
*
* @throws TskCoreException If there is a problem querying the case
*
* @throws TskCoreException If there is a problem querying the case
* database.
*/
public synchronized List<AbstractFile> findFilesByParentPath(long dataSourceObjectID, String parentPath) throws TskCoreException {
if (null == caseDb) {
throw new TskCoreException("File manager has been closed");
}
return caseDb.findAllFilesWhere(createParentPathCondition(dataSourceObjectID,parentPath));
return caseDb.findAllFilesWhere(createParentPathCondition(dataSourceObjectID, parentPath));
}
/**
* Finds all files in a given data source (image, local/logical files set,
* etc.) with types that match one of a collection of MIME types.
@@ -138,18 +140,18 @@ public class FileManager implements Closeable {
}
/**
* Converts a data source object id and a parent path into SQL
* Converts a data source object id and a parent path into SQL
* data_source_obj_id = ? AND parent_path LIKE ?%
*
*
* @param dataSourceObjectID
* @param parentPath
* @return
*
* @return
*/
private static String createParentPathCondition(long dataSourceObjectID, String parentPath){
return "data_source_obj_id = " + dataSourceObjectID +" AND parent_path LIKE '" + parentPath +"%'";
private static String createParentPathCondition(long dataSourceObjectID, String parentPath) {
return "data_source_obj_id = " + dataSourceObjectID + " AND parent_path LIKE '" + parentPath + "%'";
}
/**
* Finds all files and directories with a given file name. The name search
* is for full or partial matches and is case insensitive (a case
@@ -180,8 +182,10 @@ public class FileManager implements Closeable {
* case insensitive (a case insensitive SQL LIKE clause is used to query the
* case database).
*
* @param fileName The full name or a pattern to match on part of the name
* @param parentSubString Substring that must exist in parent path. Will be surrounded by % in LIKE query.
* @param fileName The full name or a pattern to match on part of the
* name
* @param parentSubString Substring that must exist in parent path. Will be
* surrounded by % in LIKE query.
*
* @return The matching files and directories.
*
@@ -233,7 +237,7 @@ public class FileManager implements Closeable {
* LIKE clause is used to query the case database).
*
* @param dataSource The data source.
* @param fileName The full name or a pattern to match on part of the name
* @param fileName The full name or a pattern to match on part of the name
*
* @return The matching files and directories.
*
@@ -254,9 +258,11 @@ public class FileManager implements Closeable {
* insensitive (a case insensitive SQL LIKE clause is used to query the case
* database).
*
* @param dataSource The data source.
* @param fileName The full name or a pattern to match on part of the name
* @param parentSubString Substring that must exist in parent path. Will be surrounded by % in LIKE query.
* @param dataSource The data source.
* @param fileName The full name or a pattern to match on part of the
* name
* @param parentSubString Substring that must exist in parent path. Will be
* surrounded by % in LIKE query.
*
* @return The matching files and directories.
*
@@ -278,7 +284,7 @@ public class FileManager implements Closeable {
* database).
*
* @param dataSource The data source.
* @param fileName The full name or a pattern to match on part of the name
* @param fileName The full name or a pattern to match on part of the name
* @param parent The parent file or directory.
*
* @return The matching files and directories.
@@ -360,6 +366,7 @@ public class FileManager implements Closeable {
ctime, crtime, atime, mtime,
isFile, parentObj, rederiveDetails, toolName, toolVersion, otherDetails, encodingType);
}
/**
* Update a derived file which already exists in the the case.
*
@@ -370,7 +377,7 @@ public class FileManager implements Closeable {
* @param ctime The change time of the file.
* @param crtime The create time of the file
* @param atime The accessed time of the file.
* @param mimeType The MIME type the updated file should have, null
* @param mimeType The MIME type the updated file should have, null
* to unset it
* @param mtime The modified time of the file.
* @param isFile True if a file, false if a directory.
@@ -614,10 +621,15 @@ public class FileManager implements Closeable {
* Closes the file manager.
*
* @throws IOException If there is a problem closing the file manager.
* @deprecated Do not use.
*/
@Deprecated
@Override
public synchronized void close() throws IOException {
caseDb = null;
/*
* No-op maintained for backwards compatibility. Clients should not
* attempt to close case services.
*/
}
/**
@@ -754,7 +766,7 @@ public class FileManager implements Closeable {
* the parent local directory.
* @param localFile The local/logical file or directory.
* @param progressUpdater notifier to receive progress notifications on
* folders added, or null if not used. Called after
* folders added, or null if not used. Called after
* each file/directory is added to the case database.
*
* @return An AbstractFile representation of the local/logical file.

View File

@@ -23,8 +23,6 @@ package org.sleuthkit.autopsy.casemodule.services;
import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openide.util.Lookup;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
@@ -33,13 +31,13 @@ import org.sleuthkit.datamodel.SleuthkitCase;
/**
* A collection of case-level services: file manager, tags manager, keyword
* search service, artifacts blackboard.
*
* TODO (AUT-2158): This class should not extend Closeable.
*/
public class Services implements Closeable {
private final List<Closeable> services = new ArrayList<>();
private final FileManager fileManager;
private final TagsManager tagsManager;
private final KeywordSearchService keywordSearchService;
/**
* Constructs a collection of case-level services: file manager, tags
@@ -49,16 +47,7 @@ public class Services implements Closeable {
*/
public Services(SleuthkitCase caseDb) {
fileManager = new FileManager(caseDb);
services.add(fileManager);
tagsManager = new TagsManager(caseDb);
services.add(tagsManager);
//This lookup fails in the functional test code. See JIRA-4571 for details.
//For the time being, the closing of this service at line 108 will be made
//null safe so that the functional tests run with no issues.
keywordSearchService = Lookup.getDefault().lookup(KeywordSearchService.class);
services.add(keywordSearchService);
}
/**
@@ -85,7 +74,7 @@ public class Services implements Closeable {
* @return The keyword search service for the current case.
*/
public KeywordSearchService getKeywordSearchService() {
return keywordSearchService;
return Lookup.getDefault().lookup(KeywordSearchService.class);
}
/**
@@ -103,7 +92,7 @@ public class Services implements Closeable {
*
* @return The blackboard service for the current case.
*
* @deprecated Use org.sleuthkit.autopsy.casemodule.getCaseBlackboard
* @deprecated Use org.sleuthkit.autopsy.casemodule.getArtifactsBlackboard
* instead
*/
@Deprecated
@@ -115,14 +104,15 @@ public class Services implements Closeable {
* Closes the services for the current case.
*
* @throws IOException if there is a problem closing the services.
* @deprecated Do not use.
*/
@Deprecated
@Override
public void close() throws IOException {
for (Closeable service : services) {
if (service != null) {
service.close();
}
}
/*
* No-op maintained for backwards compatibility. Clients should not
* attempt to close case services.
*/
}
}

View File

@@ -59,20 +59,21 @@ class GetSCOTask implements Runnable {
public void run() {
AbstractContentNode<?> contentNode = weakNodeRef.get();
//Check for stale reference
if (contentNode == null) {
//Check for stale reference or if columns are disabled
if (contentNode == null || UserPreferences.getHideSCOColumns()) {
return;
}
// get the SCO column values
List<Tag> tags = contentNode.getAllTagsFromDatabase();
CorrelationAttributeInstance fileAttribute = contentNode.getCorrelationAttributeInstance();
SCOData scoData = new SCOData();
scoData.setScoreAndDescription(contentNode.getScorePropertyAndDescription(tags));
//getting the correlation attribute and setting the comment column is done before the eamdb isEnabled check
//because the Comment column will reflect the presence of comments in the CR when the CR is enabled, but reflect tag comments regardless
CorrelationAttributeInstance fileAttribute = contentNode.getCorrelationAttributeInstance();
scoData.setComment(contentNode.getCommentProperty(tags, fileAttribute));
if (EamDb.isEnabled() && !UserPreferences.getHideSCOColumns()) {
if (EamDb.isEnabled()) {
Type type = null;
String value = null;
String description = Bundle.GetSCOTask_occurrences_defaultDescription();

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2018 Basis Technology Corp.
* Copyright 2015-2019 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,17 +19,23 @@
package org.sleuthkit.autopsy.keywordsearchservice;
import java.io.Closeable;
import java.io.IOException;
import org.sleuthkit.autopsy.casemodule.CaseMetadata;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.TskCoreException;
/**
* An interface for implementations of a keyword search service.
* You can find the implementations by using Lookup, such as:
* Lookup.getDefault().lookup(KeywordSearchService.class)
* An interface for implementations of a keyword search service. You can find
* the implementations by using Lookup, such as:
*
* Lookup.getDefault().lookup(KeywordSearchService.class)
*
* although most clients should obtain a keyword search service by calling:
*
* Case.getCurrentCase().getServices().getKeywordSearchService()
*
* TODO (AUT-2158: This interface should not extend Closeable.
* TODO (AUT-2158): This interface should not extend Closeable.
*/
public interface KeywordSearchService extends Closeable {
@@ -48,20 +54,19 @@ public interface KeywordSearchService extends Closeable {
* all of its attributes.
*
* @param artifact The artifact to index.
*
* @deprecated Call org.sleuthkit.datamodel.Blackboard.postArtifact
* instead.
*
* @deprecated Call org.sleuthkit.datamodel.Blackboard.postArtifact instead.
*
* @throws org.sleuthkit.datamodel.TskCoreException
*/
@Deprecated
@Deprecated
public void indexArtifact(BlackboardArtifact artifact) throws TskCoreException;
/**
* Add the given Content object to the text index. This message should only
* be used in atypical cases, such as indexing a report. Artifacts are indexed
* when org.sleuthkit.datamodel.Blackboard.postArtifact
* is called and files are indexed during ingest.
* Add the given Content object to the text index. This message should only
* be used in atypical cases, such as indexing a report. Artifacts are
* indexed when org.sleuthkit.datamodel.Blackboard.postArtifact is called
* and files are indexed during ingest.
*
* @param content The content to index.
*
@@ -77,5 +82,19 @@ public interface KeywordSearchService extends Closeable {
* @throws KeywordSearchServiceException if unable to delete.
*/
public void deleteTextIndex(CaseMetadata metadata) throws KeywordSearchServiceException;
/**
* Closes the keyword search service.
*
* @throws IOException If there is a problem closing the file manager.
* @deprecated Do not use.
*/
@Deprecated
default public void close() throws IOException {
/*
* No-op maintained for backwards compatibility. Clients should not
* attempt to close case services.
*/
}
}

View File

@@ -51,18 +51,18 @@ import org.sleuthkit.datamodel.TskCoreException;
* publicly exposing the keyword search module settings fails due to a circular
* dependency.
*/
public class CommonAttributeSearchInterCaseTests extends NbTestCase {
public class CommonAttributeSearchInterCaseTest extends NbTestCase {
private final InterCaseTestUtils utils;
public static Test suite() {
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(CommonAttributeSearchInterCaseTests.class).
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(CommonAttributeSearchInterCaseTest.class).
clusters(".*").
enableModules(".*");
return conf.suite();
}
public CommonAttributeSearchInterCaseTests(String name) {
public CommonAttributeSearchInterCaseTest(String name) {
super(name);
this.utils = new InterCaseTestUtils(this);
}

View File

@@ -47,18 +47,18 @@ import org.sleuthkit.datamodel.TskCoreException;
* all data sources: One node for Hash C (3_1_C.jpg, 3_2_C.jpg)
*
*/
public class IngestedWithHashAndFileTypeInterCaseTests extends NbTestCase {
public class IngestedWithHashAndFileTypeInterCaseTest extends NbTestCase {
private final InterCaseTestUtils utils;
public static Test suite() {
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(IngestedWithHashAndFileTypeInterCaseTests.class).
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(IngestedWithHashAndFileTypeInterCaseTest.class).
clusters(".*").
enableModules(".*");
return conf.suite();
}
public IngestedWithHashAndFileTypeInterCaseTests(String name) {
public IngestedWithHashAndFileTypeInterCaseTest(String name) {
super(name);
this.utils = new InterCaseTestUtils(this);
}

View File

@@ -48,10 +48,10 @@ import org.sleuthkit.datamodel.TskCoreException;
/**
* Add set 1, set 2, set 3, and set 4 to case and ingest with hash algorithm.
*/
public class IngestedWithHashAndFileTypeIntraCaseTests extends NbTestCase {
public class IngestedWithHashAndFileTypeIntraCaseTest extends NbTestCase {
public static Test suite() {
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(IngestedWithHashAndFileTypeIntraCaseTests.class).
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(IngestedWithHashAndFileTypeIntraCaseTest.class).
clusters(".*").
enableModules(".*");
return conf.suite();
@@ -59,7 +59,7 @@ public class IngestedWithHashAndFileTypeIntraCaseTests extends NbTestCase {
private final IntraCaseTestUtils utils;
public IngestedWithHashAndFileTypeIntraCaseTests(String name) {
public IngestedWithHashAndFileTypeIntraCaseTest(String name) {
super(name);
this.utils = new IntraCaseTestUtils(this, "IngestedWithHashAndFileTypeTests");
@@ -76,7 +76,7 @@ public class IngestedWithHashAndFileTypeIntraCaseTests extends NbTestCase {
templates.add(hashLookupTemplate);
templates.add(mimeTypeLookupTemplate);
IngestJobSettings ingestJobSettings = new IngestJobSettings(IngestedWithHashAndFileTypeIntraCaseTests.class.getCanonicalName(), IngestType.FILES_ONLY, templates);
IngestJobSettings ingestJobSettings = new IngestJobSettings(IngestedWithHashAndFileTypeIntraCaseTest.class.getCanonicalName(), IngestType.FILES_ONLY, templates);
try {
IngestUtils.runIngestJob(Case.getCurrentCaseThrows().getDataSources(), ingestJobSettings);

View File

@@ -51,10 +51,10 @@ import org.sleuthkit.datamodel.TskCoreException;
* Add images set 1, set 2, set 3, and set 4 to case. Do not run mime type
* module.
*/
public class IngestedWithNoFileTypesIntraCaseTests extends NbTestCase {
public class IngestedWithNoFileTypesIntraCaseTest extends NbTestCase {
public static Test suite() {
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(IngestedWithNoFileTypesIntraCaseTests.class).
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(IngestedWithNoFileTypesIntraCaseTest.class).
clusters(".*").
enableModules(".*");
return conf.suite();
@@ -62,7 +62,7 @@ public class IngestedWithNoFileTypesIntraCaseTests extends NbTestCase {
private final IntraCaseTestUtils utils;
public IngestedWithNoFileTypesIntraCaseTests(String name) {
public IngestedWithNoFileTypesIntraCaseTest(String name) {
super(name);
this.utils = new IntraCaseTestUtils(this, "IngestedWithNoFileTypes");
@@ -77,7 +77,7 @@ public class IngestedWithNoFileTypesIntraCaseTests extends NbTestCase {
ArrayList<IngestModuleTemplate> templates = new ArrayList<>();
templates.add(hashLookupTemplate);
IngestJobSettings ingestJobSettings = new IngestJobSettings(IngestedWithNoFileTypesIntraCaseTests.class.getCanonicalName(), IngestJobSettings.IngestType.FILES_ONLY, templates);
IngestJobSettings ingestJobSettings = new IngestJobSettings(IngestedWithNoFileTypesIntraCaseTest.class.getCanonicalName(), IngestJobSettings.IngestType.FILES_ONLY, templates);
try {
IngestUtils.runIngestJob(Case.getCurrentCaseThrows().getDataSources(), ingestJobSettings);

View File

@@ -53,10 +53,10 @@ import org.sleuthkit.datamodel.TskCoreException;
*
* None of the test files should be found in the results of this test.
*/
public class MatchesInAtLeastTwoSourcesIntraCaseTests extends NbTestCase {
public class MatchesInAtLeastTwoSourcesIntraCaseTest extends NbTestCase {
public static Test suite() {
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(MatchesInAtLeastTwoSourcesIntraCaseTests.class).
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(MatchesInAtLeastTwoSourcesIntraCaseTest.class).
clusters(".*").
enableModules(".*");
return conf.suite();
@@ -64,7 +64,7 @@ public class MatchesInAtLeastTwoSourcesIntraCaseTests extends NbTestCase {
private final IntraCaseTestUtils utils;
public MatchesInAtLeastTwoSourcesIntraCaseTests(String name) {
public MatchesInAtLeastTwoSourcesIntraCaseTest(String name) {
super(name);
this.utils = new IntraCaseTestUtils(this, "MatchesInAtLeastTwoSources");
@@ -86,7 +86,7 @@ public class MatchesInAtLeastTwoSourcesIntraCaseTests extends NbTestCase {
templates.add(hashLookupTemplate);
templates.add(mimeTypeLookupTemplate);
IngestJobSettings ingestJobSettings = new IngestJobSettings(IngestedWithHashAndFileTypeIntraCaseTests.class.getCanonicalName(), IngestJobSettings.IngestType.FILES_ONLY, templates);
IngestJobSettings ingestJobSettings = new IngestJobSettings(IngestedWithHashAndFileTypeIntraCaseTest.class.getCanonicalName(), IngestJobSettings.IngestType.FILES_ONLY, templates);
try {
IngestUtils.runIngestJob(Case.getCurrentCaseThrows().getDataSources(), ingestJobSettings);

View File

@@ -45,10 +45,10 @@ import org.sleuthkit.datamodel.TskCoreException;
* Add images set 1, set 2, set 3, and set 4 to case. Do not ingest.
*
*/
public class UningestedCasesIntraCaseTests extends NbTestCase {
public class UningestedCasesIntraCaseTest extends NbTestCase {
public static Test suite() {
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(UningestedCasesIntraCaseTests.class).
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(UningestedCasesIntraCaseTest.class).
clusters(".*").
enableModules(".*");
return conf.suite();
@@ -56,7 +56,7 @@ public class UningestedCasesIntraCaseTests extends NbTestCase {
private final IntraCaseTestUtils utils;
public UningestedCasesIntraCaseTests(String name) {
public UningestedCasesIntraCaseTest(String name) {
super(name);
this.utils = new IntraCaseTestUtils(this, "UningestedCasesTests");

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2015-2018 Basis Technology Corp.
* Copyright 2015-2019 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -62,8 +62,8 @@ import org.sleuthkit.datamodel.TskCoreException;
@ServiceProviders(value = {
@ServiceProvider(service = KeywordSearchService.class)
,
@ServiceProvider(service = AutopsyService.class)}
)
@ServiceProvider(service = AutopsyService.class)
})
public class SolrSearchService implements KeywordSearchService, AutopsyService {
private static final String BAD_IP_ADDRESS_FORMAT = "ioexception occurred when talking to server"; //NON-NLS
@@ -136,7 +136,7 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService {
// Try the StringsTextExtractor if Tika extractions fails.
TextExtractor stringsExtractor = TextExtractorFactory.getStringsExtractor(content, null);
Reader stringsExtractedTextReader = stringsExtractor.getReader();
ingester.indexText(stringsExtractedTextReader,content.getId(),content.getName(), content, null);
ingester.indexText(stringsExtractedTextReader, content.getId(), content.getName(), content, null);
} catch (Ingester.IngesterException | TextExtractor.InitReaderException ex1) {
throw new TskCoreException("Error indexing content", ex1);
}
@@ -238,10 +238,6 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService {
"SolrSearchService.exceptionMessage.noCurrentSolrCore"));
}
@Override
public void close() throws IOException {
}
@Override
public String getServiceName() {
return NbBundle.getMessage(this.getClass(), "SolrSearchService.ServiceName");

View File

@@ -11,6 +11,7 @@ import sys
import psycopg2
import psycopg2.extras
import socket
import csv
class TskDbDiff(object):
"""Compares two TSK/Autospy SQLite databases.
@@ -436,8 +437,8 @@ def normalize_db_entry(line, files_table, vs_parts_table, vs_info_table, fs_info
ig_groups_seen_index = line.find('INSERT INTO "image_gallery_groups_seen"') > -1 or line.find('INSERT INTO image_gallery_groups_seen ') > -1
parens = line[line.find('(') + 1 : line.rfind(')')]
fields_list = parens.replace(" ", "").split(',')
fields_list = list(csv.reader([parens.replace(" ", "")], quotechar="'"))[0]
# remove object ID
if files_index:
newLine = ('INSERT INTO "tsk_files" VALUES(' + ', '.join(fields_list[1:]) + ');')