Package java.util

Examples of java.util.Properties.save()


        myProps.setProperty("Property A", "aye");
        myProps.setProperty("Property B", "bee");
        myProps.setProperty("Property C", "see");

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        myProps.save(out, "A Header");
        out.close();

        Properties myProps2 = new Properties();
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        myProps2.load(in);
View Full Code Here


            if( requiredSecret !=null ) {
                props.put( "secret", requiredSecret );
            }

            FileOutputStream stopF=new FileOutputStream( sf );
            props.save( stopF, "Automatically generated, don't edit" );
        } catch( IOException ex ) {
            log.debug( "Can't create stop file: "+sf );
            ex.printStackTrace();
        }
    }
View Full Code Here

                if (!parentFile.exists()) {
                    forceMkdir(parentFile);
                }
                OutputStream out = new FileOutputStream(historyFile);
                try {
                    properties.save(out, "All the plugins that have ever been installed on this server");
                } finally {
                    out.close();
                }
            } catch (IOException e) {
                //give up
View Full Code Here

    p.put("chunk", "" + chunksize);
    p.put("chunksize", "" + chunksize);
    p.put("overlap""" + overlap);

    p.save(out, header);
      }

      /**
       * load a properties representation of the object, then
       * create the object from it.
View Full Code Here

            if( requiredSecret !=null ) {
                props.put( "secret", requiredSecret );
            }

            FileOutputStream stopF=new FileOutputStream( sf );
            props.save( stopF, "Automatically generated, don't edit" );
        } catch( IOException ex ) {
            log.debug( "Can't create stop file: "+sf );
            ex.printStackTrace();
        }
    }
View Full Code Here

    aliasFile = File.createTempFile("test", ".properties");
    aliasFile.deleteOnExit();
    Properties aliases = new Properties();
    aliases.setProperty("urn:alias:x", "urn:a:x");
    FileOutputStream out = new FileOutputStream(aliasFile);
    aliases.save(out, "Temporary properties");
    out.close();

    a1 = new TestContext("urn:a");
    a2 = new TestContext("urn:a");
    b = new TestContext("urn:b");
View Full Code Here

        myProps.setProperty("Property A", "aye");
        myProps.setProperty("Property B", "bee");
        myProps.setProperty("Property C", "see");

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        myProps.save(out, "A Header");
        out.close();

        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Properties myProps2 = new Properties();
        myProps2.load(in);
View Full Code Here

            String username = users.getString(1);
            String passphrase = users.getString(2);
            newprops.put(username, passphrase);
        }
        FileOutputStream fos = new FileOutputStream(fileName);
        newprops.save(fos, "Generated by Roller Password Utility");
        fos.close();
    }

    /**
     * Encrypt all passwords in rolleruser and turn ON encryption flag in rollerconfig
View Full Code Here

            if (user != null) {
                tag = "; customized for " + user;
                properties.save(os, filePreamble + tag);
            }
            else {
                properties.save(os, filePreamble);
            }
        }
        catch (IOException e) {
            e.printStackTrace();
            return false;
View Full Code Here

            if( requiredSecret !=null ) {
                props.put( "secret", requiredSecret );
            }

            FileOutputStream stopF=new FileOutputStream( sf );
            props.save( stopF, "Automatically generated, don't edit" );
        } catch( IOException ex ) {
            log.debug( "Can't create stop file: "+sf );
            ex.printStackTrace();
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.