Question

How do I exclude the modeshape files when querying a FileSystemSource?

They all have jcr:createdBy 'null' but the following causes a null pointer exception when I query:

SELECT * FROM [nt:file] where [jcr:createdBy] != 'null'

This works ok:

SELECT * FROM [nt:file] where [jcr:createdBy] = '<anonymous>'

Thanks

Was it helpful?

Solution

Given a file on the file system named "foo.txt", ModeShape may place a "foo.txt.modeshape" file in the same directory. The ".modeshape" files contain the extra properties that were added to the "nt:file", "nt:folder", and "nt:resource" nodes.

Generally, your File System connector should not be exposing such files to the JCR repository. If it is, then you've likely misconfigured the "extraPropertiesBehavior" setting on the connector. For details, see the connector documentation for ModeShape 2.8. (Note that if you're using a custom properties factory, then you need to set the "exclusionFilter" to ignore the ".modeshape" files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top