19 package org.sleuthkit.autopsy.ingest;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.logging.Level;
38 abstract class GetFilesContentVisitor
implements ContentVisitor<Collection<AbstractFile>> {
40 private static final Logger logger = Logger.getLogger(GetFilesContentVisitor.class.getName());
43 public Collection<AbstractFile>
visit(VirtualDirectory ld) {
44 return getAllFromChildren(ld);
48 public Collection<AbstractFile>
visit(Directory drctr) {
49 return getAllFromChildren(drctr);
53 public Collection<AbstractFile>
visit(Image image) {
54 return getAllFromChildren(image);
58 public Collection<AbstractFile>
visit(Volume volume) {
59 return getAllFromChildren(volume);
63 public Collection<AbstractFile>
visit(VolumeSystem vs) {
64 return getAllFromChildren(vs);
74 protected Collection<AbstractFile> getAllFromChildren(Content parent) {
75 Collection<AbstractFile> all =
new ArrayList<>();
78 for (Content child : parent.getChildren()) {
79 all.addAll(child.accept(
this));
81 }
catch (TskException ex) {
82 logger.log(Level.SEVERE,
"Error getting Content children", ex);