package biz.netcentric.cq.tools.actool.configreader;

import java.util.Collection;
import java.util.Map;

import javax.jcr.Session;

import org.apache.jackrabbit.vault.fs.io.Archive;

/** Retrieves the contents of a AC tool yaml config file from either a package directly (used by install hook) or from the JCR node structure
 * (used by JMX). Both methods return a map with filename-&gt;yaml-config-content entries.
 *
 * @author ghenzler */
public interface ConfigFilesRetriever {

    /** Returns yaml configurations using a given root node. This will only return configuration entries which apply to the current run
     * mode.
     *
     * @param rootPath the root path in the JCR to start looking for yaml-files
     * @param session
     * @return map of yaml configurations by their path location
     * @throws Exception if things go wrong */
    Map<String, String> getConfigFileContentFromNode(String rootPath, Session session) throws Exception;

    /** Returns yaml configurations from a package.  This will only return configuration entries which apply to the current run mode
     *
     * @param archive the Vault Package
     * @param configFilePaths regular expression to limit the paths where configuration files are looked
     * @return map of yaml configurations by their path location
     * @throws Exception if things go wrong */
    Map<String, String> getConfigFileContentFromPackage(Archive archive, Collection<String> configFilePaths) throws Exception;

}

@@ -1160,18 +1160,35 @@
 gFilePat
-hs
+terns collection of
  regular
@@ -1212,23 +1212,13 @@
 mit 
-the paths where
+which
  con
@@ -1242,14 +1242,13 @@
 are 
-look
+us
 ed
+.
 %0A   
@@ -1461,17 +1461,20 @@
 gFilePat
-h
+tern
 s) throw

rename parameter configFilePatterns in ConfigFileRetriever interface