Package java.util

Examples of java.util.Properties.store()


                    for (int i = 0; i < count; i++) {
                        String name = props.getProperty("item." + i + ".name");
                        if (name.equals(instanceName)) {
                            props.setProperty("item." + i + ".pid", pid);
                            FileOutputStream fos = new FileOutputStream(propertiesFile);
                            props.store(fos, null);
                            fis.close();
                            fos.close();
                            return;
                        }
                    }
View Full Code Here


                    props.setProperty("item.0.name", instanceName);
                    props.setProperty("item.0.loc", karafHome.getAbsolutePath());
                    props.setProperty("item.0.pid", pid);
                    props.setProperty("item.0.root", "true");
                    FileOutputStream fos = new FileOutputStream(propertiesFile);
                    props.store(fos, null);
                    fos.close();
                }
            }
        } catch (Exception e) {
            System.err.println("Unable to update instance pid: " + e.getMessage());
View Full Code Here

            }
        }
        FileOutputStream in = new FileOutputStream(location);
        Properties properties = artifactMapToProperties(artifactMap);
        try {
            properties.store(in, COMMENT);
        } finally {
            in.close();
        }
    }
View Full Code Here

  private void sendPropInfo(DDMWriter writer) throws Exception
  {
    try {
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      Properties p = getPropertyValues();
      p.store(out, "NetworkServerControl properties");
      try {
        writeCommandReplyHeader(writer);
        writer.writeByte(0);    //O.K.
        writer.writeLDBytes(out.toByteArray());
      } catch (DRDAProtocolException e) {
View Full Code Here

            FileInputStream fis = new FileInputStream(getSqlDbMap());
            p.load(fis);
            fis.close();

            p.setProperty(getOutputFile(), db.getName());
            p.store(new FileOutputStream(getSqlDbMap()), "Sqlfile -> Database map");
        }
        catch (EngineException ee)
        {
            throw new BuildException(ee);
        }
View Full Code Here

            }

            sqldbmap.setProperty(sqlFile, databaseName);
        }

        sqldbmap.store(new FileOutputStream(getSqlDbMap()),
                "Sqlfile -> Database map");
    }

    /**
     * Create the database model necessary for the IDBroker tables.
View Full Code Here

    Properties p = new Properties();
    p.setProperty(ALIAS, PASSWORD);
    passwordFile = new File(dataDir, "keystore.pw");
    os = new FileOutputStream(passwordFile);
    try {
      p.store(os, "");
    } finally {
      os.close();
    }
  }
View Full Code Here

  private void sendPropInfo(DDMWriter writer) throws Exception
  {
    try {
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      Properties p = getPropertyValues();
      p.store(out, "NetworkServerControl properties");
      try {
        writeCommandReplyHeader(writer);
        writer.writeByte(0);    //O.K.
        writer.writeLDBytes(out.toByteArray());
      } catch (DRDAProtocolException e) {
View Full Code Here

                return new File(workingDirectory, whirrConfigFile.getName());
            } else if(whirrConfig.isSetConfiguration()){
                Properties whirrConfigProps =
                        whirrConfigurationsToProperties(whirrConfig.getConfiguration());
                File whirrConfigFile = new File(workingDirectory, "whirr-hadoop.config");
                whirrConfigProps.store(
                        new FileOutputStream(whirrConfigFile), null);

                return whirrConfigFile;
            }
        }
View Full Code Here

            Object key = e.nextElement();
            props.put(key, p.get(key));
        }
        try {
            FileOutputStream outstream = new FileOutputStream(propsFile);
            props.store(outstream, "Ant JUnitTask generated properties file");
            outstream.close();
        } catch (java.io.IOException e) {
            FILE_UTILS.tryHardToDelete(propsFile);
            throw new BuildException("Error creating temporary properties "
                                     + "file.", e, getLocation());
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.