Sleuth Kit Java Bindings (JNI)  4.3
Java bindings for using The Sleuth Kit
VirtualDirectory.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.Collections;
22 import java.util.List;
28 
35 public class VirtualDirectory extends AbstractFile {
36 
41  public static final String NAME_UNALLOC = "$Unalloc"; //NON-NLS
42 
46  public static final String NAME_CARVED = "$CarvedFiles"; //NON-NLS
47 
76  long objId,
77  long dataSourceObjectId,
78  String name,
82  String parentPath) {
83  super(db, objId, dataSourceObjectId, TSK_FS_ATTR_TYPE_ENUM.TSK_FS_ATTR_TYPE_DEFAULT, 0, name,
84  TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR, 0L, 0, dirType, metaType, dirFlag,
85  metaFlags, 0L, 0L, 0L, 0L, 0L, (short) 0, 0, 0, md5Hash, knownState, parentPath, null);
86  }
87 
93  public boolean isDataSource() {
94  return (this.getDataSourceObjectId() == this.getId());
95  }
96 
107  @Override
109  if (this.getDataSourceObjectId() == this.getId()) {
110  // This virtual directory is a data source.
111  return this;
112  } else {
113  return super.getDataSource();
114  }
115  }
116 
125  @Override
126  public List<Content> getChildren() throws TskCoreException {
127  return getSleuthkitCase().getAbstractFileChildren(this);
128  }
129 
138  @Override
139  public List<Long> getChildrenIds() throws TskCoreException {
140  return getSleuthkitCase().getAbstractFileChildrenIds(this);
141  }
142 
152  @Override
153  public List<TskFileRange> getRanges() throws TskCoreException {
154  return Collections.<TskFileRange>emptyList();
155  }
156 
160  @Override
161  public void close() {
162  }
163 
170  @Override
171  public boolean isRoot() {
172  return false;
173  }
174 
183  @Override
184  public <T> T accept(ContentVisitor<T> visitor) {
185  return visitor.visit(this);
186  }
187 
196  @Override
197  public <T> T accept(SleuthkitItemVisitor<T> visitor) {
198  return visitor.visit(this);
199  }
200 
210  @Override
211  public String toString(boolean preserveState) {
212  return super.toString(preserveState) + "VirtualDirectory [\t" + "]\t"; //NON-NLS
213  }
214 
243  @Deprecated
244  @SuppressWarnings("deprecation")
246  long objId,
247  String name,
250  long size,
251  String md5Hash, FileKnown knownState,
252  String parentPath) {
253  this(db, objId, db.getDataSourceObjectId(objId), name, dirType, metaType, dirFlag, metaFlags, md5Hash, knownState, parentPath);
254  }
255 
256 }
final TSK_FS_NAME_TYPE_ENUM dirType
final TSK_FS_NAME_FLAG_ENUM dirFlag
final Set< TSK_FS_META_FLAG_ENUM > metaFlags
String toString(boolean preserveState)
VIRTUAL_DIR
Virtual directory (not on fs) with no meta-data entry that can be used to group files of types other ...
Definition: TskData.java:662
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.