19 package org.sleuthkit.datamodel;
21 import java.util.List;
32 private long imgOffset, blockSize, blockCount, rootInum,
36 private volatile long filesystemHandle = 0;
54 long first_inum,
long last_inum) {
55 super(db, obj_id, name);
56 this.imgOffset = img_offset;
57 this.fsType = fs_type;
58 this.blockSize = block_size;
59 this.blockCount = block_count;
60 this.rootInum = root_inum;
61 this.firstInum = first_inum;
62 this.lastInum = last_inum;
77 return blockSize * blockCount;
90 if (filesystemHandle == 0) {
92 if (filesystemHandle == 0) {
94 if ((dataSource == null) || ( !(dataSource instanceof
Image))) {
95 throw new TskCoreException(
"Data Source of File System is not an image");
98 Image image = (Image) dataSource;
101 if (isPoolContent()) {
102 Pool pool = getPool();
104 throw new TskCoreException(
"Error finding pool for file system");
107 Volume poolVolume = getPoolVolume();
108 if (poolVolume == null) {
109 throw new TskCoreException(
"File system is in a pool but has no volume");
111 filesystemHandle = SleuthkitJNI.openFsPool(image.getImageHandle(), imgOffset, pool.getPoolHandle(), poolVolume.getStart(),
getSleuthkitCase());
113 filesystemHandle = SleuthkitJNI.openFs(image.getImageHandle(), imgOffset,
getSleuthkitCase());
118 return this.filesystemHandle;
124 if (children.size() != 1) {
125 throw new TskCoreException(
"FileSystem must have only one child.");
128 if (!(children.get(0) instanceof
Directory)) {
129 throw new TskCoreException(
"Child of FileSystem must be a Directory.");
201 if (filesystemHandle != 0) {
203 filesystemHandle = 0;
212 return v.
visit(
this);
216 public <T> T accept(ContentVisitor<T> v) {
217 return v.visit(
this);
222 return super.toString(preserveState) +
"FileSystem [\t" +
" blockCount " + blockCount +
"\t" +
"blockSize " + blockSize +
"\t" +
"firstInum " + firstInum +
"\t" +
"fsType " + fsType +
"\t" +
"imgOffset " + imgOffset +
"\t" +
"lastInum " + lastInum +
"\t" +
"rootInum " + rootInum +
"\t" +
"]";
String toString(boolean preserveState)
List< Content > getChildren()
Directory getRootDirectory()
int read(byte[] buf, long offset, long len)
SleuthkitCase getSleuthkitCase()
FileSystem(SleuthkitCase db, long obj_id, String name, long img_offset, TskData.TSK_FS_TYPE_ENUM fs_type, long block_size, long block_count, long root_inum, long first_inum, long last_inum)
TskData.TSK_FS_TYPE_ENUM getFsType()
static int readFs(long fsHandle, byte[] readBuffer, long offset, long len)