19 package org.sleuthkit.autopsy.datamodel;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import org.openide.nodes.Children;
25 import java.util.logging.Level;
26 import org.apache.commons.lang3.StringUtils;
27 import org.openide.util.NbBundle;
51 String name = abstractFile.getName();
52 int dotIndex = name.lastIndexOf(
".");
54 String ext = name.substring(dotIndex).toLowerCase();
73 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
74 String eventType = evt.getPropertyName();
82 if ((moduleContentEvent.getSource() instanceof Content) ==
false) {
85 Content newContent = (Content) moduleContentEvent.getSource();
88 if (
getContent().getId() == newContent.getId()) {
91 Children parentsChildren = getParentNode().getChildren();
92 if (parentsChildren != null) {
93 ((ContentChildren) parentsChildren).refreshChildren();
94 parentsChildren.getNodesCount();
96 }
catch (NullPointerException ex) {
102 if (evt.getNewValue() == null) {
114 public String toString() {
115 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.nameColLbl");
120 public String toString() {
121 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.locationColLbl");
126 public String toString() {
127 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.modifiedTimeColLbl");
132 public String toString() {
133 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.changeTimeColLbl");
138 public String toString() {
139 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.accessTimeColLbl");
144 public String toString() {
145 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.createdTimeColLbl");
150 public String toString() {
151 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.sizeColLbl");
156 public String toString() {
157 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.flagsDirColLbl");
162 public String toString() {
163 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.flagsMetaColLbl");
168 public String toString() {
169 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.modeColLbl");
174 public String toString() {
175 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.useridColLbl");
180 public String toString() {
181 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.groupidColLbl");
186 public String toString() {
187 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.metaAddrColLbl");
192 public String toString() {
193 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.attrAddrColLbl");
198 public String toString() {
199 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.typeDirColLbl");
204 public String toString() {
205 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.typeMetaColLbl");
210 public String toString() {
211 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.knownColLbl");
216 public String toString() {
217 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.inHashsetsColLbl");
222 public String toString() {
223 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.md5HashColLbl");
228 public String toString() {
229 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.objectId");
235 public String toString() {
236 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.mimeType");
253 path = content.getUniquePath();
254 }
catch (TskCoreException ex) {
255 LOGGER.log(Level.SEVERE,
"Except while calling Content.getUniquePath() on {0}", content);
259 map.put(AbstractFilePropertyType.LOCATION.toString(), path);
264 map.put(AbstractFilePropertyType.SIZE.toString(), content.getSize());
265 map.put(AbstractFilePropertyType.FLAGS_DIR.toString(), content.getDirFlagAsString());
266 map.put(AbstractFilePropertyType.FLAGS_META.toString(), content.getMetaFlagsAsString());
267 map.put(AbstractFilePropertyType.MODE.toString(), content.getModesAsString());
268 map.put(AbstractFilePropertyType.USER_ID.toString(), content.getUid());
269 map.put(AbstractFilePropertyType.GROUP_ID.toString(), content.getGid());
270 map.put(AbstractFilePropertyType.META_ADDR.toString(), content.getMetaAddr());
271 map.put(AbstractFilePropertyType.ATTR_ADDR.toString(), Long.toString(content.getAttrType().getValue()) +
"-" + Long.toString(content.getAttrId()));
272 map.put(AbstractFilePropertyType.TYPE_DIR.toString(), content.getDirType().getLabel());
273 map.put(AbstractFilePropertyType.TYPE_META.toString(), content.getMetaType().toString());
274 map.put(AbstractFilePropertyType.KNOWN.toString(), content.getKnown().getName());
276 map.put(AbstractFilePropertyType.MD5HASH.toString(), content.getMd5Hash() == null ?
"" : content.getMd5Hash());
277 map.put(AbstractFilePropertyType.ObjectID.toString(), content.getId());
278 map.put(AbstractFilePropertyType.MIMETYPE.toString(), content.getMIMEType() == null ?
"" : content.getMIMEType());
281 static String getContentDisplayName(AbstractFile file) {
282 String name = file.getName();
294 @SuppressWarnings(
"deprecation")
297 return StringUtils.join(content.getHashSetNames(),
", ");
298 }
catch (TskCoreException tskCoreException) {
299 LOGGER.log(Level.WARNING,
"Error getting hashset hits: ", tskCoreException);
void removeIngestModuleEventListener(final PropertyChangeListener listener)
static final String DOTDIR
static String getStringTime(long epochSeconds, TimeZone tzone)
static List< String > getArchiveExtensions()
static synchronized IngestManager getInstance()
static final String DOTDOTDIR
static String getHashSetHitsForFile(AbstractFile content)
static void fillPropertyMap(Map< String, Object > map, AbstractFile content)
static final Logger LOGGER
static synchronized void removePropertyChangeListener(PropertyChangeListener listener)
void addIngestModuleEventListener(final PropertyChangeListener listener)
static synchronized void addPropertyChangeListener(PropertyChangeListener listener)
synchronized static Logger getLogger(String name)
final PropertyChangeListener pcl