/** * Store a properties into a output stream, preserving comments, special character, etc. * This method is mainly to be compatible with the java.util.Properties class. * * @param os an output stream. * @param comment this parameter is ignored as this Properties * @throws IOException If storing fails */ public void store(OutputStream os, String comment) throws IOException { this.save(os); }
/** * Store a properties into a output stream, preserving comments, special character, etc. * This method is mainly to be compatible with the java.util.Properties class. * * @param os an output stream. * @param comment this parameter is ignored as this Properties * @throws IOException If storing fails */ public void store(OutputStream os, String comment) throws IOException { this.save(os); }
/** * Store a properties into a output stream, preserving comments, special character, etc. * This method is mainly to be compatible with the java.util.Properties class. * * @param os an output stream. * @param comment this parameter is ignored as this Properties * @throws IOException */ public void store(OutputStream os, String comment) throws IOException { this.save(os); }
/** * Store a properties into a output stream, preserving comments, special character, etc. * This method is mainly to be compatible with the java.util.Properties class. * * @param os an output stream. * @param comment this parameter is ignored as this Properties * @throws IOException If storing fails */ public void store(OutputStream os, String comment) throws IOException { this.save(os); }
private void saveUserProperties() { try { ((Properties)users).save(); } catch (Exception ex) { LOGGER.error("Cannot update users file,", ex); } }
public void save(OutputStream os) throws IOException { save(new OutputStreamWriter(os, DEFAULT_ENCODING)); }
public void save(File location) throws IOException { OutputStream os = new FileOutputStream(location); try { save(os); } finally { os.close(); } }
public void save(File location) throws IOException { OutputStream os = new FileOutputStream(location); try { save(os); } finally { os.close(); } }
public void save(File location) throws IOException { OutputStream os = new FileOutputStream(location); try { save(os); } finally { os.close(); } }
public void save(File location) throws IOException { OutputStream os = new FileOutputStream(location); try { save(os); } finally { os.close(); } }
public static byte[] toBytes(Properties source) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { source.save(baos); } catch (IOException ex) { throw new IllegalArgumentException("Cannot store properties", ex); } return baos.toByteArray(); }
public static byte[] toBytes(Properties source) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { source.save(baos); } catch (IOException ex) { throw new IllegalArgumentException("Cannot store properties", ex); } return baos.toByteArray(); }
private void markCreated(BundleContext bundleContext) throws IOException { File marker = new File(dataDir, ENSEMBLE_MARKER); if (!marker.exists() && !marker.getParentFile().exists() && !marker.getParentFile().mkdirs()) { throw new IOException("Cannot create marker file"); } org.apache.felix.utils.properties.Properties props = new org.apache.felix.utils.properties.Properties(marker); props.put("created", "true"); props.save(); }
@Override public void write(OutputStream out, Dictionary<String, Object> inputDictionary) throws IOException { notNull(out, "Output stream cannot be null"); notNull(inputDictionary, "Properties cannot be null"); final Properties props = new Properties(); final Enumeration<String> keys = inputDictionary.keys(); while (keys.hasMoreElements()) { String key = keys.nextElement(); props.put(key, inputDictionary.get(key).toString()); } props.save(out); }
private void markCreated(BundleContext bundleContext) throws IOException { File marker = new File(dataDir, ENSEMBLE_MARKER); if (!marker.exists() && !marker.getParentFile().exists() && !marker.getParentFile().mkdirs()) { throw new IOException("Cannot create marker file"); } org.apache.felix.utils.properties.Properties props = new org.apache.felix.utils.properties.Properties(marker); props.put("created", "true"); props.save(); }
public void setFramework(FrameworkType framework) { if (framework == null) { return; } try { Properties properties = loadProps(); properties.put("karaf.framework", framework.name()); properties.save(); } catch (IOException e) { throw new RuntimeException("Error setting framework: " + e.getMessage(), e); } }
public void setFramework(FrameworkType framework) { if (framework == null) { return; } try { Properties properties = loadProps(); properties.put("karaf.framework", framework.name()); properties.save(); } catch (IOException e) { throw new RuntimeException("Error setting framework: " + e.getMessage(), e); } }
@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); } }