-
Enhancement
-
Resolution: Done
-
Major
-
4.3.0.Final
-
None
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.