Sleuth Kit Java Bindings (JNI)  4.2
Java bindings for using The Sleuth Kit
VirtualDirectory.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2012 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 
38 public class VirtualDirectory extends AbstractFile {
39 
40  //some built-in virtual directory names
41  public static final String NAME_UNALLOC = "$Unalloc"; //NON-NLS
42  public static final String NAME_CARVED = "$CarvedFiles"; //NON-NLS
43 
46  long size, String md5Hash, FileKnown knownState, String parentPath) {
47  super(db, objId, TSK_FS_ATTR_TYPE_ENUM.TSK_FS_ATTR_TYPE_DEFAULT, (short) 0, name,
48  TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR, 0L, 0, dirType, metaType, dirFlag,
49  metaFlags, 0L, 0L, 0L, 0L, 0L, (short) 0, 0, 0, md5Hash, knownState, parentPath);
50  }
51 
52  @Override
53  public List<Content> getChildren() throws TskCoreException {
54  return getSleuthkitCase().getAbstractFileChildren(this);
55  }
56 
57  @Override
58  public List<Long> getChildrenIds() throws TskCoreException {
59  return getSleuthkitCase().getAbstractFileChildrenIds(this);
60  }
61 
62  @Override
63  public List<TskFileRange> getRanges() throws TskCoreException {
64  return Collections.<TskFileRange>emptyList();
65  }
66 
67  @Override
68  public void close() {
69  //nothing to be closed
70  }
71 
72  @Override
73  public boolean isRoot() {
74  return false;
75  }
76 
77  @Override
78  public <T> T accept(ContentVisitor<T> v) {
79  return v.visit(this);
80  }
81 
82  @Override
83  public <T> T accept(SleuthkitItemVisitor<T> v) {
84  return v.visit(this);
85  }
86 
87  @Override
90  if (parent != null) {
91  return parent.getDataSource();
92  } else {
93  //root-level VirtualDirectory, such as local files container
94  return this;
95  }
96  }
97 
98  @Override
99  public String toString(boolean preserveState) {
100  return super.toString(preserveState) + "VirtualDirectory [\t" + "]\t"; //NON-NLS
101  }
102 }
final TSK_FS_NAME_TYPE_ENUM dirType
final TSK_FS_NAME_FLAG_ENUM dirFlag
VirtualDirectory(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, String md5Hash, FileKnown knownState, String parentPath)
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:650
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.