19 package org.sleuthkit.autopsy.datamodel;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24 import java.util.logging.Level;
37 class ContentChildren
extends AbstractContentChildren<Content> {
39 private static final Logger logger = Logger.getLogger(ContentChildren.class.getName());
42 private final Content parent;
44 ContentChildren(Content parent) {
59 private static List<Content> getDisplayChildren(Content parent) {
61 List<Content> tmpChildren;
63 tmpChildren = parent.getChildren();
64 }
catch (TskCoreException ex) {
65 logger.log(Level.WARNING,
"Error getting Content children.", ex);
66 tmpChildren = Collections.emptyList();
71 List<Content> children =
new ArrayList<>();
72 for (Content c : tmpChildren) {
73 if (c instanceof VolumeSystem) {
74 children.addAll(getDisplayChildren(c));
75 }
else if (c instanceof FileSystem) {
76 children.addAll(getDisplayChildren(c));
77 }
else if (c instanceof Directory) {
78 Directory dir = (Directory) c;
85 if ((dir.isRoot()) && (dir.getName().equals(
".") ==
false)
86 && (dir.getName().equals(
"..") ==
false)) {
87 children.addAll(getDisplayChildren(dir));
99 protected void addNotify() {
107 List<Content> children = getDisplayChildren(parent);
117 protected void removeNotify() {
118 super.removeNotify();
119 setKeys(
new ArrayList<>());
127 void refreshChildren() {
128 List<Content> children = getDisplayChildren(parent);