|
eXo Kernel :: Container 2.4.13-GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.container.util.TemplateConfigurationHelper
public class TemplateConfigurationHelper
Builds configuration from template using map of template-variables <--> value. Class provides extra functionality for filtering parameters by pattern, excluding unnecessary parameters.
| Constructor Summary | |
|---|---|
TemplateConfigurationHelper(String[] includes,
String[] excludes,
ConfigurationManager cfm)
Creates instance of template configuration helper with given lists of filtering patterns. |
|
| Method Summary | |
|---|---|
InputStream |
fillTemplate(InputStream inputStream,
Map<String,String> parameters)
Reads configuration file from a stream and replaces all the occurrences of template-variables (like : "${parameter.name}") with values provided in the map. |
InputStream |
fillTemplate(String filename,
Map<String,String> parameters)
Reads configuration file from a stream and replaces all the occurrences of template-variables (like : "${parameter.name}") with values provided in the map. |
static InputStream |
getInputStream(ConfigurationManager cfm,
String filename)
Tries first to get the file content using the configuration manager, if it cannot be found it will then try to get it from the context class loader of the current thread, if it cannot be found it will try to get it from the class loader of the current class and finally it still cannot be found it will try to use the file name as a file path. |
protected Map<String,String> |
prepareParameters(Map<String,String> parameters)
Filters the map of parameters, leaving only those than matches filtering regular expressions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TemplateConfigurationHelper(String[] includes,
String[] excludes,
ConfigurationManager cfm)
includes - Array with string representation of include reg-exp patternsexcludes - Array with string representation of exclude reg-exp patternsConfigurationManager - instance for looking up resources| Method Detail |
|---|
public InputStream fillTemplate(InputStream inputStream,
Map<String,String> parameters)
throws IOException
inputStream - parameters -
IOException
public InputStream fillTemplate(String filename,
Map<String,String> parameters)
throws IOException
filename - parameters -
IOException
public static InputStream getInputStream(ConfigurationManager cfm,
String filename)
cfm - the configuration manager from which we want to try to find the file contentfilename - the name of the file to found
InputStream corresponding to the file content if it can be found
null otherwiseprotected Map<String,String> prepareParameters(Map<String,String> parameters)
parameters -
|
eXo Kernel :: Container 2.4.13-GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||