Skip to content

Instantly share code, notes, and snippets.

@fwilhe
Created September 27, 2015 06:34
Show Gist options
  • Save fwilhe/35b755c2b1e243fc70a9 to your computer and use it in GitHub Desktop.
Save fwilhe/35b755c2b1e243fc70a9 to your computer and use it in GitHub Desktop.
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