Sleuth Kit Java Bindings (JNI)  4.3
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-2016 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 
21 import java.util.List;
22 import java.util.ResourceBundle;
28 
32 public class SlackFile extends FsContent {
33  private static final ResourceBundle bundle = ResourceBundle.getBundle("org.sleuthkit.datamodel.Bundle");
34  private final SleuthkitCase tskCase;
35 
83  long objId,
84  long dataSourceObjectId,
85  long fsObjId,
87  String name,
88  long metaAddr, int metaSeq,
91  long size,
92  long ctime, long crtime, long atime, long mtime,
93  short modes, int uid, int gid,
94  String md5Hash, FileKnown knownState, String parentPath, String mimeType) {
95  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);
96  this.tskCase = db;
97  }
98 
110  @Override
111  @SuppressWarnings("deprecation")
112  protected int readInt(byte[] buf, long offset, long len) throws TskCoreException {
113  if (offset == 0 && size == 0) {
114  //special case for 0-size file
115  return 0;
116  }
117  loadFileHandle();
118 
119  return SleuthkitJNI.readFileSlack(fileHandle, buf, offset, len);
120  }
121 
130  @Override
131  public List<Content> getChildren() throws TskCoreException {
132  return getSleuthkitCase().getAbstractFileChildren(this, TskData.TSK_DB_FILES_TYPE_ENUM.DERIVED);
133  }
134 
144  @Override
145  public List<Long> getChildrenIds() throws TskCoreException {
146  return getSleuthkitCase().getAbstractFileChildrenIds(this, TskData.TSK_DB_FILES_TYPE_ENUM.DERIVED);
147  }
148 
157  @Override
158  public <T> T accept(SleuthkitItemVisitor<T> v) {
159  return v.visit(this);
160  }
161 
170  @Override
171  public <T> T accept(ContentVisitor<T> v) {
172  return v.visit(this);
173  }
174 
184  @Override
185  public String toString(boolean preserveState) {
186  return super.toString(preserveState) + "SlackFile [\t" + "]\t"; //NON-NLS
187  }
188 }
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:112
final Set< TSK_FS_META_FLAG_ENUM > metaFlags
final Set< TskData.TSK_FS_META_MODE_ENUM > modes
DERIVED
File derived from a parent file (i.e. from ZIP)
Definition: TskData.java:658
final SleuthkitCase tskCase
Definition: SlackFile.java:34
String toString(boolean preserveState)
Definition: SlackFile.java:185
static final ResourceBundle bundle
Definition: SlackFile.java:33
static int readFileSlack(long fileHandle, byte[] readBuffer, long offset, long len)
final TSK_FS_META_TYPE_ENUM metaType

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