19 package org.sleuthkit.autopsy.discovery.search;
21 import com.google.common.collect.ImmutableSet;
22 import java.util.ArrayList;
23 import java.util.Arrays;
24 import java.util.Collection;
25 import java.util.Collections;
26 import java.util.EnumSet;
27 import java.util.List;
29 import org.openide.util.NbBundle;
39 private static final Set<BlackboardArtifact.ARTIFACT_TYPE>
DOMAIN_ARTIFACT_TYPES = EnumSet.of(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK, BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE, BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE, BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD, BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY, BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY);
45 "SearchData.Frequency.unique.displayName=Unique (1)",
46 "SearchData.Frequency.rare.displayName=Rare (2-10)",
47 "SearchData.Frequency.common.displayName=Common (11 - 100)",
48 "SearchData.Frequency.verycommon.displayName=Very Common (100+)",
49 "SearchData.Frequency.known.displayName=Known (NSRL)",
50 "SearchData.Frequency.unknown.displayName=Unknown",})
52 UNIQUE(0, 1, Bundle.SearchData_Frequency_unique_displayName()),
53 RARE(1, 10, Bundle.SearchData_Frequency_rare_displayName()),
54 COMMON(2, 100, Bundle.SearchData_Frequency_common_displayName()),
55 VERY_COMMON(3, 0, Bundle.SearchData_Frequency_verycommon_displayName()),
56 KNOWN(4, 0, Bundle.SearchData_Frequency_known_displayName()),
57 UNKNOWN(5, 0, Bundle.SearchData_Frequency_unknown_displayName());
70 Frequency(
int ranking,
int maxOccur, String displayName) {
71 this.ranking = ranking;
72 this.maxOccur = maxOccur;
73 this.displayName = displayName;
93 if (count <= UNIQUE.getMaxOccur()) {
95 }
else if (count <= RARE.getMaxOccur()) {
97 }
else if (count <= COMMON.getMaxOccur()) {
110 return Arrays.asList(UNIQUE, RARE, COMMON, VERY_COMMON, KNOWN);
120 return Arrays.asList(KNOWN, UNKNOWN);
142 "SearchData.FileSize.XXLARGE.displayName=XXLarge",
143 "SearchData.FileSize.XLARGE.displayName=XLarge",
144 "SearchData.FileSize.LARGE.displayName=Large",
145 "SearchData.FileSize.MEDIUM.displayName=Medium",
146 "SearchData.FileSize.SMALL.displayName=Small",
147 "SearchData.FileSize.XSMALL.displayName=XSmall",
148 "SearchData.FileSize.10PlusGb=: 10GB+",
149 "SearchData.FileSize.5gbto10gb=: 5-10GB",
150 "SearchData.FileSize.1gbto5gb=: 1-5GB",
151 "SearchData.FileSize.100mbto1gb=: 100MB-1GB",
152 "SearchData.FileSize.200PlusMb=: 200MB+",
153 "SearchData.FileSize.50mbto200mb=: 50-200MB",
154 "SearchData.FileSize.500kbto100mb=: 500KB-100MB",
155 "SearchData.FileSize.1mbto50mb=: 1-50MB",
156 "SearchData.FileSize.100kbto1mb=: 100KB-1MB",
157 "SearchData.FileSize.16kbto100kb=: 16-100KB",
158 "SearchData.FileSize.upTo500kb=: 0-500KB",
159 "SearchData.FileSize.upTo16kb=: 0-16KB",})
161 XXLARGE_VIDEO(0, 10000 * BYTES_PER_MB, -1, Bundle.SearchData_FileSize_XXLARGE_displayName(), Bundle.SearchData_FileSize_10PlusGb()),
162 XLARGE_VIDEO(1, 5000 * BYTES_PER_MB, 10000 * BYTES_PER_MB, Bundle.SearchData_FileSize_XLARGE_displayName(), Bundle.SearchData_FileSize_5gbto10gb()),
163 LARGE_VIDEO(2, 1000 * BYTES_PER_MB, 5000 * BYTES_PER_MB, Bundle.SearchData_FileSize_LARGE_displayName(), Bundle.SearchData_FileSize_1gbto5gb()),
164 MEDIUM_VIDEO(3, 100 * BYTES_PER_MB, 1000 * BYTES_PER_MB, Bundle.SearchData_FileSize_MEDIUM_displayName(), Bundle.SearchData_FileSize_100mbto1gb()),
165 SMALL_VIDEO(4, 500000, 100 * BYTES_PER_MB, Bundle.SearchData_FileSize_SMALL_displayName(), Bundle.SearchData_FileSize_500kbto100mb()),
166 XSMALL_VIDEO(5, 0, 500000, Bundle.SearchData_FileSize_XSMALL_displayName(), Bundle.SearchData_FileSize_upTo500kb()),
167 XXLARGE_IMAGE(6, 200 * BYTES_PER_MB, -1, Bundle.SearchData_FileSize_XXLARGE_displayName(), Bundle.SearchData_FileSize_200PlusMb()),
168 XLARGE_IMAGE(7, 50 * BYTES_PER_MB, 200 * BYTES_PER_MB, Bundle.SearchData_FileSize_XLARGE_displayName(), Bundle.SearchData_FileSize_50mbto200mb()),
169 LARGE_IMAGE(8, 1 * BYTES_PER_MB, 50 * BYTES_PER_MB, Bundle.SearchData_FileSize_LARGE_displayName(), Bundle.SearchData_FileSize_1mbto50mb()),
170 MEDIUM_IMAGE(9, 100000, 1 * BYTES_PER_MB, Bundle.SearchData_FileSize_MEDIUM_displayName(), Bundle.SearchData_FileSize_100kbto1mb()),
171 SMALL_IMAGE(10, 16000, 100000, Bundle.SearchData_FileSize_SMALL_displayName(), Bundle.SearchData_FileSize_16kbto100kb()),
172 XSMALL_IMAGE(11, 0, 16000, Bundle.SearchData_FileSize_XSMALL_displayName(), Bundle.SearchData_FileSize_upTo16kb());
179 final static long NO_MAXIMUM = -1;
191 FileSize(
int ranking,
long minB,
long maxB, String displayName, String displaySize) {
192 this.ranking = ranking;
193 this.minBytes = minB;
195 this.maxBytes = maxB;
197 this.maxBytes = NO_MAXIMUM;
199 this.sizeGroup = displayName;
200 this.displaySize = displaySize;
212 if (size > XXLARGE_IMAGE.getMinBytes()) {
213 return XXLARGE_IMAGE;
214 }
else if (size > XLARGE_IMAGE.getMinBytes()) {
216 }
else if (size > LARGE_IMAGE.getMinBytes()) {
218 }
else if (size > MEDIUM_IMAGE.getMinBytes()) {
220 }
else if (size > SMALL_IMAGE.getMinBytes()) {
236 if (size > XXLARGE_VIDEO.getMinBytes()) {
237 return XXLARGE_VIDEO;
238 }
else if (size > XLARGE_VIDEO.getMinBytes()) {
240 }
else if (size > LARGE_VIDEO.getMinBytes()) {
242 }
else if (size > MEDIUM_VIDEO.getMinBytes()) {
244 }
else if (size > SMALL_VIDEO.getMinBytes()) {
280 return sizeGroup + displaySize;
299 return Arrays.asList(XXLARGE_IMAGE, XLARGE_IMAGE, LARGE_IMAGE, MEDIUM_IMAGE, SMALL_IMAGE, XSMALL_IMAGE);
308 return Arrays.asList(XXLARGE_VIDEO, XLARGE_VIDEO, LARGE_VIDEO, MEDIUM_VIDEO, SMALL_VIDEO, XSMALL_VIDEO);
314 =
new ImmutableSet.Builder<String>()
319 "application/xhtml+xml",
320 "application/x-msoffice",
321 "application/msword",
322 "application/msword2",
323 "application/vnd.wordperfect",
324 "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
325 "application/vnd.ms-powerpoint",
326 "application/vnd.openxmlformats-officedocument.presentationml.presentation",
327 "application/vnd.ms-excel",
328 "application/vnd.ms-excel.sheet.4",
329 "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
330 "application/vnd.oasis.opendocument.presentation",
331 "application/vnd.oasis.opendocument.spreadsheet",
332 "application/vnd.oasis.opendocument.text"
336 =
new ImmutableSet.Builder<String>()
337 .add(
"application/pdf",
338 "application/xhtml+xml").build();
355 "SearchData.FileType.Audio.displayName=Audio",
356 "SearchData.FileType.Video.displayName=Video",
357 "SearchData.FileType.Image.displayName=Image",
358 "SearchData.FileType.Documents.displayName=Document",
359 "SearchData.FileType.Executables.displayName=Executable",
360 "SearchData.AttributeType.Domain.displayName=Domain",
361 "SearchData.FileType.Other.displayName=Other/Unknown"})
370 OTHER(5, Bundle.SearchData_FileType_Other_displayName(),
new ArrayList<>(),
new ArrayList<>());
387 Type(
int value, String displayName, Collection<String> mediaTypes, Collection<BlackboardArtifact.ARTIFACT_TYPE> artifactTypes) {
388 this.ranking = value;
389 this.displayName = displayName;
390 this.mediaTypes = mediaTypes;
391 this.artifactTypes = artifactTypes;
400 return Collections.unmodifiableCollection(mediaTypes);
409 return Collections.unmodifiableCollection(artifactTypes);
432 "SearchData.Score.notable.displayName=Notable",
433 "SearchData.Score.interesting.displayName=Interesting",
434 "SearchData.Score.unknown.displayName=Unknown",})
436 NOTABLE(0, Bundle.SearchData_Score_notable_displayName()),
437 INTERESTING(1, Bundle.SearchData_Score_interesting_displayName()),
438 UNKNOWN(2, Bundle.SearchData_Score_unknown_displayName());
449 Score(
int ranking, String displayName) {
450 this.ranking = ranking;
451 this.displayName = displayName;
469 return Arrays.asList(NOTABLE, INTERESTING);
static Collection< String > getDocTypesWithoutImageExtraction()
static List< FileSize > getDefaultSizeOptions()
Collection< String > getMediaTypes()
final Collection< String > mediaTypes
static FileSize fromVideoSize(long size)
static List< Score > getOptionsForFiltering()
static Frequency fromCount(long count)
Type(int value, String displayName, Collection< String > mediaTypes, Collection< BlackboardArtifact.ARTIFACT_TYPE > artifactTypes)
static final ImmutableSet< String > IMAGE_UNSUPPORTED_DOC_TYPES
Collection< BlackboardArtifact.ARTIFACT_TYPE > getArtifactTypes()
Frequency(int ranking, int maxOccur, String displayName)
static List< Frequency > getOptionsForFilteringWithCr()
final Collection< BlackboardArtifact.ARTIFACT_TYPE > artifactTypes
FileSize(int ranking, long minB, long maxB, String displayName, String displaySize)
static final long BYTES_PER_MB
static final ImmutableSet< String > DOCUMENT_MIME_TYPES
static List< FileSize > getOptionsForVideos()
static List< Frequency > getOptionsForFilteringWithoutCr()
static FileSize fromImageSize(long size)
Score(int ranking, String displayName)
static final Set< BlackboardArtifact.ARTIFACT_TYPE > DOMAIN_ARTIFACT_TYPES