Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to find the string which begins with the exact word
    text
    copied!<p>I have an app with GUI on gwt. using this gui I'd like to change(and this is the subquestion: how this would be better to change the .properties file(I know how to read properties from them using <code>org.apache.commons.configuration</code>, but don't know how to edit(as string or how...))) the .properties file. for example: I've written the following .properties file:</p> <pre><code>################################################################################ # User permissions # ################################################################################ users = admin, root, guest users.admin.keywords = admin users.admin.regexps = test-5, test-7 users.root.keywords = root users.root.regexps = * users.guest.keywords = guest users.guest.regexps = * </code></pre> <p>and so, how to add <code>keywords</code> for admin, for example?</p> <p><strong>UPD:</strong> here is my working with config class in which I want to change config file:</p> <pre><code> public class Config { private static final Config ourInstance = new Config(); private static final CompositeConfiguration prop = new CompositeConfiguration(); public static Config getInstance() { return ourInstance; } public Config(){ } public synchronized void load() { try { prop.addConfiguration(new SystemConfiguration()); System.out.println("Loading /rules.properties"); final PropertiesConfiguration p = new PropertiesConfiguration(); p.setPath("/home/mikhail/bzrrep/DLP/DLPServer/src/main/resources/rules.properties"); p.load(); prop.addConfiguration(p); } catch (ConfigurationException e) { e.printStackTrace(); } final int processors = prop.getInt("server.processors", 1); // If you don't see this line - likely config name is wrong System.out.println("Using processors:" + processors); } public void setKeyword(String customerId, String keyword){ prop.setProperty("users." + customerId + ".keywords", prop.getProperty("users." + customerId + ".keywords") + ", " + keyword); prop. } public void setRegexp(String customerId, String regexp) {} } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload