Package org.apache.sling.launchpad.base.shared

# Class Util

java.lang.Object
org.apache.sling.launchpad.base.shared.Util

public final class Util extends Object
The `Util` class provides general shared utilities.

## Method Summary

Modifier and Type
Method
Description
`static String`
`substVars(String val, String currentKey, Map<String,String> cycleMap, Map<String,String> configProps)`
This method performs property variable substitution on the specified value.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### substVars

public static String substVars(String val, String currentKey, Map<String,String> cycleMap, Map<String,String> configProps) throws IllegalArgumentException
This method performs property variable substitution on the specified value. If the specified value contains the syntax ${<prop-name>}, where <prop-name> refers to either a configuration property or a system property, then the corresponding property value is substituted for the variable placeholder. Multiple variable placeholders may exist in the specified value as well as nested variable placeholders, which are substituted from inner most to outer most. Configuration properties override system properties.

Parameters:
  `val` - The string on which to perform property substitution.
  `currentKey` - The key of the property being evaluated used to detect cycles.
  `cycleMap` - Map of variable references used to detect nested cycles.
  `configProps` - Set of configuration properties.
Returns:
  The value of the specified string after system property substitution.
Throws:
  `IllegalArgumentException` - If there was a syntax error in the property placeholder syntax or a recursive variable reference.