From 938d5128d0358d6c576cf01bc99f53e90a82d536 Mon Sep 17 00:00:00 2001 From: esaunders Date: Wed, 28 Nov 2018 12:28:40 -0500 Subject: [PATCH] Revert changes to AbstractFilePropertyType public enum. --- .../datamodel/AbstractAbstractFileNode.java | 82 +++++++++++-------- .../autopsy/datamodel/Bundle_ja.properties | 8 ++ 2 files changed, 57 insertions(+), 33 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java index e5016b89ec..09c60b9f5c 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java @@ -107,7 +107,7 @@ public abstract class AbstractAbstractFileNode extends A static { //Initialize this pool only once! This will be used by every instance of AAFN //to do their heavy duty SCO column and translation updates. - translationPool = Executors.newFixedThreadPool(MAX_POOL_SIZE, + translationPool = Executors.newFixedThreadPool(MAX_POOL_SIZE, new ThreadFactoryBuilder().setNameFormat("translation-task-thread-%d").build()); } @@ -191,8 +191,8 @@ public abstract class AbstractAbstractFileNode extends A Score value = scorePropAndDescr.getLeft(); String descr = scorePropAndDescr.getRight(); CorrelationAttributeInstance attribute = getCorrelationAttributeInstance(); - updateSheet(new NodeProperty<>(SCORE.toString(),SCORE.toString(),descr,value), - new NodeProperty<>(COMMENT.toString(),COMMENT.toString(),NO_DESCR,getCommentProperty(tags, attribute)) + updateSheet(new NodeProperty<>(SCORE.toString(), SCORE.toString(), descr, value), + new NodeProperty<>(COMMENT.toString(), COMMENT.toString(), NO_DESCR, getCommentProperty(tags, attribute)) ); } } else if (eventType.equals(Case.Events.CONTENT_TAG_DELETED.toString())) { @@ -203,8 +203,8 @@ public abstract class AbstractAbstractFileNode extends A Score value = scorePropAndDescr.getLeft(); String descr = scorePropAndDescr.getRight(); CorrelationAttributeInstance attribute = getCorrelationAttributeInstance(); - updateSheet(new NodeProperty<>(SCORE.toString(), SCORE.toString(),descr,value), - new NodeProperty<>(COMMENT.toString(), COMMENT.toString(),NO_DESCR,getCommentProperty(tags, attribute)) + updateSheet(new NodeProperty<>(SCORE.toString(), SCORE.toString(), descr, value), + new NodeProperty<>(COMMENT.toString(), COMMENT.toString(), NO_DESCR, getCommentProperty(tags, attribute)) ); } } else if (eventType.equals(Case.Events.CR_COMMENT_CHANGED.toString())) { @@ -212,14 +212,14 @@ public abstract class AbstractAbstractFileNode extends A if (event.getContentID() == content.getId()) { List tags = getContentTagsFromDatabase(); CorrelationAttributeInstance attribute = getCorrelationAttributeInstance(); - updateSheet(new NodeProperty<>(COMMENT.toString(), COMMENT.toString(),NO_DESCR,getCommentProperty(tags, attribute))); + updateSheet(new NodeProperty<>(COMMENT.toString(), COMMENT.toString(), NO_DESCR, getCommentProperty(tags, attribute))); } - /* - * Data that was being computed in the background task. Kicked off by a - * call to createSheet(). - */ + /* + * Data that was being computed in the background task. Kicked off + * by a call to createSheet(). + */ } else if (eventType.equals(NodeSpecificEvents.TRANSLATION_AVAILABLE.toString())) { - updateSheet(new NodeProperty<>(TRANSLATION.toString(),TRANSLATION.toString(),NO_DESCR,evt.getNewValue())); + updateSheet(new NodeProperty<>(TRANSLATION.toString(), TRANSLATION.toString(), NO_DESCR, evt.getNewValue())); } }; /** @@ -251,9 +251,9 @@ public abstract class AbstractAbstractFileNode extends A Sheet visibleSheet = this.getSheet(); Sheet.Set visibleSheetSet = visibleSheet.get(Sheet.PROPERTIES); Property[] visibleProps = visibleSheetSet.getProperties(); - for(NodeProperty newProp: newProps) { - for(int i = 0; i < visibleProps.length; i++) { - if(visibleProps[i].getName().equals(newProp.getName())) { + for (NodeProperty newProp : newProps) { + for (int i = 0; i < visibleProps.length; i++) { + if (visibleProps[i].getName().equals(newProp.getName())) { visibleProps[i] = newProp; } } @@ -281,10 +281,10 @@ public abstract class AbstractAbstractFileNode extends A newProperties.forEach((property) -> { sheetSet.put(property); }); - + /* - * Submit the translation task ASAP. Keep all weak references so - * this task doesn't block the ability of this node to be GC'd. + * Submit the translation task ASAP. Keep all weak references so this + * task doesn't block the ability of this node to be GC'd. */ translationPool.submit(new TranslationTask(new WeakReference<>(this), weakPcl)); @@ -304,8 +304,16 @@ public abstract class AbstractAbstractFileNode extends A "AbstractAbstractFileNode.sizeColLbl=Size", "AbstractAbstractFileNode.flagsDirColLbl=Flags(Dir)", "AbstractAbstractFileNode.flagsMetaColLbl=Flags(Meta)", + "AbstractAbstractFileNode.modeColLbl=Mode", + "AbstractAbstractFileNode.useridColLbl=UserID", + "AbstractAbstractFileNode.groupidColLbl=GroupID", + "AbstractAbstractFileNode.metaAddrColLbl=Meta Addr.", + "AbstractAbstractFileNode.attrAddrColLbl=Attr. Addr.", + "AbstractAbstractFileNode.typeDirColLbl=Type(Dir)", + "AbstractAbstractFileNode.typeMetaColLbl=Type(Meta)", "AbstractAbstractFileNode.knownColLbl=Known", "AbstractAbstractFileNode.md5HashColLbl=MD5 Hash", + "AbstractAbstractFileNode.objectId=Object ID", "AbstractAbstractFileNode.mimeType=MIME Type", "AbstractAbstractFileNode.extensionColLbl=Extension"}) public enum AbstractFilePropertyType { @@ -323,8 +331,16 @@ public abstract class AbstractAbstractFileNode extends A SIZE(AbstractAbstractFileNode_sizeColLbl()), FLAGS_DIR(AbstractAbstractFileNode_flagsDirColLbl()), FLAGS_META(AbstractAbstractFileNode_flagsMetaColLbl()), + MODE(AbstractAbstractFileNode_modeColLbl()), + USER_ID(AbstractAbstractFileNode_useridColLbl()), + GROUP_ID(AbstractAbstractFileNode_groupidColLbl()), + META_ADDR(AbstractAbstractFileNode_metaAddrColLbl()), + ATTR_ADDR(AbstractAbstractFileNode_attrAddrColLbl()), + TYPE_DIR(AbstractAbstractFileNode_typeDirColLbl()), + TYPE_META(AbstractAbstractFileNode_typeMetaColLbl()), KNOWN(AbstractAbstractFileNode_knownColLbl()), MD5HASH(AbstractAbstractFileNode_md5HashColLbl()), + ObjectID(AbstractAbstractFileNode_objectId()), MIMETYPE(AbstractAbstractFileNode_mimeType()), EXTENSION(AbstractAbstractFileNode_extensionColLbl()); @@ -345,12 +361,12 @@ public abstract class AbstractAbstractFileNode extends A */ private List> getProperties() { List> properties = new ArrayList<>(); - properties.add(new NodeProperty<>(NAME.toString(), NAME.toString(), NO_DESCR, getContentDisplayName(content))); + properties.add(new NodeProperty<>(NAME.toString(), NAME.toString(), NO_DESCR, getContentDisplayName(content))); /* * Initialize an empty place holder value. At the bottom, we kick off a * background task that promises to update these values. */ - + if (UserPreferences.displayTranslatedFileNames()) { properties.add(new NodeProperty<>(TRANSLATION.toString(), TRANSLATION.toString(), NO_DESCR, "")); } @@ -358,7 +374,7 @@ public abstract class AbstractAbstractFileNode extends A //SCO column prereq info.. List tags = getContentTagsFromDatabase(); CorrelationAttributeInstance attribute = getCorrelationAttributeInstance(); - + Pair scoreAndDescription = getScorePropertyAndDescription(tags); properties.add(new NodeProperty<>(SCORE.toString(), SCORE.toString(), scoreAndDescription.getRight(), scoreAndDescription.getLeft())); DataResultViewerTable.HasCommentStatus comment = getCommentProperty(tags, attribute); @@ -379,7 +395,7 @@ public abstract class AbstractAbstractFileNode extends A properties.add(new NodeProperty<>(MD5HASH.toString(), MD5HASH.toString(), NO_DESCR, StringUtils.defaultString(content.getMd5Hash()))); properties.add(new NodeProperty<>(MIMETYPE.toString(), MIMETYPE.toString(), NO_DESCR, StringUtils.defaultString(content.getMIMEType()))); properties.add(new NodeProperty<>(EXTENSION.toString(), EXTENSION.toString(), NO_DESCR, content.getNameExtension())); - + return properties; } @@ -421,7 +437,7 @@ public abstract class AbstractAbstractFileNode extends A return ""; } } - + @NbBundle.Messages({ "AbstractAbstractFileNode.createSheet.count.displayName=O", "AbstractAbstractFileNode.createSheet.count.noCentralRepo.description=Central repository was not enabled when this column was populated", @@ -447,7 +463,7 @@ public abstract class AbstractAbstractFileNode extends A return Pair.of(count, description); } - + @NbBundle.Messages({ "AbstractAbstractFileNode.createSheet.score.displayName=S", "AbstractAbstractFileNode.createSheet.notableFile.description=File recognized as notable.", @@ -483,7 +499,7 @@ public abstract class AbstractAbstractFileNode extends A } return Pair.of(score, description); } - + @NbBundle.Messages({ "AbstractAbstractFileNode.createSheet.comment.displayName=C"}) HasCommentStatus getCommentProperty(List tags, CorrelationAttributeInstance attribute) { @@ -506,10 +522,10 @@ public abstract class AbstractAbstractFileNode extends A } return status; } - + /** - * Translates this nodes content name. Doesn't attempt translation if - * the name is in english or if there is now translation service available. + * Translates this nodes content name. Doesn't attempt translation if the + * name is in english or if there is now translation service available. */ String getTranslatedFileName() { //If already in complete English, don't translate. @@ -542,7 +558,7 @@ public abstract class AbstractAbstractFileNode extends A } return ""; } - + /** * Get all tags from the case database that are associated with the file * @@ -565,7 +581,7 @@ public abstract class AbstractAbstractFileNode extends A } return attribute; } - + static String getContentPath(AbstractFile file) { try { return file.getUniquePath(); @@ -575,7 +591,7 @@ public abstract class AbstractAbstractFileNode extends A } } - static String getContentDisplayName(AbstractFile file) { + static String getContentDisplayName(AbstractFile file) { String name = file.getName(); switch (name) { case "..": @@ -593,9 +609,9 @@ public abstract class AbstractAbstractFileNode extends A * @param map map with preserved ordering, where property names/values * are put * @param content The content to get properties for. - * - * TODO JIRA-4421: Deprecate this method and resolve warnings that appear - * in other locations. + * + * TODO JIRA-4421: Deprecate this method and resolve warnings that appear in + * other locations. */ static public void fillPropertyMap(Map map, AbstractFile content) { map.put(NAME.toString(), getContentDisplayName(content)); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/datamodel/Bundle_ja.properties index 34a1274c32..2f91dfb27a 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Bundle_ja.properties +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Bundle_ja.properties @@ -6,6 +6,9 @@ AbstractAbstractFileNode.changeTimeColLbl=\u5909\u66f4\u65e5\u6642 AbstractAbstractFileNode.accessTimeColLbl=\u30a2\u30af\u30bb\u30b9\u65e5\u6642 AbstractAbstractFileNode.createdTimeColLbl=\u4f5c\u6210\u65e5\u6642 AbstractAbstractFileNode.sizeColLbl=\u30b5\u30a4\u30ba +AbstractAbstractFileNode.modeColLbl=\u30e2\u30fc\u30c9 +AbstractAbstractFileNode.useridColLbl=\u30e6\u30fc\u30b6ID +AbstractAbstractFileNode.groupidColLbl=\u30b0\u30eb\u30fc\u30d7ID AbstractAbstractFileNode.knownColLbl=\u65e2\u77e5 AbstractAbstractFileNode.md5HashColLbl=MD5\u30cf\u30c3\u30b7\u30e5 AbstractContentChildren.CreateTSKNodeVisitor.exception.noNodeMsg=\u6307\u5b9a\u3055\u308c\u305fSleuthkitItem\u306e\u30ce\u30fc\u30c9\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u305b\u3093 @@ -195,6 +198,10 @@ TagsNode.displayName.text=\u30bf\u30b0 TagsNode.createSheet.name.name=\u540d\u524d AbstractAbstractFileNode.flagsDirColLbl=\u30d5\u30e9\u30b0\uff08\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff09 AbstractAbstractFileNode.flagsMetaColLbl=\u30d5\u30e9\u30b0\uff08\u30e1\u30bf\u30c7\u30fc\u30bf\uff09 +AbstractAbstractFileNode.metaAddrColLbl=\u30e1\u30bf\u30c7\u30fc\u30bf\u30a2\u30c9\u30ec\u30b9 +AbstractAbstractFileNode.attrAddrColLbl=\u5c5e\u6027\u30a2\u30c9\u30ec\u30b9 +AbstractAbstractFileNode.typeDirColLbl=\u30bf\u30a4\u30d7\uff08\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff09 +AbstractAbstractFileNode.typeMetaColLbl=\u30bf\u30a4\u30d7\uff08\u30e1\u30bf\u30c7\u30fc\u30bf\uff09 ArtifactTypeNode.createSheet.childCnt.displayName=\u30c1\u30e3\u30a4\u30eb\u30c9\u6570 TagsNode.createSheet.name.displayName=\u540d\u524d ViewsNode.name.text=\u30d3\u30e5\u30fc @@ -231,6 +238,7 @@ KeywordHits.createSheet.numChildren.name=\u30c1\u30e3\u30a4\u30eb\u30c9\u6570 KeywordHits.createSheet.numChildren.displayName=\u30c1\u30e3\u30a4\u30eb\u30c9\u6570 KeywordHits.simpleLiteralSearch.text=\u30b7\u30f3\u30b0\u30eb\u30ea\u30c6\u30e9\u30eb\u691c\u7d22 KeywordHits.singleRegexSearch.text=\u30b7\u30f3\u30b0\u30eb\u6b63\u898f\u8868\u73fe\u691c\u7d22 +AbstractAbstractFileNode.objectId=\u30aa\u30d6\u30b8\u30a7\u30af\u30c8ID ArtifactStringContent.getStr.artifactId.text=\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8ID OpenReportAction.actionDisplayName=\u30ec\u30dd\u30fc\u30c8\u3092\u958b\u304f OpenReportAction.actionPerformed.MessageBoxTitle=\u5931\u6557\u30ec\u30dd\u30fc\u30c8\u3092\u958b\u304f