protected void deleteProp(final String name) { // Only one thread should be writing to the file system at once. synchronized (propertiesLock) { // Create the properties object if necessary. if (properties == null) { loadProps(); } properties.remove(name); saveProps(); } }
protected Enumeration propNames() { // If properties aren't loaded yet. We also need to make this thread // safe, so synchronize... if (properties == null) { synchronized (propertiesLock) { // Need an additional check if (properties == null) { loadProps(); } } } return properties.propertyNames(); }
/** * Gets a enet property. enet properties are stored in enet.properties. The properties file should * be accesible from the classpath. Additionally, it should have a path field that gives the full * path to where the file is located. Getting properties is a fast operation. * * @param name the name of the property to get. * @return the property specified by name. */ protected String getProp(final String name) { // If properties aren't loaded yet. We also need to make this thread // safe, so synchronize... if (properties == null) { synchronized (propertiesLock) { // Need an additional check if (properties == null) { loadProps(); } } } final String property = properties.getProperty(name); if (property == null) { return null; } else { return property.trim(); } }