19 package org.sleuthkit.autopsy.datamodel;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import java.util.ArrayList;
24 import java.util.List;
25 import org.openide.nodes.Children;
27 import java.util.logging.Level;
28 import java.util.stream.Collectors;
29 import org.apache.commons.lang3.StringUtils;
30 import org.openide.nodes.Sheet;
31 import org.openide.util.NbBundle;
58 String name = abstractFile.getName();
59 int dotIndex = name.lastIndexOf(
".");
61 String ext = name.substring(dotIndex).toLowerCase();
80 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
81 String eventType = evt.getPropertyName();
89 if ((moduleContentEvent.getSource() instanceof
Content) ==
false) {
98 Children parentsChildren = getParentNode().getChildren();
99 if (parentsChildren != null) {
100 ((ContentChildren) parentsChildren).refreshChildren();
101 parentsChildren.getNodesCount();
103 }
catch (NullPointerException ex) {
109 if (evt.getNewValue() == null) {
115 if (event.getAddedTag().getContent().equals(content)) {
120 if (event.getDeletedTagInfo().getContentID() == content.getId()) {
127 this.setSheet(createSheet());
135 public String toString() {
136 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.nameColLbl");
141 public String toString() {
142 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.locationColLbl");
147 public String toString() {
148 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.modifiedTimeColLbl");
153 public String toString() {
154 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.changeTimeColLbl");
159 public String toString() {
160 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.accessTimeColLbl");
165 public String toString() {
166 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.createdTimeColLbl");
171 public String toString() {
172 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.sizeColLbl");
177 public String toString() {
178 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.flagsDirColLbl");
183 public String toString() {
184 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.flagsMetaColLbl");
189 public String toString() {
190 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.modeColLbl");
195 public String toString() {
196 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.useridColLbl");
201 public String toString() {
202 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.groupidColLbl");
207 public String toString() {
208 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.metaAddrColLbl");
213 public String toString() {
214 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.attrAddrColLbl");
219 public String toString() {
220 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.typeDirColLbl");
225 public String toString() {
226 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.typeMetaColLbl");
231 public String toString() {
232 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.knownColLbl");
237 public String toString() {
238 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.inHashsetsColLbl");
243 public String toString() {
244 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.md5HashColLbl");
249 public String toString() {
250 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.objectId");
256 public String toString() {
257 return NbBundle.getMessage(this.getClass(),
"AbstractAbstractFileNode.mimeType");
276 LOGGER.log(Level.SEVERE,
"Except while calling Content.getUniquePath() on {0}", content);
280 map.put(AbstractFilePropertyType.LOCATION.toString(), path);
285 map.put(AbstractFilePropertyType.SIZE.toString(), content.
getSize());
288 map.put(AbstractFilePropertyType.MODE.toString(), content.
getModesAsString());
289 map.put(AbstractFilePropertyType.USER_ID.toString(), content.
getUid());
290 map.put(AbstractFilePropertyType.GROUP_ID.toString(), content.
getGid());
291 map.put(AbstractFilePropertyType.META_ADDR.toString(), content.
getMetaAddr());
292 map.put(AbstractFilePropertyType.ATTR_ADDR.toString(), Long.toString(content.
getAttrType().getValue()) +
"-" + content.
getAttributeId());
293 map.put(AbstractFilePropertyType.TYPE_DIR.toString(), content.
getDirType().getLabel());
294 map.put(AbstractFilePropertyType.TYPE_META.toString(), content.
getMetaType().toString());
295 map.put(AbstractFilePropertyType.KNOWN.toString(), content.
getKnown().getName());
297 map.put(AbstractFilePropertyType.MD5HASH.toString(), content.
getMd5Hash() == null ?
"" : content.
getMd5Hash());
298 map.put(AbstractFilePropertyType.ObjectID.toString(), content.
getId());
299 map.put(AbstractFilePropertyType.MIMETYPE.toString(), content.
getMIMEType() == null ?
"" : content.
getMIMEType());
308 final String NO_DESCR = NbBundle.getMessage(
AbstractAbstractFileNode.class,
"AbstractAbstractFileNode.addFileProperty.desc");
309 List<ContentTag> tags;
313 tags =
new ArrayList<>();
314 LOGGER.log(Level.SEVERE,
"Failed to get tags for content " + content.getName(), ex);
317 NO_DESCR, tags.stream().map(t -> t.getName().getDisplayName()).collect(Collectors.joining(
", "))));
320 static String getContentDisplayName(
AbstractFile file) {
333 @SuppressWarnings(
"deprecation")
336 return StringUtils.join(content.getHashSetNames(),
", ");
338 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)
String getMetaFlagsAsString()
static List< String > getArchiveExtensions()
static synchronized IngestManager getInstance()
static void removePropertyChangeListener(PropertyChangeListener listener)
static final String DOTDOTDIR
static String getHashSetHitsForFile(AbstractFile content)
void addTagProperty(Sheet.Set ss)
TSK_FS_NAME_TYPE_ENUM getDirType()
String getDirFlagAsString()
synchronized String getUniquePath()
static void fillPropertyMap(Map< String, Object > map, AbstractFile content)
TskData.FileKnown getKnown()
TagsManager getTagsManager()
TSK_FS_META_TYPE_ENUM getMetaType()
static final Logger LOGGER
static void addPropertyChangeListener(PropertyChangeListener listener)
String getModesAsString()
void addIngestModuleEventListener(final PropertyChangeListener listener)
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
final PropertyChangeListener pcl
TskData.TSK_FS_ATTR_TYPE_ENUM getAttrType()