Created
September 27, 2015 06:34
-
-
Save fwilhe/35b755c2b1e243fc70a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def namespaces = ["org.osiam.resource-server", "org.osiam.auth-server", "org.osiam.self-administration"] | |
def properties = new Properties() | |
new File("../resource-server.properties").withInputStream { | |
properties.load(it) | |
} | |
private String propertyNameWithoutNamespace(String propertyName, String fullyQualifiedNamespace) { | |
propertyName.substring(fullyQualifiedNamespace.length() + 1, propertyName.length()) | |
} | |
properties.propertyNames().each { String propertyName -> | |
namespaces.each { fullyQualifiedNamespace -> | |
if (propertyName.startsWith(fullyQualifiedNamespace)) { | |
println(fullyQualifiedNamespace + ":") | |
print(" " + propertyNameWithoutNamespace(propertyName, fullyQualifiedNamespace) + ":") | |
println " " + properties.getProperty(propertyName) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment