19 package org.sleuthkit.autopsy.ingest;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.logging.Level;
42 abstract class GetFilesContentVisitor
implements ContentVisitor<Collection<AbstractFile>> {
44 private static final Logger logger = Logger.getLogger(GetFilesContentVisitor.class.getName());
47 public Collection<AbstractFile> visit(VirtualDirectory ld) {
48 return getAllFromChildren(ld);
52 public Collection<AbstractFile> visit(LocalDirectory ld) {
53 return getAllFromChildren(ld);
57 public Collection<AbstractFile> visit(Directory drctr) {
58 return getAllFromChildren(drctr);
62 public Collection<AbstractFile> visit(Image image) {
63 return getAllFromChildren(image);
67 public Collection<AbstractFile> visit(Volume volume) {
68 return getAllFromChildren(volume);
72 public Collection<AbstractFile> visit(VolumeSystem vs) {
73 return getAllFromChildren(vs);
77 public Collection<AbstractFile> visit(Pool pool) {
78 return getAllFromChildren(pool);
82 public Collection<AbstractFile> visit(Report r) {
83 return getAllFromChildren(r);
94 protected Collection<AbstractFile> getAllFromChildren(Content parent) {
95 Collection<AbstractFile> all =
new ArrayList<>();
98 for (Content child : parent.getChildren()) {
99 if (child instanceof AbstractContent){
100 all.addAll(child.accept(
this));
103 }
catch (TskException ex) {
104 logger.log(Level.SEVERE,
"Error getting Content children", ex);