macOS 10.13.4 Finder 将某些 .java 文件的 kMDItemKind 显示为“源代码”,但将其他 .java 文件的 kMDItemKind 显示为“Java 源代码”

macOS 10.13.4 Finder 将某些 .java 文件的 kMDItemKind 显示为“源代码”,但将其他 .java 文件的 kMDItemKind 显示为“Java 源代码”

在 macOS 10.13.4 上,对于某些.java文件,Finder 显示"Java Source"kMDItemKind即“列表”视图中的“类型”列),但对于其他某些文件,即使在同一文件夹中,.java它也会显示。"Source Code"

我如何确保所有.java文件都具有一致性 kMDItemKind = "Java Source"

mdls以下是显示的文件的输出"Java Source"

kMDItemContentCreationDate             = 2017-08-08 08:51:42 +0000
kMDItemContentCreationDate_Ranking     = 2017-08-08 00:00:00 +0000
kMDItemContentModificationDate         = 2017-08-08 08:51:42 +0000
kMDItemContentType                     = "com.sun.java-source"
kMDItemContentTypeTree                 = (
    "com.sun.java-source",
    "public.source-code",
    "public.data",
    "public.plain-text",
    "public.item",
    "public.content",
    "public.text",
    "com.sun.java-source"
)
kMDItemDateAdded                       = 2018-02-04 06:16:53 +0000
kMDItemDateAdded_Ranking               = 2018-02-04 00:00:00 +0000
kMDItemDisplayName                     = "A.java"
kMDItemFSContentChangeDate             = 2017-08-08 08:51:42 +0000
kMDItemFSCreationDate                  = 2017-08-08 08:51:42 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = (null)
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = (null)
kMDItemFSLabel                         = 0
kMDItemFSName                          = "A.java"
kMDItemFSNodeCount                     = (null)
kMDItemFSOwnerGroupID                  = 20
kMDItemFSOwnerUserID                   = 501
kMDItemFSSize                          = 442
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2017-08-08 00:00:00 +0000
kMDItemInterestingDate_RankingRepaired = 1
kMDItemKind                            = "Java Source"
kMDItemLogicalSize                     = 442
kMDItemPhysicalSize                    = 4096

mdls这是与上一个文件位于同一文件夹中的文件的输出,但显示的内容"Source Code"如下:

kMDItemContentCreationDate         = 2018-04-02 09:09:37 +0000
kMDItemContentCreationDate_Ranking = 2018-04-02 00:00:00 +0000
kMDItemContentModificationDate     = 2018-04-02 09:09:37 +0000
kMDItemContentType                 = "com.sun.java-source"
kMDItemContentTypeTree             = (
    "com.sun.java-source",
    "public.source-code",
    "public.data",
    "public.plain-text",
    "public.item",
    "public.content",
    "public.text",
    "com.sun.java-source"
)
kMDItemDateAdded                   = 2018-04-02 09:09:37 +0000
kMDItemDateAdded_Ranking           = 2018-04-02 00:00:00 +0000
kMDItemDisplayName                 = "B.java"
kMDItemFSContentChangeDate         = 2018-04-02 09:09:37 +0000
kMDItemFSCreationDate              = 2018-04-02 09:09:37 +0000
kMDItemFSCreatorCode               = ""
kMDItemFSFinderFlags               = 0
kMDItemFSHasCustomIcon             = (null)
kMDItemFSInvisible                 = 0
kMDItemFSIsExtensionHidden         = 0
kMDItemFSIsStationery              = (null)
kMDItemFSLabel                     = 0
kMDItemFSName                      = "B.java"
kMDItemFSNodeCount                 = (null)
kMDItemFSOwnerGroupID              = 20
kMDItemFSOwnerUserID               = 501
kMDItemFSSize                      = 5893
kMDItemFSTypeCode                  = ""
kMDItemInterestingDate_Ranking     = 2018-04-02 00:00:00 +0000
kMDItemKind                        = "Source Code"
kMDItemLogicalSize                 = 5893
kMDItemPhysicalSize                = 8192

相关内容