Reputation: 564
We are trying to get All the properties inside the Worklight server using Java code running on the server.
Worklight Version 6.2.0.1
Based on the following URL:
I'm trying to use getAllProperties() API. However, I'm not getting it inside the code:
I imported java.util.Properties;
try{
Properties p = new Properties();
p.getAllProperties(); // This doesn't exist
.
.
}
Am I doing it wrong or missing something.? How can I read all the properties inside Worklight based on IBM URL mentioned above?
Upvotes: 0
Views: 97
Reputation: 8215
If I got your problem correctly, the class WorklightConfiguration
provides a method called getAllProperties()
wich returns an instance of Properties
. You haven't provided any code in your question, but a this code example might help you (disclaimer: I have never used Worklight before, so this might need some adjustments, but you'll get the idea):
WorklightConfiguration config = WorklightConfiguration.getInstance ();
Properties properties = config.getAllProperties ();
for (String propertyName: properties.propertyNames ()) {
String property = properties.getProperty (propertyName);
// rest of implementation...
}
Upvotes: 2