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
6e7cc53e
Commit
6e7cc53e
authored
12 years ago
by
Brian Carrier
Browse files
Options
Downloads
Plain Diff
Merge pull request #195 from adam-m/master
add new method to get data source for file easily
parents
53234549
a56e0735
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/java/src/org/sleuthkit/datamodel/AbstractContent.java
+1
-1
1 addition, 1 deletion
...ngs/java/src/org/sleuthkit/datamodel/AbstractContent.java
bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java
+23
-0
23 additions, 0 deletions
bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java
with
24 additions
and
1 deletion
bindings/java/src/org/sleuthkit/datamodel/AbstractContent.java
+
1
−
1
View file @
6e7cc53e
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
public
abstract
class
AbstractContent
implements
Content
{
public
abstract
class
AbstractContent
implements
Content
{
public
final
static
long
UNKNOWN_ID
=
-
1
;
public
final
static
long
UNKNOWN_ID
=
-
1
;
private
SleuthkitCase
db
;
private
final
SleuthkitCase
db
;
private
long
objId
;
private
long
objId
;
private
String
name
;
private
String
name
;
private
Content
parent
;
private
Content
parent
;
...
...
This diff is collapsed.
Click to expand it.
bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java
+
23
−
0
View file @
6e7cc53e
...
@@ -2618,6 +2618,29 @@ private long getFileSystemByFileId(long fileId) {
...
@@ -2618,6 +2618,29 @@ private long getFileSystemByFileId(long fileId) {
}
}
return
ret
;
return
ret
;
}
}
/**
* Gets the root-level data source object id
* (such as Image or VirtualDirectory representing filesets) for the file
* @param file file to get the root-level object id for
* @return the root content object id in the hierarchy, or -1 if not found (such as when invalid file object passed in)
* @throws TskCoreException thrown if check failed due to a critical tsk error
*/
public
long
getFileDataSource
(
AbstractFile
file
)
throws
TskCoreException
{
final
Image
image
=
file
.
getImage
();
if
(
image
!=
null
)
{
//case for image data source
return
image
.
getId
();
}
else
{
//otherwise, get the root non-image data source id
//note, we are currently using fs_id internally to store data source id for such files
return
getFileSystemByFileId
(
file
.
getId
());
}
}
/**
/**
* Checks if the file is a (sub)child of the data source (parentless Content object
* Checks if the file is a (sub)child of the data source (parentless Content object
...
...
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