diff --git a/.travis.yml b/.travis.yml index 04f56de8ac9db21beb900269d849c59f7d1531c2..3e15006df1a9af722e9ae9034ed721fd1b0aac15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,9 +30,6 @@ addons: - libcppunit-dev - wget - openjdk-8-jdk - - openjfx=8u161-b12-1ubuntu2 - - libopenjfx-java=8u161-b12-1ubuntu2 - - libopenjfx-jni=8u161-b12-1ubuntu2 homebrew: update: true packages: diff --git a/bindings/java/src/org/sleuthkit/datamodel/Bundle.properties b/bindings/java/src/org/sleuthkit/datamodel/Bundle.properties index 9241a1bb12aa1f9fc27ea1fb27d216a16fcc2c33..89ef565f7bb6e317a35b77ac43dfcc2ec4f586c4 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/Bundle.properties +++ b/bindings/java/src/org/sleuthkit/datamodel/Bundle.properties @@ -322,7 +322,7 @@ BaseTypes.customTypes.name=Custom Types EventTypeHierarchyLevel.root=Root EventTypeHierarchyLevel.category=Category EventTypeHierarchyLevel.event=Event -DataSourcesFilter.displayName.text=Limit data sources +DataSourcesFilter.displayName.text=Limit data sources to DescriptionFilter.mode.exclude=Exclude DescriptionFilter.mode.include=Include hashHitsFilter.displayName.text=Must have hash hit @@ -330,5 +330,5 @@ hideKnownFilter.displayName.text=Hide Known Files IntersectionFilter.displayName.text=Intersection tagsFilter.displayName.text=Must be tagged TextFilter.displayName.text=Must include text: -TypeFilter.displayName.text=Limit event types -FileTypesFilter.displayName.text=Limit file types \ No newline at end of file +TypeFilter.displayName.text=Limit event types to +FileTypesFilter.displayName.text=Limit file types to \ No newline at end of file diff --git a/bindings/java/src/org/sleuthkit/datamodel/TimelineFilter.java b/bindings/java/src/org/sleuthkit/datamodel/TimelineFilter.java index a518cbe0f2ea6a7463b1fcf2f5786617d20cd96f..85e2ed066716a9dbfa139091b4b35c74179c1481 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/TimelineFilter.java +++ b/bindings/java/src/org/sleuthkit/datamodel/TimelineFilter.java @@ -21,6 +21,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; import com.google.common.net.MediaType; +import java.util.ArrayList; +import java.util.Arrays; import static java.util.Arrays.asList; import java.util.Collection; import java.util.HashSet; @@ -30,12 +32,6 @@ import java.util.stream.Collectors; import static java.util.stream.Collectors.joining; import java.util.stream.Stream; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.Property; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; import static org.apache.commons.lang3.ObjectUtils.notEqual; import org.apache.commons.lang3.StringUtils; import static org.sleuthkit.datamodel.SleuthkitCase.escapeSingleQuotes; @@ -149,7 +145,7 @@ public static final class EventTypeFilter extends UnionFilter<EventTypeFilter> { * event types hierarchy from the root event type. */ private EventTypeFilter(TimelineEventType rootEventType, boolean recursive) { - super(FXCollections.observableArrayList()); + super(new ArrayList<>()); this.rootEventType = rootEventType; if (recursive) { // add subfilters for each subtype @@ -246,7 +242,7 @@ public String toString() { */ public static final class TagsFilter extends TimelineFilter { - private final BooleanProperty eventSourcesAreTagged = new SimpleBooleanProperty(); + private boolean eventSourcesAreTagged; /** * Constructs a timeline events filter used to query for a events where @@ -261,24 +257,24 @@ public TagsFilter() { * the direct source (file or artifact) of the events has either been * tagged or not tagged. * - * @param eventSourceIsTagged Whether the direct sources of the events - * need to be tagged or not tagged to be - * accepted by this filter. + * @param eventSourcesAreTagged Whether the direct sources of the events + * need to be tagged or not tagged to be + * accepted by this filter. */ - public TagsFilter(boolean eventSourceIsTagged) { - this.eventSourcesAreTagged.set(eventSourceIsTagged); + public TagsFilter(boolean eventSourcesAreTagged) { + this.eventSourcesAreTagged = eventSourcesAreTagged; } /** * Sets whether the direct sources of the events have to be tagged or * not tagged to be accepted by this filter. * - * @param eventSourceIsTagged Whether the direct sources of the events - * have to be tagged or not tagged to be - * accepted by this filter. + * @param eventSourcesAreTagged Whether the direct sources of the events + * have to be tagged or not tagged to be + * accepted by this filter. */ - public synchronized void setEventSourcesAreTagged(boolean eventSourceIsTagged) { - this.eventSourcesAreTagged.set(eventSourceIsTagged); + public synchronized void setEventSourcesAreTagged(boolean eventSourcesAreTagged) { + this.eventSourcesAreTagged = eventSourcesAreTagged; } /** @@ -288,7 +284,7 @@ public synchronized void setEventSourcesAreTagged(boolean eventSourceIsTagged) { * @return True or false. */ public synchronized boolean getEventSourceAreTagged() { - return eventSourcesAreTagged.get(); + return eventSourcesAreTagged; } @Override @@ -298,7 +294,7 @@ public String getDisplayName() { @Override public TagsFilter copyOf() { - return new TagsFilter(eventSourcesAreTagged.get()); + return new TagsFilter(eventSourcesAreTagged); } @Override @@ -307,7 +303,7 @@ public boolean equals(Object obj) { return false; } - return ((TagsFilter) obj).getEventSourceAreTagged() == eventSourcesAreTagged.get(); + return ((TagsFilter) obj).getEventSourceAreTagged() == getEventSourceAreTagged(); } @Override @@ -320,7 +316,7 @@ public int hashCode() { @Override String getSQLWhere(TimelineManager manager) { String whereStr; - if (eventSourcesAreTagged.get()) { + if (eventSourcesAreTagged) { whereStr = "tagged = 1"; } else { whereStr = "tagged = 0"; @@ -339,12 +335,12 @@ String getSQLWhere(TimelineManager manager) { */ public static abstract class UnionFilter<SubFilterType extends TimelineFilter> extends TimelineFilter.CompoundFilter<SubFilterType> { - UnionFilter(ObservableList<SubFilterType> subFilters) { + UnionFilter(List<SubFilterType> subFilters) { super(subFilters); } UnionFilter() { - super(FXCollections.<SubFilterType>observableArrayList()); + super(new ArrayList<SubFilterType>()); } @Override @@ -368,7 +364,7 @@ String getSQLWhere(TimelineManager manager) { */ public static final class TextFilter extends TimelineFilter { - private final SimpleStringProperty descriptionSubstring = new SimpleStringProperty(); + private String descriptionSubstring; /** * Constructs a timeline events filter used to query for events that @@ -389,7 +385,7 @@ public TextFilter() { */ public TextFilter(String descriptionSubstring) { super(); - this.descriptionSubstring.set(descriptionSubstring.trim()); + this.descriptionSubstring = descriptionSubstring.trim(); } /** @@ -399,7 +395,7 @@ public TextFilter(String descriptionSubstring) { * @param descriptionSubstring The substring. */ public synchronized void setDescriptionSubstring(String descriptionSubstring) { - this.descriptionSubstring.set(descriptionSubstring.trim()); + this.descriptionSubstring = descriptionSubstring.trim(); } @Override @@ -413,23 +409,13 @@ public String getDisplayName() { * * @return The required substring. */ - public synchronized String getSubstring() { - return descriptionSubstring.getValue(); - } - - /** - * Gets the substring that must be present in one or more of the - * descriptions of each event that passes the filter. - * - * @return The required substring as a Property. - */ - public Property<String> substringProperty() { + public synchronized String getDescriptionSubstring() { return descriptionSubstring; } @Override public synchronized TextFilter copyOf() { - return new TextFilter(getSubstring()); + return new TextFilter(getDescriptionSubstring()); } @Override @@ -441,22 +427,22 @@ public boolean equals(Object obj) { return false; } final TextFilter other = (TextFilter) obj; - return Objects.equals(getSubstring(), other.getSubstring()); + return Objects.equals(getDescriptionSubstring(), other.getDescriptionSubstring()); } @Override public int hashCode() { int hash = 5; - hash = 29 * hash + Objects.hashCode(this.descriptionSubstring.get()); + hash = 29 * hash + Objects.hashCode(this.descriptionSubstring); return hash; } @Override String getSQLWhere(TimelineManager manager) { - if (StringUtils.isNotBlank(this.getSubstring())) { - return "((med_description like '%" + escapeSingleQuotes(this.getSubstring()) + "%')" //NON-NLS - + " or (full_description like '%" + escapeSingleQuotes(this.getSubstring()) + "%')" //NON-NLS - + " or (short_description like '%" + escapeSingleQuotes(this.getSubstring()) + "%'))"; //NON-NLS + if (StringUtils.isNotBlank(this.getDescriptionSubstring())) { + return "((med_description like '%" + escapeSingleQuotes(this.getDescriptionSubstring()) + "%')" //NON-NLS + + " or (full_description like '%" + escapeSingleQuotes(this.getDescriptionSubstring()) + "%')" //NON-NLS + + " or (short_description like '%" + escapeSingleQuotes(this.getDescriptionSubstring()) + "%'))"; //NON-NLS } else { return manager.getSQLWhere(null); } @@ -464,7 +450,7 @@ String getSQLWhere(TimelineManager manager) { @Override public String toString() { - return "TextFilter{" + "textProperty=" + descriptionSubstring.getValue() + '}'; + return "TextFilter{" + "textProperty=" + descriptionSubstring + '}'; } } @@ -582,7 +568,7 @@ public RootFilter( FileTypesFilter fileTypesFilter, Collection<TimelineFilter> additionalFilters) { - super(FXCollections.observableArrayList(descriptionSubstringFilter, knownFilesFilter, tagsFilter, dataSourcesFilter, hashSetHitsFilter, fileTypesFilter, eventTypesFilter)); + super(Arrays.asList(descriptionSubstringFilter, knownFilesFilter, tagsFilter, dataSourcesFilter, hashSetHitsFilter, fileTypesFilter, eventTypesFilter)); getSubFilters().removeIf(Objects::isNull); this.knownFilesFilter = knownFilesFilter; this.tagsFilter = tagsFilter; @@ -730,14 +716,14 @@ protected void addSubFilter(SubFilterType subfilter) { } } - private final ObservableList<SubFilterType> subFilters = FXCollections.observableArrayList(); + private final List<SubFilterType> subFilters = new ArrayList<>(); /** * Gets the collection of filters that make up this filter. * * @return The filters. */ - public final ObservableList<SubFilterType> getSubFilters() { + public final List<SubFilterType> getSubFilters() { return subFilters; } @@ -758,7 +744,7 @@ public boolean hasSubFilters() { */ protected CompoundFilter(List<SubFilterType> subFilters) { super(); - this.subFilters.setAll(subFilters); + this.subFilters.addAll(subFilters); } @Override @@ -884,7 +870,7 @@ String getSQLWhere(TimelineManager manager) { */ public static final class HashHitsFilter extends TimelineFilter { - private final BooleanProperty eventSourcesHaveHashSetHits = new SimpleBooleanProperty(); + private boolean eventSourcesHaveHashSetHits; /** * Constructs a timeline events filter used to query for events where @@ -899,21 +885,22 @@ public HashHitsFilter() { * the files that are the direct or indirect sources of the events * either have or do not have hash set hits. * - * @param hasHashHit Whether or not the files associated with the events - * have or do not have hash set hits. + * @param eventSourcesHaveHashSetHits Whether or not the files + * associated with the events have or + * do not have hash set hits. */ - public HashHitsFilter(boolean hasHashHit) { - eventSourcesHaveHashSetHits.set(hasHashHit); + public HashHitsFilter(boolean eventSourcesHaveHashSetHits) { + this.eventSourcesHaveHashSetHits = eventSourcesHaveHashSetHits; } /** * Sets whether or not the files associated with the events have or do * not have hash set hits * - * @param hasHashHit True or false. + * @param eventSourcesHaveHashSetHits True or false. */ - public synchronized void setEventSourcesHaveHashSetHits(boolean hasHashHit) { - eventSourcesHaveHashSetHits.set(hasHashHit); + public synchronized void setEventSourcesHaveHashSetHits(boolean eventSourcesHaveHashSetHits) { + this.eventSourcesHaveHashSetHits = eventSourcesHaveHashSetHits; } /** @@ -923,7 +910,7 @@ public synchronized void setEventSourcesHaveHashSetHits(boolean hasHashHit) { * @return True or false. */ public synchronized boolean getEventSourcesHaveHashSetHits() { - return eventSourcesHaveHashSetHits.get(); + return eventSourcesHaveHashSetHits; } @Override @@ -933,7 +920,7 @@ public String getDisplayName() { @Override public HashHitsFilter copyOf() { - return new HashHitsFilter(eventSourcesHaveHashSetHits.get()); + return new HashHitsFilter(eventSourcesHaveHashSetHits); } @Override @@ -942,7 +929,7 @@ public boolean equals(Object obj) { return false; } - return ((HashHitsFilter) obj).getEventSourcesHaveHashSetHits() == eventSourcesHaveHashSetHits.get(); + return ((HashHitsFilter) obj).getEventSourcesHaveHashSetHits() == getEventSourcesHaveHashSetHits(); } @Override @@ -955,7 +942,7 @@ public int hashCode() { @Override String getSQLWhere(TimelineManager manager) { String whereStr = ""; - if (eventSourcesHaveHashSetHits.get()) { + if (eventSourcesHaveHashSetHits) { whereStr = "hash_hit = 1"; } else { whereStr = "hash_hit = 0";