19 package org.sleuthkit.datamodel;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24 import java.util.logging.Level;
25 import java.util.logging.Logger;
26 import org.apache.commons.lang3.ArrayUtils;
42 private static final Logger logger = Logger.getLogger(
FsContent.class.
getName());
43 private List<String> metaDataText = null;
110 long dataSourceObjectId,
119 long ctime,
long crtime,
long atime,
long mtime,
129 List<Attribute> fileAttributes) {
130 super(db, objId, dataSourceObjectId, Long.valueOf(fsObjId),
attrType,
attrId, name,
fileType,
metaAddr,
metaSeq,
dirType,
metaType,
dirFlag,
metaFlags,
size, ctime, crtime, atime, mtime,
modes,
uid, gid,
md5Hash,
sha256Hash,
sha1Hash,
knownState,
parentPath, mimeType, extension, ownerUid, osAccountObjId, collected, fileAttributes);
147 @SuppressWarnings(
"deprecation")
149 if (fileHandle == 0) {
150 synchronized (
this) {
151 if (fileHandle == 0) {
164 @SuppressWarnings(
"deprecation")
165 long getFileHandle() {
181 @SuppressWarnings(
"deprecation")
182 protected synchronized
int readInt(byte[] buf,
long offset,
long len) throws TskCoreException {
183 if (offset == 0 &&
size == 0) {
189 if (dataSource instanceof
Image && ArrayUtils.isEmpty(((
Image) dataSource).getPaths())) {
202 }
catch (TskCoreException ex) {
203 logger.log(Level.SEVERE,
"Exception while calling 'getFileSystem' on " +
this, ex);
242 if (metaDataText != null) {
248 metaDataText =
new ArrayList<String>();
249 metaDataText.add(
"");
262 @SuppressWarnings(
"deprecation")
264 if (fileHandle != 0) {
294 }
catch (TskCoreException ex) {
295 logger.log(Level.SEVERE,
"Error loading unique path for object ID: {0}",
this.getId());
298 return super.toString(preserveState)
301 +
"\t" +
"uniquePath " + path
302 +
"\t" +
"fileHandle " + getFileHandle()
346 @SuppressWarnings(
"deprecation")
351 this(db, objId, db.getDataSourceObjectId(objId), fsObjId,
attrType, (int) attrId, name,
TSK_DB_FILES_TYPE_ENUM.
FS, metaAddr, metaSeq, dirType, metaType, dirFlag, metaFlags, size, ctime, crtime, atime, mtime, modes, uid, gid, md5Hash, null, null, knownState, parentPath, null, null,
OsAccount.NO_OWNER_ID,
OsAccount.NO_ACCOUNT, Collections.emptyList());
405 @SuppressWarnings(
"deprecation")
406 FsContent(SleuthkitCase db,
long objId,
long dataSourceObjectId,
long fsObjId, TSK_FS_ATTR_TYPE_ENUM attrType,
short attrId,
407 String name,
long metaAddr,
int metaSeq, TSK_FS_NAME_TYPE_ENUM dirType, TSK_FS_META_TYPE_ENUM metaType,
408 TSK_FS_NAME_FLAG_ENUM dirFlag,
short metaFlags,
long size,
long ctime,
long crtime,
long atime,
long mtime,
409 short modes,
int uid,
int gid, String md5Hash, FileKnown knownState, String parentPath, String mimeType) {
410 this(db, objId, dataSourceObjectId, fsObjId,
attrType, (int) attrId, name, TSK_DB_FILES_TYPE_ENUM.FS, metaAddr, metaSeq, dirType, metaType, dirFlag, metaFlags, size, ctime, crtime, atime, mtime, modes, uid, gid, md5Hash, null, null, knownState, parentPath, mimeType, null, OsAccount.NO_OWNER_ID, OsAccount.NO_ACCOUNT, Collections.emptyList());
470 @SuppressWarnings(
"deprecation")
471 FsContent(SleuthkitCase db,
473 long dataSourceObjectId,
475 TSK_FS_ATTR_TYPE_ENUM attrType,
int attrId,
478 long metaAddr,
int metaSeq,
479 TSK_FS_NAME_TYPE_ENUM dirType, TSK_FS_META_TYPE_ENUM metaType,
480 TSK_FS_NAME_FLAG_ENUM dirFlag,
short metaFlags,
482 long ctime,
long crtime,
long atime,
long mtime,
483 short modes,
int uid,
int gid,
485 FileKnown knownState,
491 List<Attribute> fileAttributes) {
492 this(db, objId, dataSourceObjectId, fsObjId,
attrType,
attrId, name, TSK_DB_FILES_TYPE_ENUM.FS,
metaAddr,
metaSeq,
dirType,
metaType,
dirFlag,
metaFlags,
size, ctime, crtime, atime, mtime,
modes,
uid, gid,
md5Hash, null, null,
knownState,
parentPath, mimeType, null, OsAccount.NO_OWNER_ID, OsAccount.NO_ACCOUNT, TskData.CollectedStatus.UNKNOWN, Collections.emptyList());
FS
File that can be found in file system tree.
final TSK_FS_NAME_TYPE_ENUM dirType
synchronized int readInt(byte[] buf, long offset, long len)
static long openFile(long fsHandle, long fileId, TSK_FS_ATTR_TYPE_ENUM attrType, int attrId, SleuthkitCase skCase)
static int readFile(long fileHandle, byte[] readBuffer, long offset, long len)
final TskData.TSK_DB_FILES_TYPE_ENUM fileType
synchronized List< String > getMetaDataText()
final TskData.TSK_FS_ATTR_TYPE_ENUM attrType
TSK_FS_NAME_FLAG_ENUM dirFlag
AbstractFile getParentDirectory()
Set< TSK_FS_META_FLAG_ENUM > metaFlags
synchronized void close()
final Set< TskData.TSK_FS_META_MODE_ENUM > modes
TskData.FileKnown knownState
static List< String > getFileMetaDataText(long fileHandle)
SleuthkitCase getSleuthkitCase()
String toString(boolean preserveState)
static void closeFile(long fileHandle)
Optional< Long > getFileSystemObjectId()
final TSK_FS_META_TYPE_ENUM metaType
FileSystem getFileSystem()