Autopsy  3.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
GetRootDirectoryVisitor.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.autopsy.ingest;
20 
21 import java.util.ArrayList;
22 import java.util.Collection;
31 
36 final class GetRootDirectoryVisitor extends GetFilesContentVisitor {
37 
38  @Override
39  public Collection<AbstractFile> visit(VirtualDirectory ld) {
40  //case when we hit a layout directoryor local file container, not under a real FS
41  //or when root virt dir is scheduled
42  Collection<AbstractFile> ret = new ArrayList<>();
43  ret.add(ld);
44  return ret;
45  }
46 
47  @Override
48  public Collection<AbstractFile> visit(LayoutFile lf) {
49  //case when we hit a layout file, not under a real FS
50  Collection<AbstractFile> ret = new ArrayList<>();
51  ret.add(lf);
52  return ret;
53  }
54 
55  @Override
56  public Collection<AbstractFile> visit(Directory drctr) {
57  //we hit a real directory, a child of real FS
58  Collection<AbstractFile> ret = new ArrayList<>();
59  ret.add(drctr);
60  return ret;
61  }
62 
63  @Override
64  public Collection<AbstractFile> visit(FileSystem fs) {
65  return getAllFromChildren(fs);
66  }
67 
68  @Override
69  public Collection<AbstractFile> visit(File file) {
70  //can have derived files
71  return getAllFromChildren(file);
72  }
73 
74  @Override
75  public Collection<AbstractFile> visit(DerivedFile derivedFile) {
76  //can have derived files
77  //TODO test this and overall scheduler with derived files
78  return getAllFromChildren(derivedFile);
79  }
80 
81  @Override
82  public Collection<AbstractFile> visit(LocalFile localFile) {
83  //can have local files
84  //TODO test this and overall scheduler with local files
85  return getAllFromChildren(localFile);
86  }
87 
88 }

Copyright © 2012-2015 Basis Technology. Generated on: Mon Oct 19 2015
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.