Sleuth Kit Java Bindings (JNI)  4.11.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 
82  long objId,
83  String name,
87  long size,
88  long ctime, long crtime, long atime, long mtime,
89  String mimeType, String md5Hash, String sha256Hash, FileKnown knownState,
90  long parentId, String parentPath,
91  long dataSourceObjectId,
92  String localPath,
93  TskData.EncodingType encodingType,
94  String extension,
95  String ownerUid,
96  Long osAccountObjId) {
97  super(db, objId, dataSourceObjectId, TSK_FS_ATTR_TYPE_ENUM.TSK_FS_ATTR_TYPE_DEFAULT, 0,
98  name, fileType, 0L, 0, dirType, metaType, dirFlag,
99  metaFlags, size, ctime, crtime, atime, mtime, (short) 0, 0, 0, md5Hash, sha256Hash, knownState, parentPath, mimeType, extension, ownerUid, osAccountObjId, Collections.emptyList());
100  // TODO (AUT-1904): The parent id should be passed to AbstractContent
101  // through the class hierarchy contructors, using
102  // AbstractContent.UNKNOWN_ID as needed.
103  if (parentId > 0) {
104  setParentId(parentId);
105  }
106  super.setLocalFilePath(localPath);
107  setEncodingType(encodingType);
108  }
109 
119  @Override
120  public List<TskFileRange> getRanges() throws TskCoreException {
121  return Collections.<TskFileRange>emptyList();
122  }
123 
130  @Override
131  public boolean isRoot() {
132  return false;
133  }
134 
144  @Override
145  public <T> T accept(ContentVisitor<T> visitor) {
146  return visitor.visit(this);
147  }
148 
158  @Override
159  public <T> T accept(SleuthkitItemVisitor<T> visitor) {
160  return visitor.visit(this);
161  }
162 
169  @Override
170  public String toString(boolean preserveState) {
171  return super.toString(preserveState) + "LocalFile [\t" + "]\t"; //NON-NLS
172  }
173 
205  @Deprecated
206  @SuppressWarnings("deprecation")
207  protected LocalFile(SleuthkitCase db,
208  long objId,
209  String name,
210  TSK_DB_FILES_TYPE_ENUM fileType,
212  TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags,
213  long size,
214  long ctime, long crtime, long atime, long mtime,
215  String md5Hash, FileKnown knownState,
216  String parentPath,
217  String localPath) {
218  this(db,
219  objId,
220  name,
221  fileType,
222  dirType, metaType,
224  size,
225  ctime, crtime, atime, mtime,
226  null, md5Hash, null, knownState,
228  db.getDataSourceObjectId(objId),
229  localPath,
230  TskData.EncodingType.NONE, null, OsAccount.NO_OWNER_ID, OsAccount.NO_ACCOUNT);
231  }
232 
265  @Deprecated
266  protected LocalFile(SleuthkitCase db,
267  long objId,
268  String name,
269  TSK_DB_FILES_TYPE_ENUM fileType,
271  TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags,
272  long size,
273  long ctime, long crtime, long atime, long mtime,
274  String md5Hash, FileKnown knownState,
275  String parentPath, String localPath, long parentId) {
276  this(db, objId, name, fileType, dirType, metaType, dirFlag, metaFlags, size, ctime, crtime, atime, mtime, md5Hash, knownState, parentPath, localPath);
277  }
278 
310  @Deprecated
311  protected LocalFile(SleuthkitCase db,
312  long objId,
313  String name,
315  TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags,
316  long size,
317  long ctime, long crtime, long atime, long mtime,
318  String md5Hash, FileKnown knownState,
319  String parentPath, String localPath, long parentId) {
320  this(db, objId, name, TSK_DB_FILES_TYPE_ENUM.LOCAL, dirType, metaType, dirFlag, metaFlags, size, ctime, crtime, atime, mtime, md5Hash, knownState, parentPath, localPath);
321  }
322 }
final TSK_FS_NAME_TYPE_ENUM dirType
final TskData.TSK_DB_FILES_TYPE_ENUM fileType
String toString(boolean preserveState)
Definition: LocalFile.java:170
LOCAL
Local file that was added (not from a disk image)
Definition: TskData.java:688
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:311
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:266
final TSK_FS_META_TYPE_ENUM metaType
List< TskFileRange > getRanges()
Definition: LocalFile.java:120

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