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();

        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Properties myProps2 = new Properties();
        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

        testProps.put(LNAME_KEY, LNAME);
        testProps.put(EMAIL_KEY, EMAIL);
        testProps.put("existing.prop", "37");
     
        FileOutputStream fos = new FileOutputStream(testPropsFilePath);
        testProps.save(fos, "defaults");
        fos.close();
    }


    private void initBuildPropFile() throws Exception {
View Full Code Here

        buildProps.put(PHONE_KEY, NEW_PHONE);
        buildProps.put(AGE_KEY, NEW_AGE);
        buildProps.put(DATE_KEY, NEW_DATE);
     
        FileOutputStream fos = new FileOutputStream(buildPropsFilePath);
        buildProps.save(fos, null);
        fos.close();
    }


    private void destroyTempFiles() {
View Full Code Here

  props.put(Constants.Response.TestClass,
      this.getClass().getName());
 
  //try {
  //this used to be props.store, but that was not JDK 1.1 compliant
  props.save(sos, this.getClass().getName());  
  //} catch (IOException ioe) {
  //System.out.println(this.getClass().getName() +
  //   " exception: " + ioe);
  //}
    }
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

    // Save properties
    try {
      reset();

      FileOutputStream out = new FileOutputStream(AppletViewer.theUserPropertiesFile);
      props.save(out, "AppletViewer");
      out.close();
      setVisible( false );
    } catch (IOException e) {
            System.out.println(amh.getMessage("apply.exception", e));
      e.printStackTrace();
View Full Code Here

                if (!parentFile.exists()) {
                    FileUtils.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

        try {
            output = new FileOutputStream(m_file);

            final String header = "Build Number for ANT. Do not edit!";

            properties.save(output, header);
        } catch (final IOException ioe) {
            final String message = "Error while writing " + m_file;

            throw new BuildException(message, ioe);
        } finally {
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

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.