Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2489

Make mime-type detection configurable allowing either no detection, name or content-based detection


    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.3.0.Final
    • Fix Version/s: 4.4.0.Final
    • Component/s: Performance
    • Labels:


      ModeShape has a built-in TikaMimeTypeDetector which, when adding a binary into the repository if the node which owns the binary property is mix:mimetype, will automatically trigger a full (content based) mime type detection process. This content based detection process means that each such binary will have its content read into memory each time a new binary value is added.

      This is a nice feature which could prove useful in some cases, but when working with lots and/or large binaries can be extremely ineffective.

      There may be other cases when users using the default [nt:resource] type (or other mix:mimetype) nodes are well-enough off using the actual name of the file as the name of the node. In other words, there may be cases where using the name + extension of the file is enough information which can be used without having to read the full content of the binary.

      This enhancement is about changing the repository configuration allowing users to choose between no mimetype detection, content or name based detection.

      For example:

      repository {
        binaryStorage: {
          "mimeTypeDetection" : ["content", "name", "none"]   

      where the default value is content to preserve the current functionality as is.

        Gliffy Diagrams




              • Assignee:
                hchiorean Horia Chiorean
                hchiorean Horia Chiorean
              • Votes:
                1 Vote for this issue
                3 Start watching this issue


                • Created: