19 package org.sleuthkit.autopsy.discovery.search;
21 import java.util.ArrayList;
22 import java.util.Arrays;
23 import java.util.Collections;
24 import java.util.Comparator;
25 import java.util.List;
26 import org.openide.util.NbBundle;
34 private final List<Comparator<Result>>
comparators =
new ArrayList<>();
60 case BY_KEYWORD_LIST_NAMES:
75 case BY_LAST_ACTIVITY:
95 for (Comparator<Result> comp : comparators) {
96 result = comp.compare(result1, result2);
165 return new Comparator<Result>() {
173 String file1ParentPath;
176 }
catch (TskCoreException ingored) {
179 String file2ParentPath;
182 }
catch (TskCoreException ingored) {
185 return compareStrings(file1ParentPath.toLowerCase(), file2ParentPath.toLowerCase());
226 return -1 * Long.compare(((
ResultFile) result1).getFirstInstance().getSize(), ((
ResultFile) result2).getFirstInstance().getSize());
278 return Long.compare(secondPageViews, firstPageViews);
297 return Long.compare(secondActivityEnd, firstActivityEnd);
316 return Long.compare(secondFilesDownloaded, firstFilesDownloaded);
355 String string1 = s1 == null ?
"" : s1;
356 String string2 = s2 == null ?
"" : s2;
357 return string1.compareTo(string2);
365 "FileSorter.SortingMethod.datasource.displayName=Data Source",
366 "FileSorter.SortingMethod.filename.displayName=File Name",
367 "FileSorter.SortingMethod.filesize.displayName=File Size",
368 "FileSorter.SortingMethod.filetype.displayName=File Type",
369 "FileSorter.SortingMethod.frequency.displayName=Central Repo Frequency",
370 "FileSorter.SortingMethod.keywordlist.displayName=Keyword List Names",
371 "FileSorter.SortingMethod.fullPath.displayName=Full Path",
372 "FileSorter.SortingMethod.domain.displayName=Domain Name",
373 "FileSorter.SortingMethod.pageViews.displayName=Page Views",
374 "FileSorter.SortingMethod.downloads.displayName=File Downloads",
375 "FileSorter.SortingMethod.activity.displayName=Last Activity Date"})
377 BY_FILE_NAME(
new ArrayList<>(),
378 Bundle.FileSorter_SortingMethod_filename_displayName()),
379 BY_DATA_SOURCE(
new ArrayList<>(),
380 Bundle.FileSorter_SortingMethod_datasource_displayName()),
381 BY_FILE_SIZE(
new ArrayList<>(),
382 Bundle.FileSorter_SortingMethod_filesize_displayName()),
384 Bundle.FileSorter_SortingMethod_filetype_displayName()),
386 Bundle.FileSorter_SortingMethod_frequency_displayName()),
388 Bundle.FileSorter_SortingMethod_keywordlist_displayName()),
389 BY_FULL_PATH(
new ArrayList<>(),
390 Bundle.FileSorter_SortingMethod_fullPath_displayName()),
406 SortingMethod(List<DiscoveryAttributes.AttributeType> attributes, String displayName) {
407 this.requiredAttributes = attributes;
408 this.displayName = displayName;
422 return Collections.unmodifiableList(requiredAttributes);
431 return Arrays.asList(BY_FILE_SIZE, BY_FULL_PATH, BY_FILE_NAME, BY_DATA_SOURCE);
440 return Arrays.asList(BY_PAGE_VIEWS, BY_DOWNLOADS, BY_LAST_ACTIVITY, BY_DOMAIN_NAME);
static Comparator< Result > getParentPathComparator()
int compare(Result result1, Result result2)
static Comparator< Result > getMIMETypeComparator()
static Comparator< Result > getDataSourceComparator()
final List< Comparator< Result > > comparators
SortingMethod(List< DiscoveryAttributes.AttributeType > attributes, String displayName)
Long getFilesDownloaded()
static Comparator< Result > getFrequencyComparator()
static Comparator< Result > getLastActivityDateTimeComparator()
SearchData.Frequency getFrequency()
static Comparator< Result > getKeywordListNameComparator()
List< String > getKeywordListNames()
abstract SearchData.Type getType()
static Comparator< Result > getDefaultComparator()
final List< DiscoveryAttributes.AttributeType > requiredAttributes
static Comparator< Result > getPageViewComparator()
static Comparator< Result > getDomainNameComparator()
static List< SortingMethod > getOptionsForOrderingDomains()
static Comparator< Result > getFileNameComparator()
AbstractFile getFirstInstance()
static Comparator< Result > getFileSizeComparator()
ResultsSorter(SortingMethod method)
List< DiscoveryAttributes.AttributeType > getRequiredAttributes()
static Comparator< Result > getWebDownloadsComparator()
static Comparator< Result > getTypeComparator()
abstract long getDataSourceObjectId()
static List< SortingMethod > getOptionsForOrderingFiles()
static int compareStrings(String s1, String s2)