public void storeRules(String targetFolder, List<Rule> rules) {
        resources.computeResource(PUBLIC_RULES, body -> {
            Map<String, List<Rule>> rulesMap = decodeRules(body);
            List<Rule> previous = rulesMap.put(targetFolder, rules);
            return (rules.equals(previous)) ? body : encodeRules(rulesMap);
        });
    }
Key is updated time from the metadata. Value is decoded map (folder path, list of rules).
server/src/main/java/com/epam/aidial/core/server/service/RuleService.java