[MAGNOLIA-6434] Make list of excluded resource directories in FileSystemResourceOrigin configurable Created: 31/Aug/15  Updated: 15/Jul/22  Resolved: 08/Feb/16

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 5.4.5

Type: Improvement Priority: Neutral
Reporter: Edgar Vonk Assignee: Ilgun Ilgun
Resolution: Fixed Votes: 2
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
causality
relation
is related to MAGNOLIA-6681 Do not log INFO messages about modifi... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Date of First Response:
Epic Link: Resource reloading without restart
Sprint: Basel 30
Story Points: 3

 Description   

As reported in SUPPORT-4979 we have an issue that the file-based resource loader currently loads a lot of stuff we don't want it to like our 'mgnl-bootstrap' folder. We really need the list of excluded directories to be made configurable.

The issue is in the FileSystemResourceOrigin class where the list of excluded directories is currently hardcoded:

   /**
     * TODO: The current implementation makes assumptions about what directories to excludes;
     * Except for META-INF and WEB-INF, the others are highly installation dependent. We could probably use system properties
     * and/or make this configurable.
     */
    protected ExclusionsFilter buildExclusionsFilter() {
        return new ExclusionsFilter(rootPath, EXCLUDED_DIRECTORIES, Collections.<String>emptyList(), Collections.<String>emptyList());
    }

Solution

Decided to expose this directories in properties file with name:
magnolia.resources.filesystem.observation.excludedDirectories

It is commented by default and once one uncomments it, we would expect to have a present value in it for activating that property.
Also It should be known that, this property values are trimmed which means that having a exclusion value with path ' bar ',
will be filtering bar folder


Generated at Mon Feb 12 04:14:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.