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
c3cbe4a9
Commit
c3cbe4a9
authored
7 years ago
by
millmanorama
Browse files
Options
Downloads
Patches
Plain Diff
comments
parent
7f2ccc66
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/java/src/org/sleuthkit/datamodel/Relationship.java
+7
-5
7 additions, 5 deletions
bindings/java/src/org/sleuthkit/datamodel/Relationship.java
bindings/java/src/org/sleuthkit/datamodel/StringUtils.java
+15
-5
15 additions, 5 deletions
bindings/java/src/org/sleuthkit/datamodel/StringUtils.java
with
22 additions
and
10 deletions
bindings/java/src/org/sleuthkit/datamodel/Relationship.java
+
7
−
5
View file @
c3cbe4a9
...
@@ -23,6 +23,10 @@
...
@@ -23,6 +23,10 @@
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Set
;
import
java.util.Set
;
/**
* A relationship between Accounts, such as a communication ( email, sms, phone
* call (log) ) or presence in a contact book.
*/
public
class
Relationship
{
public
class
Relationship
{
public
static
final
class
Type
{
public
static
final
class
Type
{
...
@@ -33,12 +37,11 @@ public static final class Type {
...
@@ -33,12 +37,11 @@ public static final class Type {
private
static
final
Set
<
Type
>
PREDEFINED_RELATIONSHIP_TYPES
private
static
final
Set
<
Type
>
PREDEFINED_RELATIONSHIP_TYPES
=
Collections
.
unmodifiableSet
(
new
HashSet
<
Relationship
.
Type
>(
Arrays
.
asList
(
=
Collections
.
unmodifiableSet
(
new
HashSet
<
Relationship
.
Type
>(
Arrays
.
asList
(
MESSAGE
,
CALL_LOG
,
CONTACT
MESSAGE
,
CALL_LOG
,
CONTACT
)));
)));
private
static
final
Set
<
Type
>
PREDEFINED_COMMUNICATION_TYPES
private
static
final
Set
<
Type
>
PREDEFINED_COMMUNICATION_TYPES
=
Collections
.
unmodifiableSet
(
new
HashSet
<
Relationship
.
Type
>(
Arrays
.
asList
(
=
Collections
.
unmodifiableSet
(
new
HashSet
<
Relationship
.
Type
>(
Arrays
.
asList
(
MESSAGE
,
CALL_LOG
MESSAGE
,
CALL_LOG
)));
)));
static
Set
<
Relationship
.
Type
>
getPredefinedRelationshipTypes
()
{
static
Set
<
Relationship
.
Type
>
getPredefinedRelationshipTypes
()
{
return
PREDEFINED_RELATIONSHIP_TYPES
;
return
PREDEFINED_RELATIONSHIP_TYPES
;
...
@@ -64,7 +67,6 @@ public boolean equals(Object that) {
...
@@ -64,7 +67,6 @@ public boolean equals(Object that) {
return
false
;
return
false
;
}
}
Type
thatType
=
(
Type
)
that
;
Type
thatType
=
(
Type
)
that
;
// DB table will enforce uniqueness for type name
return
this
.
typeName
.
equals
(
thatType
.
getTypeName
());
return
this
.
typeName
.
equals
(
thatType
.
getTypeName
());
}
}
...
...
This diff is collapsed.
Click to expand it.
bindings/java/src/org/sleuthkit/datamodel/StringUtils.java
+
15
−
5
View file @
c3cbe4a9
/*
/*
* Sleuth Kit Data Model
* Sleuth Kit Data Model
*
*
* Copyright
2011-
2017 Basis Technology Corp.
* Copyright 2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
* Contact: carrier <at> sleuthkit <dot> org
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
/**
/**
* Collection of string utility methods.
* Collection of string utility methods.
*
*/
*/
class
StringUtils
{
class
StringUtils
{
...
@@ -37,7 +36,18 @@ static <T> String buildCSVString(Collection<T> values) {
...
@@ -37,7 +36,18 @@ static <T> String buildCSVString(Collection<T> values) {
return
joinAsStrings
(
values
,
","
);
return
joinAsStrings
(
values
,
","
);
}
}
static
<
T
>
String
joinAsStrings
(
Collection
<
T
>
values
,
String
seperator
)
{
/**
* Utility method to join a collection into a string using a supplied
* separator.
*
* @param <T> The type of the values in the collection to be joined
* @param values The collection to be joined
* @param separator The separator to insert between each value in the result
* string
*
* @return a string with the elements of values separated by separator
*/
static
<
T
>
String
joinAsStrings
(
Collection
<
T
>
values
,
String
separator
)
{
if
(
values
==
null
||
values
.
isEmpty
())
{
if
(
values
==
null
||
values
.
isEmpty
())
{
return
""
;
return
""
;
}
}
...
@@ -45,9 +55,9 @@ static <T> String joinAsStrings(Collection<T> values, String seperator) {
...
@@ -45,9 +55,9 @@ static <T> String joinAsStrings(Collection<T> values, String seperator) {
StringBuilder
result
=
new
StringBuilder
();
StringBuilder
result
=
new
StringBuilder
();
for
(
T
val
:
values
)
{
for
(
T
val
:
values
)
{
result
.
append
(
val
);
result
.
append
(
val
);
result
.
append
(
sep
e
rator
);
result
.
append
(
sep
a
rator
);
}
}
return
result
.
substring
(
0
,
result
.
lastIndexOf
(
sep
e
rator
));
return
result
.
substring
(
0
,
result
.
lastIndexOf
(
sep
a
rator
));
}
}
}
}
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