Autopsy  4.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;
32 
37 final class GetRootDirectoryVisitor extends GetFilesContentVisitor {
38 
39  @Override
40  public Collection<AbstractFile> visit(VirtualDirectory ld) {
41  //case when we hit a layout directoryor local file container, not under a real FS
42  //or when root virt dir is scheduled
43  Collection<AbstractFile> ret = new ArrayList<>();
44  ret.add(ld);
45  return ret;
46  }
47 
48  @Override
49  public Collection<AbstractFile> visit(LayoutFile lf) {
50  //case when we hit a layout file, not under a real FS
51  Collection<AbstractFile> ret = new ArrayList<>();
52  ret.add(lf);
53  return ret;
54  }
55 
56  @Override
57  public Collection<AbstractFile> visit(Directory drctr) {
58  //we hit a real directory, a child of real FS
59  Collection<AbstractFile> ret = new ArrayList<>();
60  ret.add(drctr);
61  return ret;
62  }
63 
64  @Override
65  public Collection<AbstractFile> visit(FileSystem fs) {
66  return getAllFromChildren(fs);
67  }
68 
69  @Override
70  public Collection<AbstractFile> visit(File file) {
71  //can have derived files
72  return getAllFromChildren(file);
73  }
74 
75  @Override
76  public Collection<AbstractFile> visit(DerivedFile derivedFile) {
77  //can have derived files
78  //TODO test this and overall scheduler with derived files
79  return getAllFromChildren(derivedFile);
80  }
81 
82  @Override
83  public Collection<AbstractFile> visit(LocalFile localFile) {
84  //can have local files
85  //TODO test this and overall scheduler with local files
86  return getAllFromChildren(localFile);
87  }
88 
89  @Override
90  public Collection<AbstractFile> visit(SlackFile slackFile) {
91  //can have slack files
92  //TODO test this and overall scheduler with local files
93  return getAllFromChildren(slackFile);
94  }
95 
96 }

Copyright © 2012-2016 Basis Technology. Generated on: Mon Apr 24 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.