Sleuth Kit Java Bindings (JNI) 4.14.0
Java bindings for using The Sleuth Kit
Loading...
Searching...
No Matches
SlackFile.java
Go to the documentation of this file.
1/*
2 * SleuthKit Java Bindings
3 *
4 * Copyright 2011-2022 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package org.sleuthkit.datamodel;
20
21import java.util.Collections;
22import org.sleuthkit.datamodel.TskData.FileKnown;
23import org.sleuthkit.datamodel.TskData.TSK_FS_ATTR_TYPE_ENUM;
24import org.sleuthkit.datamodel.TskData.TSK_FS_META_TYPE_ENUM;
25import org.sleuthkit.datamodel.TskData.TSK_FS_NAME_FLAG_ENUM;
26import org.sleuthkit.datamodel.TskData.TSK_FS_NAME_TYPE_ENUM;
27
31public class SlackFile extends FsContent {
32
87 SlackFile(SleuthkitCase db,
88 long objId,
89 long dataSourceObjectId,
90 long fsObjId,
92 String name,
93 long metaAddr, int metaSeq,
96 long size,
97 long ctime, long crtime, long atime, long mtime,
98 short modes, int uid, int gid,
99 String md5Hash, String sha256Hash, String sha1Hash,
100 FileKnown knownState, String parentPath, String mimeType,
101 String extension,
102 String ownerUid,
103 Long osAccountObjId) {
104 super(db, objId, dataSourceObjectId, fsObjId, attrType, attrId, name, TskData.TSK_DB_FILES_TYPE_ENUM.SLACK, metaAddr, metaSeq, dirType, metaType, dirFlag, metaFlags, size, ctime, crtime, atime, mtime, modes, uid, gid, md5Hash, sha256Hash, sha1Hash, knownState, parentPath, mimeType, extension, ownerUid, osAccountObjId, TskData.CollectedStatus.UNKNOWN, Collections.emptyList());
105 }
106
118 @Override
119 @SuppressWarnings("deprecation")
120 protected synchronized int readInt(byte[] buf, long offset, long len) throws TskCoreException {
121 if (offset == 0 && size == 0) {
122 //special case for 0-size file
123 return 0;
124 }
125 loadFileHandle();
126
127 return SleuthkitJNI.readFileSlack(fileHandle, buf, offset, len);
128 }
129
138 @Override
139 public <T> T accept(SleuthkitItemVisitor<T> v) {
140 return v.visit(this);
141 }
142
151 @Override
152 public <T> T accept(ContentVisitor<T> v) {
153 return v.visit(this);
154 }
155
162 @Override
163 public String toString(boolean preserveState) {
164 return super.toString(preserveState) + "SlackFile [\t" + "]\t"; //NON-NLS
165 }
166}
Set< TSK_FS_META_FLAG_ENUM > metaFlags
final TSK_FS_NAME_TYPE_ENUM dirType
final TSK_FS_META_TYPE_ENUM metaType
final TskData.TSK_FS_ATTR_TYPE_ENUM attrType
final Set< TskData.TSK_FS_META_MODE_ENUM > modes
String toString(boolean preserveState)
synchronized int readInt(byte[] buf, long offset, long len)
static int readFileSlack(long fileHandle, byte[] readBuffer, long offset, long len)

Copyright © 2011-2024 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.