Skip to content
Snippets Groups Projects
Commit 659aadf9 authored by Brian Carrier's avatar Brian Carrier
Browse files

Merge branch 'master' of github.com:sleuthkit/sleuthkit

parents 7d8e3da1 6e7cc53e
Branches
Tags v1.4
No related merge requests found
......@@ -31,7 +31,7 @@
public abstract class AbstractContent implements Content {
public final static long UNKNOWN_ID = -1;
private SleuthkitCase db;
private final SleuthkitCase db;
private long objId;
private String name;
private Content parent;
......
......@@ -2618,6 +2618,29 @@ private long getFileSystemByFileId(long fileId) {
}
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment