@Override public Object remove(Object key) { return storage.remove(key); }
@Override public Object remove(Object key) { return storage.remove(key); }
@Override public Object remove(Object key) { return storage.remove(key); }
/** * Delete a User. * * @param username */ public void deleteUser(String username) { users.remove(username); try { users.save(); } catch (Exception ex) { LOGGER.error("Cannot remove users file,", ex); } }
public void setFrameworkDebug(boolean debug) { try { Properties properties = loadProps(); if (debug) { properties.put("felix.log.level", "4"); properties.put("osgi.debug", "etc/equinox-debug.properties"); } else { properties.remove("felix.log.level"); properties.remove("osgi.debug"); } // TODO populate the equinox-debug.properties file with the one provided in shell/dev module properties.save(); } catch (IOException e) { throw new RuntimeException("Error setting framework debugging: " + e.getMessage(), e); } }
public void setFrameworkDebug(boolean debug) { try { Properties properties = loadProps(); if (debug) { properties.put("felix.log.level", "4"); properties.put("osgi.debug", "etc/equinox-debug.properties"); } else { properties.remove("felix.log.level"); properties.remove("osgi.debug"); } // TODO populate the equinox-debug.properties file with the one provided in shell/dev module properties.save(); } catch (IOException e) { throw new RuntimeException("Error setting framework debugging: " + e.getMessage(), e); } }
private static void loadIncludes(String propertyName, boolean mandatory, URL configPropURL, Properties configProps) throws Exception { String includes = configProps.get(propertyName); if (includes != null) { StringTokenizer st = new StringTokenizer(includes, "\" ", true); if (st.countTokens() > 0) { String location; do { location = nextLocation(st); if (location != null) { URL url = new URL(configPropURL, location); Properties props = loadPropertiesFile(url, mandatory); configProps.putAll(props); } } while (location != null); } } configProps.remove(propertyName); }
@Override public void deleteUser(String username) { // delete all its groups first, for garbage collection of the groups for (GroupPrincipal gp : listGroups(username)) { deleteGroup(username, gp.getName()); } users.remove(username); try { users.save(); } catch (Exception ex) { LOGGER.error("Cannot remove users file,", ex); } }
@Override public void deleteUser(String username) { // delete all its groups first, for garbage collection of the groups for (GroupPrincipal gp : listGroups(username)) { deleteGroup(username, gp.getName()); } users.remove(username); try { users.save(); } catch (Exception ex) { LOGGER.error("Cannot remove users file,", ex); } }
@Override public void deleteUser(String username) { // delete all its groups first, for garbage collection of the groups for (GroupPrincipal gp : listGroups(username)) { deleteGroup(username, gp.getName()); } users.remove(username); try { users.save(); } catch (Exception ex) { LOGGER.error("Cannot remove users file,", ex); } }
@Override public void deleteUser(String username) { // delete all its groups first, for garbage collection of the groups for (GroupPrincipal gp : listGroups(username)) { deleteGroup(username, gp.getName()); } users.remove(username); try { users.save(); } catch (Exception ex) { LOGGER.error("Cannot remove users file,", ex); } }
public static void setProperties(CuratorFramework curator, String path, Properties properties) throws Exception { try { org.apache.felix.utils.properties.Properties p = new org.apache.felix.utils.properties.Properties(); if(curator.checkExists().forPath(path) == null){ create(curator, path); } String org = getStringData(curator, path); if (org != null) { p.load(new StringReader(org)); } List<String> keys = new ArrayList<String>(); for (String key : properties.stringPropertyNames()) { p.put(key, properties.getProperty(key)); keys.add(key); } List<String> deleted = new ArrayList<String>(p.keySet()); deleted.removeAll(keys); for (String key : deleted) { p.remove(key); } StringWriter writer = new StringWriter(); p.save(writer); setData(curator, path, writer.toString()); } catch (IOException e) { // ignore } }
users.remove(user); user = user.replace("\\", "\\\\");
public static void setProperties(CuratorFramework curator, String path, Properties properties) throws Exception { try { org.apache.felix.utils.properties.Properties p = new org.apache.felix.utils.properties.Properties(); if(curator.checkExists().forPath(path) == null){ create(curator, path); } String org = getStringData(curator, path); if (org != null) { p.load(new StringReader(org)); } List<String> keys = new ArrayList<String>(); for (String key : properties.stringPropertyNames()) { p.put(key, properties.getProperty(key)); keys.add(key); } List<String> deleted = new ArrayList<String>(p.keySet()); deleted.removeAll(keys); for (String key : deleted) { p.remove(key); } StringWriter writer = new StringWriter(); p.save(writer); setData(curator, path, writer.toString()); } catch (IOException e) { // ignore } }
users.remove(user); user = user.replace("\\", "\\\\");
public boolean update(Properties properties) { boolean modified = false; // Remove "removed" properties from the cfg file for (String key : new ArrayList<String>(this.keySet())) { if (!properties.containsKey(key)) { this.remove(key); modified = true; } } // Update existing keys for (String key : properties.keySet()) { String v = this.get(key); List<String> comments = properties.getComments(key); List<String> value = properties.getRaw(key); if (v == null) { this.put(key, comments, value); modified = true; } else if (!v.equals(properties.get(key))) { if (comments.isEmpty()) { comments = this.getComments(key); } this.put(key, comments, value); modified = true; } } return modified; }
public boolean update(Properties properties) { boolean modified = false; // Remove "removed" properties from the cfg file for (String key : new ArrayList<String>(this.keySet())) { if (!properties.containsKey(key)) { this.remove(key); modified = true; } } // Update existing keys for (String key : properties.keySet()) { String v = this.get(key); List<String> comments = properties.getComments(key); List<String> value = properties.getRaw(key); if (v == null) { this.put(key, comments, value); modified = true; } else if (!v.equals(properties.get(key))) { if (comments.isEmpty()) { comments = this.getComments(key); } this.put(key, comments, value); modified = true; } } return modified; }
public boolean update(Properties properties) { boolean modified = false; // Remove "removed" properties from the cfg file for (String key : new ArrayList<String>(this.keySet())) { if (!properties.containsKey(key)) { this.remove(key); modified = true; } } // Update existing keys for (String key : properties.keySet()) { String v = this.get(key); List<String> comments = properties.getComments(key); List<String> value = properties.getRaw(key); if (v == null) { this.put(key, comments, value); modified = true; } else if (!v.equals(properties.get(key))) { if (comments.isEmpty()) { comments = this.getComments(key); } this.put(key, comments, value); modified = true; } } return modified; }