Sleuth Kit Java Bindings (JNI)  4.8.0
Java bindings for using The Sleuth Kit
LocalFile.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 
21 import java.util.Collections;
22 import java.util.List;
29 
34 public class LocalFile extends AbstractFile {
35 
79  long objId,
80  String name,
84  long size,
85  long ctime, long crtime, long atime, long mtime,
86  String mimeType, String md5Hash, FileKnown knownState,
87  long parentId, String parentPath,
88  long dataSourceObjectId,
89  String localPath,
90  TskData.EncodingType encodingType,
91  String extension) {
92  super(db, objId, dataSourceObjectId, TSK_FS_ATTR_TYPE_ENUM.TSK_FS_ATTR_TYPE_DEFAULT, 0,
93  name, fileType, 0L, 0, dirType, metaType, dirFlag,
94  metaFlags, size, ctime, crtime, atime, mtime, (short) 0, 0, 0, md5Hash, knownState, parentPath, mimeType, extension);
95  // TODO (AUT-1904): The parent id should be passed to AbstractContent
96  // through the class hierarchy contructors, using
97  // AbstractContent.UNKNOWN_ID as needed.
98  if (parentId > 0) {
99  setParentId(parentId);
100  }
101  super.setLocalFilePath(localPath);
102  setEncodingType(encodingType);
103  }
104 
114  @Override
115  public List<TskFileRange> getRanges() throws TskCoreException {
116  return Collections.<TskFileRange>emptyList();
117  }
118 
125  @Override
126  public boolean isRoot() {
127  return false;
128  }
129 
139  @Override
140  public <T> T accept(ContentVisitor<T> visitor) {
141  return visitor.visit(this);
142  }
143 
153  @Override
154  public <T> T accept(SleuthkitItemVisitor<T> visitor) {
155  return visitor.visit(this);
156  }
157 
164  @Override
165  public String toString(boolean preserveState) {
166  return super.toString(preserveState) + "LocalFile [\t" + "]\t"; //NON-NLS
167  }
168 
200  @Deprecated
201  @SuppressWarnings("deprecation")
202  protected LocalFile(SleuthkitCase db,
203  long objId,
204  String name,
205  TSK_DB_FILES_TYPE_ENUM fileType,
207  TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags,
208  long size,
209  long ctime, long crtime, long atime, long mtime,
210  String md5Hash, FileKnown knownState,
211  String parentPath,
212  String localPath) {
213  this(db,
214  objId,
215  name,
216  fileType,
217  dirType, metaType,
219  size,
220  ctime, crtime, atime, mtime,
221  null, md5Hash, knownState,
223  db.getDataSourceObjectId(objId),
224  localPath,
225  TskData.EncodingType.NONE, null);
226  }
227 
260  @Deprecated
261  protected LocalFile(SleuthkitCase db,
262  long objId,
263  String name,
264  TSK_DB_FILES_TYPE_ENUM fileType,
266  TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags,
267  long size,
268  long ctime, long crtime, long atime, long mtime,
269  String md5Hash, FileKnown knownState,
270  String parentPath, String localPath, long parentId) {
271  this(db, objId, name, fileType, dirType, metaType, dirFlag, metaFlags, size, ctime, crtime, atime, mtime, md5Hash, knownState, parentPath, localPath);
272  }
273 
305  @Deprecated
306  protected LocalFile(SleuthkitCase db,
307  long objId,
308  String name,
310  TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags,
311  long size,
312  long ctime, long crtime, long atime, long mtime,
313  String md5Hash, FileKnown knownState,
314  String parentPath, String localPath, long parentId) {
315  this(db, objId, name, TSK_DB_FILES_TYPE_ENUM.LOCAL, dirType, metaType, dirFlag, metaFlags, size, ctime, crtime, atime, mtime, md5Hash, knownState, parentPath, localPath);
316  }
317 }
final TSK_FS_NAME_TYPE_ENUM dirType
final TSK_FS_NAME_FLAG_ENUM dirFlag
final TskData.TSK_DB_FILES_TYPE_ENUM fileType
String toString(boolean preserveState)
Definition: LocalFile.java:165
LOCAL
Local file that was added (not from a disk image)
Definition: TskData.java:679
final Set< TSK_FS_META_FLAG_ENUM > metaFlags
LocalFile(SleuthkitCase db, long objId, String name, TSK_FS_NAME_TYPE_ENUM dirType, TSK_FS_META_TYPE_ENUM metaType, TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags, long size, long ctime, long crtime, long atime, long mtime, String md5Hash, FileKnown knownState, String parentPath, String localPath, long parentId)
Definition: LocalFile.java:306
LocalFile(SleuthkitCase db, long objId, String name, TSK_DB_FILES_TYPE_ENUM fileType, TSK_FS_NAME_TYPE_ENUM dirType, TSK_FS_META_TYPE_ENUM metaType, TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags, long size, long ctime, long crtime, long atime, long mtime, String md5Hash, FileKnown knownState, String parentPath, String localPath, long parentId)
Definition: LocalFile.java:261
final TSK_FS_META_TYPE_ENUM metaType
List< TskFileRange > getRanges()
Definition: LocalFile.java:115

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