19 package org.sleuthkit.autopsy.datasourcesummary.datamodel;
22 import java.sql.SQLException;
23 import java.util.Arrays;
24 import java.util.HashSet;
41 BlackboardArtifact.ARTIFACT_TYPE.TSK_OS_INFO.getTypeID(),
42 BlackboardArtifact.ARTIFACT_TYPE.TSK_DATA_SOURCE_USAGE.getTypeID()
91 if (currentDataSource == null) {
95 final String valueParam =
"value";
96 final String countParam =
"count";
97 String query =
"SELECT SUM(size) AS " + valueParam +
", COUNT(*) AS " + countParam
99 +
" WHERE " + DataSourceInfoUtilities.getMetaFlagsContainsStatement(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC)
100 +
" AND type<>" + TskData.TSK_DB_FILES_TYPE_ENUM.SLACK.getFileType()
101 +
" AND type<>" + TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR.getFileType()
102 +
" AND dir_type<>" + TskData.TSK_FS_NAME_TYPE_ENUM.VIRT_DIR.getValue()
104 +
" AND data_source_obj_id=" + currentDataSource.getId();
106 DataSourceInfoUtilities.ResultSetHandler<Long> handler = (resultSet) -> {
107 if (resultSet.next()) {
109 long resultCount = resultSet.getLong(valueParam);
110 return (resultCount > 0) ? resultSet.getLong(valueParam) : null;
116 return DataSourceInfoUtilities.getBaseQueryResult(provider.
get(), query, handler);
135 if (dataSource == null) {
140 BlackboardArtifact.ARTIFACT_TYPE.TSK_OS_INFO.getTypeID(),
141 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID());
160 if (dataSource == null) {
165 BlackboardArtifact.ARTIFACT_TYPE.TSK_DATA_SOURCE_USAGE.getTypeID(),
166 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION.getTypeID());
191 DataSourceInfoUtilities.ResultSetHandler<String> handler = (resultSet) -> {
193 boolean first =
true;
194 while (resultSet.next()) {
200 toRet += resultSet.getString(valueParam);
206 return DataSourceInfoUtilities.getBaseQueryResult(provider.
get(), query, handler);
227 final String valueParam =
"concatted_attribute_value";
228 String query =
"SELECT attr.value_text AS " + valueParam
229 +
" FROM blackboard_artifacts bba "
230 +
" INNER JOIN blackboard_attributes attr ON bba.artifact_id = attr.artifact_id "
231 +
" WHERE bba.data_source_obj_id = " + dataSourceId
232 +
" AND bba.artifact_type_id = " + artifactTypeId
233 +
" AND attr.attribute_type_id = " + attributeTypeId;
235 String separator =
", ";
final SleuthkitCaseProvider provider
Long getSizeOfUnallocatedFiles(DataSource currentDataSource)
SleuthkitCaseProvider DEFAULT
boolean isRefreshRequired(AbstractFile file)
ContainerSummary(SleuthkitCaseProvider provider)
String getConcattedAttrValue(long dataSourceId, int artifactTypeId, int attributeTypeId)
Set< Integer > getArtifactTypeIdsForRefresh()
boolean isRefreshRequired(ModuleContentEvent evt)
static final Set< Integer > ARTIFACT_UPDATE_TYPE_IDS
String getOperatingSystems(DataSource dataSource)
String getDataSourceType(DataSource dataSource)
String getConcattedStringsResult(String query, String valueParam, String separator)