Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
82d2b7d2
Commit
82d2b7d2
authored
5 years ago
by
Richard Cordovano
Browse files
Options
Downloads
Patches
Plain Diff
Remove JFX dependency in TSK
parent
89d347a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/java/src/org/sleuthkit/datamodel/TimelineFilter.java
+34
-48
34 additions, 48 deletions
...ings/java/src/org/sleuthkit/datamodel/TimelineFilter.java
with
34 additions
and
48 deletions
bindings/java/src/org/sleuthkit/datamodel/TimelineFilter.java
+
34
−
48
View file @
82d2b7d2
...
@@ -30,10 +30,6 @@
...
@@ -30,10 +30,6 @@
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
java
.
util
.
stream
.
Collectors
.
joining
;
import
static
java
.
util
.
stream
.
Collectors
.
joining
;
import
java.util.stream.Stream
;
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.FXCollections
;
import
javafx.collections.ObservableList
;
import
javafx.collections.ObservableList
;
import
static
org
.
apache
.
commons
.
lang3
.
ObjectUtils
.
notEqual
;
import
static
org
.
apache
.
commons
.
lang3
.
ObjectUtils
.
notEqual
;
...
@@ -246,7 +242,7 @@ public String toString() {
...
@@ -246,7 +242,7 @@ public String toString() {
*/
*/
public
static
final
class
TagsFilter
extends
TimelineFilter
{
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
* Constructs a timeline events filter used to query for a events where
...
@@ -266,19 +262,19 @@ public TagsFilter() {
...
@@ -266,19 +262,19 @@ public TagsFilter() {
* accepted by this filter.
* accepted by this filter.
*/
*/
public
TagsFilter
(
boolean
eventSourceIsTagged
)
{
public
TagsFilter
(
boolean
eventSourceIsTagged
)
{
this
.
eventSourcesAreTagged
.
set
(
eventSourceIsTagged
)
;
this
.
eventSourcesAreTagged
=
eventSourceIsTagged
;
}
}
/**
/**
* Sets whether the direct sources of the events have to be tagged or
* Sets whether the direct sources of the events have to be tagged or
* not tagged to be accepted by this filter.
* not tagged to be accepted by this filter.
*
*
* @param eventSource
I
sTagged Whether the direct sources of the events
* @param eventSources
Are
Tagged Whether the direct sources of the events
* have to be tagged or not tagged to be
*
have to be tagged or not tagged to be
* accepted by this filter.
*
accepted by this filter.
*/
*/
public
synchronized
void
setEventSourcesAreTagged
(
boolean
eventSource
I
sTagged
)
{
public
synchronized
void
setEventSourcesAreTagged
(
boolean
eventSources
Are
Tagged
)
{
this
.
eventSourcesAreTagged
.
set
(
eventSource
I
sTagged
)
;
this
.
eventSourcesAreTagged
=
eventSources
Are
Tagged
;
}
}
/**
/**
...
@@ -288,7 +284,7 @@ public synchronized void setEventSourcesAreTagged(boolean eventSourceIsTagged) {
...
@@ -288,7 +284,7 @@ public synchronized void setEventSourcesAreTagged(boolean eventSourceIsTagged) {
* @return True or false.
* @return True or false.
*/
*/
public
synchronized
boolean
getEventSourceAreTagged
()
{
public
synchronized
boolean
getEventSourceAreTagged
()
{
return
eventSourcesAreTagged
.
get
()
;
return
eventSourcesAreTagged
;
}
}
@Override
@Override
...
@@ -298,7 +294,7 @@ public String getDisplayName() {
...
@@ -298,7 +294,7 @@ public String getDisplayName() {
@Override
@Override
public
TagsFilter
copyOf
()
{
public
TagsFilter
copyOf
()
{
return
new
TagsFilter
(
eventSourcesAreTagged
.
get
()
);
return
new
TagsFilter
(
eventSourcesAreTagged
);
}
}
@Override
@Override
...
@@ -307,7 +303,7 @@ public boolean equals(Object obj) {
...
@@ -307,7 +303,7 @@ public boolean equals(Object obj) {
return
false
;
return
false
;
}
}
return
((
TagsFilter
)
obj
).
getEventSourceAreTagged
()
==
e
ventSource
s
AreTagged
.
get
();
return
((
TagsFilter
)
obj
).
getEventSourceAreTagged
()
==
getE
ventSourceAreTagged
();
}
}
@Override
@Override
...
@@ -320,7 +316,7 @@ public int hashCode() {
...
@@ -320,7 +316,7 @@ public int hashCode() {
@Override
@Override
String
getSQLWhere
(
TimelineManager
manager
)
{
String
getSQLWhere
(
TimelineManager
manager
)
{
String
whereStr
;
String
whereStr
;
if
(
eventSourcesAreTagged
.
get
()
)
{
if
(
eventSourcesAreTagged
)
{
whereStr
=
"tagged = 1"
;
whereStr
=
"tagged = 1"
;
}
else
{
}
else
{
whereStr
=
"tagged = 0"
;
whereStr
=
"tagged = 0"
;
...
@@ -368,7 +364,7 @@ String getSQLWhere(TimelineManager manager) {
...
@@ -368,7 +364,7 @@ String getSQLWhere(TimelineManager manager) {
*/
*/
public
static
final
class
TextFilter
extends
TimelineFilter
{
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
* Constructs a timeline events filter used to query for events that
...
@@ -389,17 +385,7 @@ public TextFilter() {
...
@@ -389,17 +385,7 @@ public TextFilter() {
*/
*/
public
TextFilter
(
String
descriptionSubstring
)
{
public
TextFilter
(
String
descriptionSubstring
)
{
super
();
super
();
this
.
descriptionSubstring
.
set
(
descriptionSubstring
.
trim
());
this
.
descriptionSubstring
=
descriptionSubstring
.
trim
();
}
/**
* Sets the substring that must be present in one or more of the
* descriptions of each event that passes the filter.
*
* @param descriptionSubstring The substring.
*/
public
synchronized
void
setDescriptionSubstring
(
String
descriptionSubstring
)
{
this
.
descriptionSubstring
.
set
(
descriptionSubstring
.
trim
());
}
}
@Override
@Override
...
@@ -408,28 +394,28 @@ public String getDisplayName() {
...
@@ -408,28 +394,28 @@ public String getDisplayName() {
}
}
/**
/**
*
G
ets the substring that must be present in one or more of the
*
S
ets the substring that must be present in one or more of the
* descriptions of each event that passes the filter.
* descriptions of each event that passes the filter.
*
*
* @
return The required
substring.
* @
param descriptionSubstring The
substring.
*/
*/
public
synchronized
String
get
Substring
(
)
{
public
synchronized
void
setDescriptionSubstring
(
String
description
Substring
)
{
return
descriptionSubstring
.
getValue
();
this
.
descriptionSubstring
=
descriptionSubstring
.
trim
();
}
}
/**
/**
* Gets the substring that must be present in one or more of the
* Gets the substring that must be present in one or more of the
* descriptions of each event that passes the filter.
* descriptions of each event that passes the filter.
*
*
* @return The required substring
as a Property
.
* @return The required substring.
*/
*/
public
Property
<
String
>
substringProperty
()
{
public
synchronized
String
getDescriptionSubstring
()
{
return
descriptionSubstring
;
return
descriptionSubstring
;
}
}
@Override
@Override
public
synchronized
TextFilter
copyOf
()
{
public
synchronized
TextFilter
copyOf
()
{
return
new
TextFilter
(
getSubstring
());
return
new
TextFilter
(
get
Description
Substring
());
}
}
@Override
@Override
...
@@ -441,22 +427,22 @@ public boolean equals(Object obj) {
...
@@ -441,22 +427,22 @@ public boolean equals(Object obj) {
return
false
;
return
false
;
}
}
final
TextFilter
other
=
(
TextFilter
)
obj
;
final
TextFilter
other
=
(
TextFilter
)
obj
;
return
Objects
.
equals
(
getSubstring
(),
other
.
getSubstring
());
return
Objects
.
equals
(
get
Description
Substring
(),
other
.
get
Description
Substring
());
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
int
hash
=
5
;
int
hash
=
5
;
hash
=
29
*
hash
+
Objects
.
hashCode
(
this
.
descriptionSubstring
.
get
()
);
hash
=
29
*
hash
+
Objects
.
hashCode
(
descriptionSubstring
);
return
hash
;
return
hash
;
}
}
@Override
@Override
String
getSQLWhere
(
TimelineManager
manager
)
{
String
getSQLWhere
(
TimelineManager
manager
)
{
if
(
StringUtils
.
isNotBlank
(
this
.
getSubstring
()))
{
if
(
StringUtils
.
isNotBlank
(
this
.
get
Description
Substring
()))
{
return
"((med_description like '%"
+
escapeSingleQuotes
(
this
.
getSubstring
())
+
"%')"
//NON-NLS
return
"((med_description like '%"
+
escapeSingleQuotes
(
this
.
get
Description
Substring
())
+
"%')"
//NON-NLS
+
" or (full_description like '%"
+
escapeSingleQuotes
(
this
.
getSubstring
())
+
"%')"
//NON-NLS
+
" or (full_description like '%"
+
escapeSingleQuotes
(
this
.
get
Description
Substring
())
+
"%')"
//NON-NLS
+
" or (short_description like '%"
+
escapeSingleQuotes
(
this
.
getSubstring
())
+
"%'))"
;
//NON-NLS
+
" or (short_description like '%"
+
escapeSingleQuotes
(
this
.
get
Description
Substring
())
+
"%'))"
;
//NON-NLS
}
else
{
}
else
{
return
manager
.
getSQLWhere
(
null
);
return
manager
.
getSQLWhere
(
null
);
}
}
...
@@ -464,7 +450,7 @@ String getSQLWhere(TimelineManager manager) {
...
@@ -464,7 +450,7 @@ String getSQLWhere(TimelineManager manager) {
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"TextFilter{"
+
"textProperty="
+
descriptionSubstring
.
getValue
()
+
'}'
;
return
"TextFilter{"
+
"textProperty="
+
descriptionSubstring
+
'}'
;
}
}
}
}
...
@@ -884,7 +870,7 @@ String getSQLWhere(TimelineManager manager) {
...
@@ -884,7 +870,7 @@ String getSQLWhere(TimelineManager manager) {
*/
*/
public
static
final
class
HashHitsFilter
extends
TimelineFilter
{
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
* Constructs a timeline events filter used to query for events where
...
@@ -903,7 +889,7 @@ public HashHitsFilter() {
...
@@ -903,7 +889,7 @@ public HashHitsFilter() {
* have or do not have hash set hits.
* have or do not have hash set hits.
*/
*/
public
HashHitsFilter
(
boolean
hasHashHit
)
{
public
HashHitsFilter
(
boolean
hasHashHit
)
{
eventSourcesHaveHashSetHits
.
set
(
hasHashHit
)
;
eventSourcesHaveHashSetHits
=
hasHashHit
;
}
}
/**
/**
...
@@ -913,7 +899,7 @@ public HashHitsFilter(boolean hasHashHit) {
...
@@ -913,7 +899,7 @@ public HashHitsFilter(boolean hasHashHit) {
* @param hasHashHit True or false.
* @param hasHashHit True or false.
*/
*/
public
synchronized
void
setEventSourcesHaveHashSetHits
(
boolean
hasHashHit
)
{
public
synchronized
void
setEventSourcesHaveHashSetHits
(
boolean
hasHashHit
)
{
eventSourcesHaveHashSetHits
.
set
(
hasHashHit
)
;
eventSourcesHaveHashSetHits
=
hasHashHit
;
}
}
/**
/**
...
@@ -923,7 +909,7 @@ public synchronized void setEventSourcesHaveHashSetHits(boolean hasHashHit) {
...
@@ -923,7 +909,7 @@ public synchronized void setEventSourcesHaveHashSetHits(boolean hasHashHit) {
* @return True or false.
* @return True or false.
*/
*/
public
synchronized
boolean
getEventSourcesHaveHashSetHits
()
{
public
synchronized
boolean
getEventSourcesHaveHashSetHits
()
{
return
eventSourcesHaveHashSetHits
.
get
()
;
return
eventSourcesHaveHashSetHits
;
}
}
@Override
@Override
...
@@ -933,7 +919,7 @@ public String getDisplayName() {
...
@@ -933,7 +919,7 @@ public String getDisplayName() {
@Override
@Override
public
HashHitsFilter
copyOf
()
{
public
HashHitsFilter
copyOf
()
{
return
new
HashHitsFilter
(
eventSourcesHaveHashSetHits
.
get
()
);
return
new
HashHitsFilter
(
eventSourcesHaveHashSetHits
);
}
}
@Override
@Override
...
@@ -942,7 +928,7 @@ public boolean equals(Object obj) {
...
@@ -942,7 +928,7 @@ public boolean equals(Object obj) {
return
false
;
return
false
;
}
}
return
((
HashHitsFilter
)
obj
).
getEventSourcesHaveHashSetHits
()
==
e
ventSourcesHaveHashSetHits
.
get
();
return
((
HashHitsFilter
)
obj
).
getEventSourcesHaveHashSetHits
()
==
getE
ventSourcesHaveHashSetHits
();
}
}
@Override
@Override
...
@@ -955,7 +941,7 @@ public int hashCode() {
...
@@ -955,7 +941,7 @@ public int hashCode() {
@Override
@Override
String
getSQLWhere
(
TimelineManager
manager
)
{
String
getSQLWhere
(
TimelineManager
manager
)
{
String
whereStr
=
""
;
String
whereStr
=
""
;
if
(
eventSourcesHaveHashSetHits
.
get
()
)
{
if
(
eventSourcesHaveHashSetHits
)
{
whereStr
=
"hash_hit = 1"
;
whereStr
=
"hash_hit = 1"
;
}
else
{
}
else
{
whereStr
=
"hash_hit = 0"
;
whereStr
=
"hash_hit = 0"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment