19 package org.sleuthkit.autopsy.datamodel;
21 import java.sql.ResultSet;
22 import java.sql.SQLException;
23 import java.util.List;
24 import java.util.logging.Level;
26 import org.openide.util.lookup.Lookups;
27 import org.openide.util.Lookup;
31 import org.
sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
58 this(content, Lookups.singleton(content) );
69 super(
new ContentChildren(content), lookup);
70 this.content = content;
72 super.setName(
"content_" + Long.toString(content.getId()));
91 return super.getName();
113 String query =
"SELECT COUNT(obj_id) AS count FROM "
114 +
" ( SELECT obj_id FROM tsk_objects WHERE par_obj_id = " + c.getId() +
" AND type = "
115 + TskData.ObjectType.ARTIFACT.getObjectType()
116 +
" INTERSECT SELECT artifact_obj_id FROM blackboard_artifacts WHERE obj_id = " + c.getId()
117 +
" AND (artifact_type_id = " + ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID()
118 +
" OR artifact_type_id = " + ARTIFACT_TYPE.TSK_MESSAGE.getTypeID() +
") "
119 +
" UNION SELECT obj_id FROM tsk_objects WHERE par_obj_id = " + c.getId()
120 +
" AND type = " + TskData.ObjectType.ABSTRACTFILE.getObjectType() +
") AS OBJECT_IDS";
124 ResultSet resultSet = dbQuery.getResultSet();
125 if(resultSet.next()){
126 return (0 < resultSet.getInt(
"count"));
129 logger.log(Level.SEVERE,
"Error checking if the node has children, for content: " + c, ex);
142 boolean hasChildren =
false;
144 if (content != null) {
146 hasChildren = content.hasChildren();
147 }
catch (TskCoreException ex) {
148 logger.log(Level.SEVERE,
"Error checking if the node has children, for content: " + content, ex);
162 List<Long> childrenIds = null;
164 if (content != null) {
166 childrenIds = content.getChildrenIds();
167 }
catch (TskCoreException ex) {
168 logger.log(Level.SEVERE,
"Error getting children ids, for content: " + content, ex);
182 List<Content> children = null;
184 if (content != null) {
186 children = content.getChildren();
187 }
catch (TskCoreException ex) {
188 logger.log(Level.SEVERE,
"Error getting children, for content: " + content, ex);
204 int childrenCount = -1;
206 if (content != null) {
208 childrenCount = content.getChildrenCount();
209 }
catch (TskCoreException ex) {
210 logger.log(Level.SEVERE,
"Error checking node content children count, for content: " + content, ex);
214 return childrenCount;
229 public int read(byte[] buf,
long offset,
long len)
throws TskException {
230 return content.read(buf, offset, len);
int read(byte[] buf, long offset, long len)
List< Content > getContentChildren()
static final Logger logger
void setName(String name)
int getContentChildrenCount()
boolean hasContentChildren()
boolean hasVisibleContentChildren()
SleuthkitCase getSleuthkitCase()
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
List< Long > getContentChildrenIds()
static boolean contentHasVisibleContentChildren(Content c)