Sleuth Kit Java Bindings (JNI)  4.6.0
Java bindings for using The Sleuth Kit
SlackFile.java
Go to the documentation of this file.
1 /*
2  * SleuthKit Java Bindings
3  *
4  * Copyright 2011-2017 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  */
19 package org.sleuthkit.datamodel;
20 
26 
30 public class SlackFile extends FsContent {
31 
81  long objId,
82  long dataSourceObjectId,
83  long fsObjId,
85  String name,
86  long metaAddr, int metaSeq,
89  long size,
90  long ctime, long crtime, long atime, long mtime,
91  short modes, int uid, int gid,
92  String md5Hash, FileKnown knownState, String parentPath, String mimeType,
93  String extension) {
94  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, knownState, parentPath, mimeType, extension);
95  }
96 
108  @Override
109  @SuppressWarnings("deprecation")
110  protected int readInt(byte[] buf, long offset, long len) throws TskCoreException {
111  if (offset == 0 && size == 0) {
112  //special case for 0-size file
113  return 0;
114  }
115  loadFileHandle();
116 
117  return SleuthkitJNI.readFileSlack(fileHandle, buf, offset, len);
118  }
119 
128  @Override
129  public <T> T accept(SleuthkitItemVisitor<T> v) {
130  return v.visit(this);
131  }
132 
141  @Override
142  public <T> T accept(ContentVisitor<T> v) {
143  return v.visit(this);
144  }
145 
152  @Override
153  public String toString(boolean preserveState) {
154  return super.toString(preserveState) + "SlackFile [\t" + "]\t"; //NON-NLS
155  }
156 }
final TSK_FS_NAME_TYPE_ENUM dirType
final TSK_FS_NAME_FLAG_ENUM dirFlag
final TskData.TSK_FS_ATTR_TYPE_ENUM attrType
int readInt(byte[] buf, long offset, long len)
Definition: SlackFile.java:110
final Set< TSK_FS_META_FLAG_ENUM > metaFlags
final Set< TskData.TSK_FS_META_MODE_ENUM > modes
String toString(boolean preserveState)
Definition: SlackFile.java:153
static int readFileSlack(long fileHandle, byte[] readBuffer, long offset, long len)
final TSK_FS_META_TYPE_ENUM metaType

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