19 package org.sleuthkit.autopsy.ingest;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.logging.Level;
40 abstract class GetFilesContentVisitor
implements ContentVisitor<Collection<AbstractFile>> {
42 private static final Logger logger = Logger.getLogger(GetFilesContentVisitor.class.getName());
45 public Collection<AbstractFile> visit(VirtualDirectory ld) {
46 return getAllFromChildren(ld);
50 public Collection<AbstractFile> visit(LocalDirectory ld) {
51 return getAllFromChildren(ld);
55 public Collection<AbstractFile> visit(Directory drctr) {
56 return getAllFromChildren(drctr);
60 public Collection<AbstractFile> visit(Image image) {
61 return getAllFromChildren(image);
65 public Collection<AbstractFile> visit(Volume volume) {
66 return getAllFromChildren(volume);
70 public Collection<AbstractFile> visit(VolumeSystem vs) {
71 return getAllFromChildren(vs);
82 protected Collection<AbstractFile> getAllFromChildren(Content parent) {
83 Collection<AbstractFile> all =
new ArrayList<>();
86 for (Content child : parent.getChildren()) {
87 if (child instanceof AbstractContent){
88 all.addAll(child.accept(
this));
91 }
catch (TskException ex) {
92 logger.log(Level.SEVERE,
"Error getting Content children", ex);