@Override public void storeToXml(Properties props, OutputStream os, String header, String encoding) throws IOException { props.storeToXML(os, header, encoding); }
@Override public void storeToXml(Properties props, OutputStream os, String header) throws IOException { props.storeToXML(os, header); }
@Override public void storeToXml(Properties props, OutputStream os, String header) throws IOException { props.storeToXML(os, header); }
@Override public void storeToXml(Properties props, OutputStream os, String header, String encoding) throws IOException { props.storeToXML(os, header, encoding); }
@Override public void storeToXML(OutputStream os, String comment) throws IOException { if (interned != null) interned.storeToXML(os, comment); else super.storeToXML(os, comment); }
@Override public void storeToXML(OutputStream os, String comment, String encoding) throws IOException { if (interned != null) interned.storeToXML(os, comment, encoding); else super.storeToXML(os, comment, encoding); }
public void storeToXML(OutputStream os, String comment, String encoding) throws IOException { delegate.storeToXML(os, comment, encoding); }
public void storeToXML(OutputStream os, String comment) throws IOException { delegate.storeToXML(os, comment); }
public void flush () { OutputStream out = null; try { out = new BufferedOutputStream(new FileOutputStream(file)); properties.storeToXML(out, null); } catch (Exception ex) { throw new RuntimeException("Error writing preferences: " + file, ex); } finally { if (out != null) try { out.close(); } catch (IOException e) { } } }
@Override public synchronized void storeToXML( OutputStream os, String comment, String encoding ) throws IOException { super.putAll( storageMap ); super.storeToXML( os, comment, encoding ); super.clear(); }
@Override public synchronized void storeToXML( OutputStream os, String comment ) throws IOException { super.putAll( storageMap ); super.storeToXML( os, comment ); super.clear(); }
@Override public void flush () { OutputStream out = null; try { out = new BufferedOutputStream(file.write(false)); properties.storeToXML(out, null); } catch (Exception ex) { throw new GdxRuntimeException("Error writing preferences: " + file, ex); } finally { StreamUtils.closeQuietly(out); } }
@Override public void flush () { OutputStream out = null; try { out = new BufferedOutputStream(file.write(false)); properties.storeToXML(out, null); } catch (Exception ex) { throw new GdxRuntimeException("Error writing preferences: " + file, ex); } finally { StreamUtils.closeQuietly(out); } }
@Override public void flush () { OutputStream out = null; try { out = new BufferedOutputStream(file.write(false)); properties.storeToXML(out, null); } catch (Exception ex) { throw new GdxRuntimeException("Error writing preferences: " + file, ex); } finally { StreamUtils.closeQuietly(out); } }
@Override public void flush () { OutputStream out = null; try { out = new BufferedOutputStream(file.write(false)); properties.storeToXML(out, null); } catch (Exception ex) { throw new GdxRuntimeException("Error writing preferences: " + file, ex); } finally { StreamUtils.closeQuietly(out); } }
@Override WebResult generateBody( HttpServletRequest request, HttpServletResponse response, boolean useXML ) throws Exception { ServletOutputStream out = response.getOutputStream(); Properties kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); ByteArrayOutputStream os = new ByteArrayOutputStream(); if ( useXML ) { kettleProperties.storeToXML( os, "" ); } else { kettleProperties.store( os, "" ); } out.write( Encr.encryptPassword( os.toString() ).getBytes() ); return null; }
@Override public void flush () { OutputStream out = null; try { out = new BufferedOutputStream(file.write(false)); properties.storeToXML(out, null); } catch (Exception ex) { throw new GdxRuntimeException("Error writing preferences: " + file, ex); } finally { StreamUtils.closeQuietly(out); } }
@Override public void flush () { OutputStream out = null; try { out = new BufferedOutputStream(file.write(false)); properties.storeToXML(out, null); } catch (Exception ex) { throw new GdxRuntimeException("Error writing preferences: " + file, ex); } finally { StreamUtils.closeQuietly(out); } }
Properties props = new Properties() { @Override public Set<Object> keySet(){ return Collections.unmodifiableSet(new TreeSet<Object>(super.keySet())); } @Override public synchronized Enumeration<Object> keys() { return Collections.enumeration(new TreeSet<Object>(super.keySet())); } }; props.put("B", "Should come second"); props.put("A", "Should come first"); props.storeToXML(new FileOutputStream(new File("sortedProps.xml")), null); props.store(new FileOutputStream(new File("sortedProps.properties")), null);
String propFile = "/path/to/file"; Properties props = new Properties(); /*set some properties here*/ Properties tmp = new Properties() { @Override public Set<Object> keySet() { return Collections.unmodifiableSet(new TreeSet<Object>(super.keySet())); } }; tmp.putAll(props); try { FileOutputStream xmlStream = new FileOutputStream(propFile); /*this comes out SORTED! */ tmp.storeToXML(xmlStream,""); } catch (IOException e) { e.printStackTrace(); }