Sleuth Kit Java Bindings (JNI)  4.11.1
Java bindings for using The Sleuth Kit
TimelineFilter.java
Go to the documentation of this file.
1 /*
2  * Sleuth Kit Data Model
3  *
4  * Copyright 2018-2019 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.datamodel;
20 
21 import com.google.common.annotations.VisibleForTesting;
22 import com.google.common.collect.Lists;
23 import com.google.common.net.MediaType;
24 import java.util.ArrayList;
25 import java.util.Arrays;
26 import static java.util.Arrays.asList;
27 import java.util.Collection;
28 import java.util.HashSet;
29 import java.util.List;
30 import java.util.Objects;
31 import java.util.Set;
32 import java.util.stream.Collectors;
33 import static java.util.stream.Collectors.joining;
34 import java.util.stream.Stream;
35 import static org.apache.commons.lang3.ObjectUtils.notEqual;
36 import org.apache.commons.lang3.StringUtils;
38 
44 public abstract class TimelineFilter {
45 
51  public abstract String getDisplayName();
52 
62  abstract String getSQLWhere(TimelineManager manager);
63 
69  public abstract TimelineFilter copyOf();
70 
71  @SuppressWarnings("unchecked")
72  static <S extends TimelineFilter, T extends CompoundFilter<S>> T copySubFilters(T from, T to) {
73  from.getSubFilters().forEach(subFilter -> to.addSubFilter((S) subFilter.copyOf()));
74  return to;
75  }
76 
83  public static class IntersectionFilter<SubFilterType extends TimelineFilter> extends CompoundFilter<SubFilterType> {
84 
91  @VisibleForTesting
92  public IntersectionFilter(List<SubFilterType> subFilters) {
93  super(subFilters);
94  }
95 
96  @Override
98  @SuppressWarnings("unchecked")
99  List<SubFilterType> subfilters = Lists.transform(getSubFilters(), f -> (SubFilterType) f.copyOf()); //make copies of all the subfilters.
100  return new IntersectionFilter<>(subfilters);
101  }
102 
103  @Override
104  public String getDisplayName() {
105  String subFilterDisplayNames = getSubFilters().stream()
107  .collect(joining(","));
108  return BundleProvider.getBundle().getString("IntersectionFilter.displayName.text") + "[" + subFilterDisplayNames + "]";
109  }
110 
111  @Override
112  String getSQLWhere(TimelineManager manager) {
113  String trueLiteral = manager.getSQLWhere(null);
114  String join = this.getSubFilters().stream()
115  .filter(Objects::nonNull)
116  .map(filter -> filter.getSQLWhere(manager))
117  .filter(sqlString -> notEqual(sqlString, trueLiteral))
118  .collect(Collectors.joining(" AND "));
119  return join.isEmpty() ? trueLiteral : "(" + join + ")";
120  }
121 
122  }
123 
130  public static final class EventTypeFilter extends UnionFilter<EventTypeFilter> {
131 
132  private final TimelineEventType rootEventType;
133 
147  private EventTypeFilter(TimelineEventType rootEventType, boolean recursive) {
148  super(new ArrayList<>());
149  this.rootEventType = rootEventType;
150  if (recursive) {
151  // add subfilters for each subtype
152  for (TimelineEventType subType : rootEventType.getChildren()) {
153  if (!subType.isDeprecated()) {
154  addSubFilter(new EventTypeFilter(subType));
155  }
156  }
157  }
158  }
159 
170  public EventTypeFilter(TimelineEventType rootEventType) {
171  this(rootEventType, true);
172  }
173 
181  return rootEventType;
182  }
183 
184  @Override
185  public String getDisplayName() {
186  return (TimelineEventType.ROOT_EVENT_TYPE.equals(rootEventType)) ? BundleProvider.getBundle().getString("TypeFilter.displayName.text") : rootEventType.getDisplayName();
187  }
188 
189  @Override
191  //make a nonrecursive copy of this filter, and then copy subfilters
192  // RC (10/1/19): Why?
193  return copySubFilters(this, new EventTypeFilter(rootEventType, false));
194  }
195 
196  @Override
197  public int hashCode() {
198  int hash = 7;
199  hash = 17 * hash + Objects.hashCode(this.rootEventType);
200  return hash;
201  }
202 
203  @Override
204  public boolean equals(Object obj) {
205  if (this == obj) {
206  return true;
207  }
208  if (obj == null) {
209  return false;
210  }
211  if (getClass() != obj.getClass()) {
212  return false;
213  }
214  final EventTypeFilter other = (EventTypeFilter) obj;
215  if (notEqual(this.rootEventType, other.getRootEventType())) {
216  return false;
217  }
218  return Objects.equals(this.getSubFilters(), other.getSubFilters());
219  }
220 
221  @Override
222  String getSQLWhere(TimelineManager manager) {
223  return "(tsk_events.event_type_id IN (" + getSubTypeIDs().collect(Collectors.joining(",")) + "))"; //NON-NLS
224  }
225 
226  private Stream<String> getSubTypeIDs() {
227  if (this.getSubFilters().isEmpty()) {
228  return Stream.of(String.valueOf(getRootEventType().getTypeID()));
229  } else {
230  return this.getSubFilters().stream().flatMap(EventTypeFilter::getSubTypeIDs);
231  }
232  }
233 
234  @Override
235  public String toString() {
236  return "EventTypeFilter{" + "rootEventType=" + rootEventType + ", subfilters=" + getSubFilters() + '}';
237  }
238 
239  }
240 
245  public static final class TagsFilter extends TimelineFilter {
246 
247  private boolean eventSourcesAreTagged;
248 
254  public TagsFilter() {
255  }
256 
266  public TagsFilter(boolean eventSourcesAreTagged) {
267  this.eventSourcesAreTagged = eventSourcesAreTagged;
268  }
269 
278  public synchronized void setEventSourcesAreTagged(boolean eventSourcesAreTagged) {
279  this.eventSourcesAreTagged = eventSourcesAreTagged;
280  }
281 
288  public synchronized boolean getEventSourceAreTagged() {
289  return eventSourcesAreTagged;
290  }
291 
292  @Override
293  public String getDisplayName() {
294  return BundleProvider.getBundle().getString("tagsFilter.displayName.text");
295  }
296 
297  @Override
298  public TagsFilter copyOf() {
299  return new TagsFilter(eventSourcesAreTagged);
300  }
301 
302  @Override
303  public boolean equals(Object obj) {
304  if (obj == null || !(obj instanceof TagsFilter)) {
305  return false;
306  }
307 
308  return ((TagsFilter) obj).getEventSourceAreTagged() == getEventSourceAreTagged();
309  }
310 
311  @Override
312  public int hashCode() {
313  int hash = 7;
314  hash = 67 * hash + Objects.hashCode(this.eventSourcesAreTagged);
315  return hash;
316  }
317 
318  @Override
319  String getSQLWhere(TimelineManager manager) {
320  String whereStr;
321  if (eventSourcesAreTagged) {
322  whereStr = "tagged = 1";
323  } else {
324  whereStr = "tagged = 0";
325  }
326 
327  return whereStr;
328  }
329 
330  }
331 
338  public static abstract class UnionFilter<SubFilterType extends TimelineFilter> extends TimelineFilter.CompoundFilter<SubFilterType> {
339 
340  UnionFilter(List<SubFilterType> subFilters) {
341  super(subFilters);
342  }
343 
344  UnionFilter() {
345  super(new ArrayList<SubFilterType>());
346  }
347 
348  @Override
349  public void addSubFilter(SubFilterType subfilter) {
350  super.addSubFilter(subfilter);
351  }
352 
353  @Override
354  String getSQLWhere(TimelineManager manager) {
355  String join = getSubFilters().stream()
356  .map(subFilter -> subFilter.getSQLWhere(manager))
357  .collect(Collectors.joining(" OR "));
358  return join.isEmpty() ? manager.getSQLWhere(null) : "(" + join + ")";
359  }
360 
361  }
362 
367  public static final class TextFilter extends TimelineFilter {
368 
369  private String descriptionSubstring;
370 
376  public TextFilter() {
377  this("");
378  }
379 
388  public TextFilter(String descriptionSubstring) {
389  super();
390  this.descriptionSubstring = descriptionSubstring.trim();
391  }
392 
399  public synchronized void setDescriptionSubstring(String descriptionSubstring) {
400  this.descriptionSubstring = descriptionSubstring.trim();
401  }
402 
403  @Override
404  public String getDisplayName() {
405  return BundleProvider.getBundle().getString("TextFilter.displayName.text");
406  }
407 
414  public synchronized String getDescriptionSubstring() {
415  return descriptionSubstring;
416  }
417 
418  @Override
419  public synchronized TextFilter copyOf() {
420  return new TextFilter(getDescriptionSubstring());
421  }
422 
423  @Override
424  public boolean equals(Object obj) {
425  if (obj == null) {
426  return false;
427  }
428  if (getClass() != obj.getClass()) {
429  return false;
430  }
431  final TextFilter other = (TextFilter) obj;
432  return Objects.equals(getDescriptionSubstring(), other.getDescriptionSubstring());
433  }
434 
435  @Override
436  public int hashCode() {
437  int hash = 5;
438  hash = 29 * hash + Objects.hashCode(this.descriptionSubstring);
439  return hash;
440  }
441 
442  @Override
443  String getSQLWhere(TimelineManager manager) {
444  if (StringUtils.isNotBlank(this.getDescriptionSubstring())) {
445  return "((med_description like '%" + escapeSingleQuotes(this.getDescriptionSubstring()) + "%')" //NON-NLS
446  + " or (full_description like '%" + escapeSingleQuotes(this.getDescriptionSubstring()) + "%')" //NON-NLS
447  + " or (short_description like '%" + escapeSingleQuotes(this.getDescriptionSubstring()) + "%'))"; //NON-NLS
448  } else {
449  return manager.getSQLWhere(null);
450  }
451  }
452 
453  @Override
454  public String toString() {
455  return "TextFilter{" + "textProperty=" + descriptionSubstring + '}';
456  }
457 
458  }
459 
464  public static final class RootFilter extends IntersectionFilter<TimelineFilter> {
465 
466  private final HideKnownFilter knownFilesFilter;
467  private final TagsFilter tagsFilter;
468  private final HashHitsFilter hashSetHitsFilter;
469  private final TextFilter descriptionSubstringFilter;
470  private final EventTypeFilter eventTypesFilter;
471  private final DataSourcesFilter dataSourcesFilter;
472  private final FileTypesFilter fileTypesFilter;
473  private final Set<TimelineFilter> additionalFilters = new HashSet<>();
474 
481  return dataSourcesFilter;
482  }
483 
490  return tagsFilter;
491  }
492 
499  return hashSetHitsFilter;
500  }
501 
508  return eventTypesFilter;
509  }
510 
517  return knownFilesFilter;
518  }
519 
526  return descriptionSubstringFilter;
527  }
528 
535  return fileTypesFilter;
536  }
537 
563  public RootFilter(
564  HideKnownFilter knownFilesFilter,
565  TagsFilter tagsFilter,
566  HashHitsFilter hashSetHitsFilter,
567  TextFilter descriptionSubstringFilter,
568  EventTypeFilter eventTypesFilter,
569  DataSourcesFilter dataSourcesFilter,
570  FileTypesFilter fileTypesFilter,
571  Collection<TimelineFilter> additionalFilters) {
572 
573  super(Arrays.asList(descriptionSubstringFilter, knownFilesFilter, tagsFilter, dataSourcesFilter, hashSetHitsFilter, fileTypesFilter, eventTypesFilter));
574  getSubFilters().removeIf(Objects::isNull);
575  this.knownFilesFilter = knownFilesFilter;
576  this.tagsFilter = tagsFilter;
577  this.hashSetHitsFilter = hashSetHitsFilter;
578  this.descriptionSubstringFilter = descriptionSubstringFilter;
579  this.eventTypesFilter = eventTypesFilter;
580  this.dataSourcesFilter = dataSourcesFilter;
581  this.fileTypesFilter = fileTypesFilter;
582  this.additionalFilters.addAll(asList(descriptionSubstringFilter, knownFilesFilter, tagsFilter, dataSourcesFilter, hashSetHitsFilter, fileTypesFilter, eventTypesFilter));
583  this.additionalFilters.removeIf(Objects::isNull);
584  additionalFilters.stream().
585  filter(Objects::nonNull).
586  filter(this::hasAdditionalFilter).
588  forEach(anonymousFilter -> getSubFilters().add(anonymousFilter));
589  }
590 
591  @Override
592  public RootFilter copyOf() {
593  Set<TimelineFilter> subFilters = getSubFilters().stream()
594  .filter(this::hasAdditionalFilter)
596  .collect(Collectors.toSet());
597  return new RootFilter(knownFilesFilter.copyOf(), tagsFilter.copyOf(),
598  hashSetHitsFilter.copyOf(), descriptionSubstringFilter.copyOf(), eventTypesFilter.copyOf(),
599  dataSourcesFilter.copyOf(), fileTypesFilter.copyOf(), subFilters);
600 
601  }
602 
603  private boolean hasAdditionalFilter(TimelineFilter subFilter) {
604  return !(additionalFilters.contains(subFilter));
605  }
606 
607  @Override
608  public String toString() {
609  return "RootFilter{" + "knownFilter=" + knownFilesFilter + ", tagsFilter=" + tagsFilter + ", hashFilter=" + hashSetHitsFilter + ", textFilter=" + descriptionSubstringFilter + ", typeFilter=" + eventTypesFilter + ", dataSourcesFilter=" + dataSourcesFilter + ", fileTypesFilter=" + fileTypesFilter + ", namedSubFilters=" + additionalFilters + '}';
610  }
611 
612  @Override
613  public int hashCode() {
614  int hash = 7;
615  hash = 17 * hash + Objects.hashCode(this.knownFilesFilter);
616  hash = 17 * hash + Objects.hashCode(this.tagsFilter);
617  hash = 17 * hash + Objects.hashCode(this.hashSetHitsFilter);
618  hash = 17 * hash + Objects.hashCode(this.descriptionSubstringFilter);
619  hash = 17 * hash + Objects.hashCode(this.eventTypesFilter);
620  hash = 17 * hash + Objects.hashCode(this.dataSourcesFilter);
621  hash = 17 * hash + Objects.hashCode(this.fileTypesFilter);
622  hash = 17 * hash + Objects.hashCode(this.additionalFilters);
623  return hash;
624  }
625 
626  @Override
627  public boolean equals(Object obj) {
628  if (this == obj) {
629  return true;
630  }
631  if (obj == null) {
632  return false;
633  }
634  if (getClass() != obj.getClass()) {
635  return false;
636  }
637  final RootFilter other = (RootFilter) obj;
638  if (notEqual(this.knownFilesFilter, other.getKnownFilter())) {
639  return false;
640  }
641  if (notEqual(this.tagsFilter, other.getTagsFilter())) {
642  return false;
643  }
644  if (notEqual(this.hashSetHitsFilter, other.getHashHitsFilter())) {
645  return false;
646  }
647  if (notEqual(this.descriptionSubstringFilter, other.getTextFilter())) {
648  return false;
649  }
650  if (notEqual(this.eventTypesFilter, other.getEventTypeFilter())) {
651  return false;
652  }
653  if (notEqual(this.dataSourcesFilter, other.getDataSourcesFilter())) {
654  return false;
655  }
656 
657  if (notEqual(this.fileTypesFilter, other.getFileTypesFilter())) {
658  return false;
659  }
660 
661  return Objects.equals(this.additionalFilters, new HashSet<>(other.getSubFilters()));
662  }
663 
664  }
665 
670  public static final class HideKnownFilter extends TimelineFilter {
671 
672  @Override
673  public String getDisplayName() {
674  return BundleProvider.getBundle().getString("hideKnownFilter.displayName.text");
675  }
676 
677  @Override
679  return new HideKnownFilter();
680  }
681 
682  @Override
683  public int hashCode() {
684  return 7;
685  }
686 
687  @Override
688  public boolean equals(Object obj) {
689  if (obj == null) {
690  return false;
691  }
692  return getClass() == obj.getClass();
693  }
694 
695  @Override
696  String getSQLWhere(TimelineManager manager) {
697  return "(known_state != " + TskData.FileKnown.KNOWN.getFileKnownValue() + ")"; // NON-NLS
698  }
699 
700  @Override
701  public String toString() {
702  return "HideKnownFilter{" + '}';
703  }
704 
705  }
706 
714  public static abstract class CompoundFilter<SubFilterType extends TimelineFilter> extends TimelineFilter {
715 
716  protected void addSubFilter(SubFilterType subfilter) {
717  if (getSubFilters().contains(subfilter) == false) {
718  getSubFilters().add(subfilter);
719  }
720  }
721 
722  private final List<SubFilterType> subFilters = new ArrayList<>();
723 
729  public final List<SubFilterType> getSubFilters() {
730  return subFilters;
731  }
732 
738  public boolean hasSubFilters() {
739  return getSubFilters().isEmpty() == false;
740  }
741 
748  protected CompoundFilter(List<SubFilterType> subFilters) {
749  super();
750  this.subFilters.addAll(subFilters);
751  }
752 
753  @Override
754  public abstract CompoundFilter<SubFilterType> copyOf();
755 
756  @Override
757  public int hashCode() {
758  int hash = 3;
759  hash = 23 * hash + Objects.hashCode(this.subFilters);
760  return hash;
761  }
762 
763  @Override
764  public boolean equals(Object obj) {
765  if (this == obj) {
766  return true;
767  }
768  if (obj == null) {
769  return false;
770  }
771  if (getClass() != obj.getClass()) {
772  return false;
773  }
774  final CompoundFilter<?> other = (CompoundFilter<?>) obj;
775  return Objects.equals(this.getSubFilters(), other.getSubFilters());
776  }
777 
778  @Override
779  public String toString() {
780  return this.getClass().getSimpleName() + "{" + "subFilters=" + subFilters + '}';
781  }
782 
783  }
784 
789  public static final class DataSourceFilter extends TimelineFilter {
790 
791  private final String dataSourceName;
792  private final long dataSourceID;
793 
799  public long getDataSourceID() {
800  return dataSourceID;
801  }
802 
808  public String getDataSourceName() {
809  return dataSourceName;
810  }
811 
819  public DataSourceFilter(String dataSourceName, long dataSourceID) {
820  super();
821  this.dataSourceName = dataSourceName;
822  this.dataSourceID = dataSourceID;
823  }
824 
825  @Override
826  public synchronized DataSourceFilter copyOf() {
828  }
829 
830  @Override
831  public String getDisplayName() {
832  return getDataSourceName() + " (ID: " + getDataSourceID() + ")";
833  }
834 
835  @Override
836  public int hashCode() {
837  int hash = 3;
838  hash = 47 * hash + Objects.hashCode(this.dataSourceName);
839  hash = 47 * hash + (int) (this.dataSourceID ^ (this.dataSourceID >>> 32));
840  return hash;
841  }
842 
843  @Override
844  public boolean equals(Object obj) {
845  if (this == obj) {
846  return true;
847  }
848  if (obj == null) {
849  return false;
850  }
851  if (getClass() != obj.getClass()) {
852  return false;
853  }
854  final DataSourceFilter other = (DataSourceFilter) obj;
855  if (this.dataSourceID != other.dataSourceID) {
856  return false;
857  }
858  return Objects.equals(this.dataSourceName, other.dataSourceName);
859  }
860 
861  @Override
862  String getSQLWhere(TimelineManager manager) {
863  return "(data_source_obj_id = '" + this.getDataSourceID() + "')"; //NON-NLS
864  }
865 
866  }
867 
874  public static final class HashHitsFilter extends TimelineFilter {
875 
876  private boolean eventSourcesHaveHashSetHits;
877 
883  public HashHitsFilter() {
884  }
885 
895  public HashHitsFilter(boolean eventSourcesHaveHashSetHits) {
896  this.eventSourcesHaveHashSetHits = eventSourcesHaveHashSetHits;
897  }
898 
905  public synchronized void setEventSourcesHaveHashSetHits(boolean eventSourcesHaveHashSetHits) {
906  this.eventSourcesHaveHashSetHits = eventSourcesHaveHashSetHits;
907  }
908 
915  public synchronized boolean getEventSourcesHaveHashSetHits() {
916  return eventSourcesHaveHashSetHits;
917  }
918 
919  @Override
920  public String getDisplayName() {
921  return BundleProvider.getBundle().getString("hashHitsFilter.displayName.text");
922  }
923 
924  @Override
926  return new HashHitsFilter(eventSourcesHaveHashSetHits);
927  }
928 
929  @Override
930  public boolean equals(Object obj) {
931  if (obj == null || !(obj instanceof HashHitsFilter)) {
932  return false;
933  }
934 
935  return ((HashHitsFilter) obj).getEventSourcesHaveHashSetHits() == getEventSourcesHaveHashSetHits();
936  }
937 
938  @Override
939  public int hashCode() {
940  int hash = 7;
941  hash = 67 * hash + Objects.hashCode(this.eventSourcesHaveHashSetHits);
942  return hash;
943  }
944 
945  @Override
946  String getSQLWhere(TimelineManager manager) {
947  String whereStr = "";
948  if (eventSourcesHaveHashSetHits) {
949  whereStr = "hash_hit = 1";
950  } else {
951  whereStr = "hash_hit = 0";
952  }
953 
954  return whereStr;
955  }
956 
957  }
958 
964  static public final class DataSourcesFilter extends UnionFilter<DataSourceFilter> {
965 
966  @Override
968  return copySubFilters(this, new DataSourcesFilter());
969  }
970 
971  @Override
972  public String getDisplayName() {
973  return BundleProvider.getBundle().getString("DataSourcesFilter.displayName.text");
974  }
975 
976  }
977 
983  static public final class FileTypesFilter extends UnionFilter<FileTypeFilter> {
984 
985  @Override
987  return copySubFilters(this, new FileTypesFilter());
988  }
989 
990  @Override
991  public String getDisplayName() {
992  return BundleProvider.getBundle().getString("FileTypesFilter.displayName.text");
993  }
994 
995  }
996 
1001  static public class InverseFileTypeFilter extends FileTypeFilter {
1002 
1003  public InverseFileTypeFilter(String displayName, Collection<String> mediaTypes) {
1004  super(displayName, mediaTypes);
1005  }
1006 
1007  @Override
1009  return new InverseFileTypeFilter(getDisplayName(), super.mediaTypes);
1010  }
1011 
1012  @Override
1013  String getSQLWhere(TimelineManager manager) {
1014  return " NOT " + super.getSQLWhere(manager);
1015  }
1016  }
1017 
1022  public static class FileTypeFilter extends TimelineFilter {
1023 
1024  private final String displayName;
1025  private final String sqlWhere;
1026  Collection<String> mediaTypes = new HashSet<>();
1027 
1028  private FileTypeFilter(String displayName, String sql) {
1029  this.displayName = displayName;
1030  this.sqlWhere = sql;
1031  }
1032 
1042  public FileTypeFilter(String displayName, Collection<String> mediaTypes) {
1043  this(displayName,
1044  mediaTypes.stream()
1045  .map(MediaType::parse)
1046  .map(FileTypeFilter::mediaTypeToSQL)
1047  .collect(Collectors.joining(" OR ", "(", ")")));
1048  this.mediaTypes = mediaTypes;
1049  }
1050 
1051  private static String mediaTypeToSQL(MediaType mediaType) {
1052  return mediaType.hasWildcard()
1053  ? " (tsk_events.mime_type LIKE '" + escapeSingleQuotes(mediaType.type()) + "/_%' ) "
1054  : " (tsk_events.mime_type = '" + escapeSingleQuotes(mediaType.toString()) + "' ) ";
1055  }
1056 
1057  @Override
1058  public String getDisplayName() {
1059  return displayName;
1060  }
1061 
1062  @Override
1064  return new FileTypeFilter(displayName, sqlWhere);
1065  }
1066 
1067  @Override
1068  public int hashCode() {
1069  int hash = 7;
1070  hash = 17 * hash + Objects.hashCode(this.displayName);
1071  hash = 17 * hash + Objects.hashCode(this.sqlWhere);
1072  return hash;
1073  }
1074 
1075  @Override
1076  public boolean equals(Object obj) {
1077  if (this == obj) {
1078  return true;
1079  }
1080  if (obj == null) {
1081  return false;
1082  }
1083  if (getClass() != obj.getClass()) {
1084  return false;
1085  }
1086  final FileTypeFilter other = (FileTypeFilter) obj;
1087  if (notEqual(this.displayName, other.displayName)) {
1088  return false;
1089  }
1090  return Objects.equals(this.sqlWhere, other.sqlWhere);
1091  }
1092 
1093  @Override
1094  String getSQLWhere(TimelineManager manager) {
1095  return sqlWhere;
1096  }
1097 
1098  @Override
1099  public String toString() {
1100  return "FileTypeFilter{" + "displayName=" + displayName + ", sqlWhere=" + sqlWhere + '}';
1101  }
1102 
1103  }
1104 
1105 }
InverseFileTypeFilter(String displayName, Collection< String > mediaTypes)
synchronized void setEventSourcesAreTagged(boolean eventSourcesAreTagged)
HashHitsFilter(boolean eventSourcesHaveHashSetHits)
SortedSet<?extends TimelineEventType > getChildren()
FileTypeFilter(String displayName, Collection< String > mediaTypes)
static String escapeSingleQuotes(String text)
synchronized void setEventSourcesHaveHashSetHits(boolean eventSourcesHaveHashSetHits)
abstract CompoundFilter< SubFilterType > copyOf()
synchronized void setDescriptionSubstring(String descriptionSubstring)
abstract TimelineFilter copyOf()
RootFilter(HideKnownFilter knownFilesFilter, TagsFilter tagsFilter, HashHitsFilter hashSetHitsFilter, TextFilter descriptionSubstringFilter, EventTypeFilter eventTypesFilter, DataSourcesFilter dataSourcesFilter, FileTypesFilter fileTypesFilter, Collection< TimelineFilter > additionalFilters)
KNOWN
File marked as a known by hash db.
Definition: TskData.java:794
DataSourceFilter(String dataSourceName, long dataSourceID)

Copyright © 2011-2021 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.