Sleuth Kit Java Bindings (JNI)  4.12.1
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-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  */
19 package org.sleuthkit.datamodel;
20 
21 import java.util.Collections;
22 import java.util.List;
29 
34 public class LocalFile extends AbstractFile {
35 
84  long objId,
85  String name,
89  long size,
90  long ctime, long crtime, long atime, long mtime,
91  String mimeType, String md5Hash, String sha256Hash, String sha1Hash,
93  long parentId, String parentPath,
94  long dataSourceObjectId,
95  String localPath,
96  TskData.EncodingType encodingType,
97  String extension,
98  String ownerUid,
99  Long osAccountObjId) {
100  super(db, objId, dataSourceObjectId, null, TSK_FS_ATTR_TYPE_ENUM.TSK_FS_ATTR_TYPE_DEFAULT, 0,
101  name, fileType, 0L, 0, dirType, metaType, dirFlag,
102  metaFlags, size, ctime, crtime, atime, mtime, (short) 0, 0, 0, md5Hash, sha256Hash, sha1Hash, knownState, parentPath, mimeType, extension, ownerUid, osAccountObjId, TskData.CollectedStatus.UNKNOWN, Collections.emptyList());
103  // TODO (AUT-1904): The parent id should be passed to AbstractContent
104  // through the class hierarchy contructors, using
105  // AbstractContent.UNKNOWN_ID as needed.
106  if (parentId > 0) {
107  setParentId(parentId);
108  }
109  super.setLocalFilePath(localPath);
110  setEncodingType(encodingType);
111  }
112 
122  @Override
123  public List<TskFileRange> getRanges() throws TskCoreException {
124  return Collections.<TskFileRange>emptyList();
125  }
126 
133  @Override
134  public boolean isRoot() {
135  return false;
136  }
137 
147  @Override
148  public <T> T accept(ContentVisitor<T> visitor) {
149  return visitor.visit(this);
150  }
151 
161  @Override
162  public <T> T accept(SleuthkitItemVisitor<T> visitor) {
163  return visitor.visit(this);
164  }
165 
172  @Override
173  public String toString(boolean preserveState) {
174  return super.toString(preserveState) + "LocalFile [\t" + "]\t"; //NON-NLS
175  }
176 
208  @Deprecated
209  @SuppressWarnings("deprecation")
210  protected LocalFile(SleuthkitCase db,
211  long objId,
212  String name,
213  TSK_DB_FILES_TYPE_ENUM fileType,
215  TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags,
216  long size,
217  long ctime, long crtime, long atime, long mtime,
218  String md5Hash, FileKnown knownState,
219  String parentPath,
220  String localPath) {
221  this(db,
222  objId,
223  name,
224  fileType,
225  dirType, metaType,
227  size,
228  ctime, crtime, atime, mtime,
229  null, md5Hash, null, null, knownState,
231  db.getDataSourceObjectId(objId),
232  localPath,
233  TskData.EncodingType.NONE, null, OsAccount.NO_OWNER_ID, OsAccount.NO_ACCOUNT);
234  }
235 
268  @Deprecated
269  protected LocalFile(SleuthkitCase db,
270  long objId,
271  String name,
272  TSK_DB_FILES_TYPE_ENUM fileType,
274  TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags,
275  long size,
276  long ctime, long crtime, long atime, long mtime,
277  String md5Hash, FileKnown knownState,
278  String parentPath, String localPath, long parentId) {
279  this(db, objId, name, fileType, dirType, metaType, dirFlag, metaFlags, size, ctime, crtime, atime, mtime, md5Hash, knownState, parentPath, localPath);
280  }
281 
313  @Deprecated
314  protected LocalFile(SleuthkitCase db,
315  long objId,
316  String name,
318  TSK_FS_NAME_FLAG_ENUM dirFlag, short metaFlags,
319  long size,
320  long ctime, long crtime, long atime, long mtime,
321  String md5Hash, FileKnown knownState,
322  String parentPath, String localPath, long parentId) {
323  this(db, objId, name, TSK_DB_FILES_TYPE_ENUM.LOCAL, dirType, metaType, dirFlag, metaFlags, size, ctime, crtime, atime, mtime, md5Hash, knownState, parentPath, localPath);
324  }
325 }
final TSK_FS_NAME_TYPE_ENUM dirType
final TskData.TSK_DB_FILES_TYPE_ENUM fileType
String toString(boolean preserveState)
Definition: LocalFile.java:173
LOCAL
Local file that was added (not from a disk image)
Definition: TskData.java:697
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:314
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:269
final TSK_FS_META_TYPE_ENUM metaType
List< TskFileRange > getRanges()
Definition: LocalFile.java:123

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.