19 package org.sleuthkit.autopsy.ingest;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.logging.Level;
41 abstract class GetFilesContentVisitor
implements ContentVisitor<Collection<AbstractFile>> {
43 private static final Logger logger = Logger.getLogger(GetFilesContentVisitor.class.getName());
46 public Collection<AbstractFile> visit(VirtualDirectory ld) {
47 return getAllFromChildren(ld);
51 public Collection<AbstractFile> visit(LocalDirectory ld) {
52 return getAllFromChildren(ld);
56 public Collection<AbstractFile> visit(Directory drctr) {
57 return getAllFromChildren(drctr);
61 public Collection<AbstractFile> visit(Image image) {
62 return getAllFromChildren(image);
66 public Collection<AbstractFile> visit(Volume volume) {
67 return getAllFromChildren(volume);
71 public Collection<AbstractFile> visit(VolumeSystem vs) {
72 return getAllFromChildren(vs);
76 public Collection<AbstractFile> visit(Report r) {
77 return getAllFromChildren(r);
88 protected Collection<AbstractFile> getAllFromChildren(Content parent) {
89 Collection<AbstractFile> all =
new ArrayList<>();
92 for (Content child : parent.getChildren()) {
93 if (child instanceof AbstractContent){
94 all.addAll(child.accept(
this));
97 }
catch (TskException ex) {
98 logger.log(Level.SEVERE,
"Error getting Content children", ex);