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;
38 class ContentChildren
extends AbstractContentChildren<Content> {
40 private static final Logger logger = Logger.getLogger(ContentChildren.class.getName());
43 private final Content parent;
45 ContentChildren(Content parent) {
60 private static List<Content> getDisplayChildren(Content parent) {
62 List<Content> tmpChildren;
64 tmpChildren = parent.getChildren();
65 }
catch (TskCoreException ex) {
66 logger.log(Level.WARNING,
"Error getting Content children.", ex);
67 tmpChildren = Collections.emptyList();
72 List<Content> children =
new ArrayList<>();
73 for (Content c : tmpChildren) {
74 if (c instanceof VolumeSystem) {
75 children.addAll(getDisplayChildren(c));
76 }
else if (c instanceof FileSystem) {
77 children.addAll(getDisplayChildren(c));
78 }
else if (c instanceof Directory) {
79 Directory dir = (Directory) c;
86 if ((dir.isRoot()) && (dir.getName().equals(
".") ==
false)
87 && (dir.getName().equals(
"..") ==
false)) {
88 children.addAll(getDisplayChildren(dir));
92 }
else if (c instanceof LocalDirectory) {
93 LocalDirectory localDir = (LocalDirectory)c;
94 if (localDir.isRoot()) {
95 children.addAll(getDisplayChildren(localDir));
107 protected void addNotify() {
115 List<Content> children = getDisplayChildren(parent);
125 protected void removeNotify() {
126 super.removeNotify();
127 setKeys(
new ArrayList<>());
135 void refreshChildren() {
136 List<Content> children = getDisplayChildren(parent);