Package java.util

Examples of java.util.Properties.store()


            IO.delete(propertiesFile);
        } else {
            FileOutputStream out = null;
            try {
                out = new FileOutputStream(propertiesFile);
                props.store(out, new Date().toString());
            } catch (final IOException e) {
                throw new CoreException(new Status(Status.ERROR, NewBuilder.PLUGIN_ID, "Failure to write container source attachments", e));
            } finally {
                IO.close(out);
            }
View Full Code Here


            IO.delete(propertiesFile);
        } else {
            FileOutputStream out = null;
            try {
                out = new FileOutputStream(propertiesFile);
                props.store(out, new Date().toString());
            } catch (final IOException e) {
                throw new CoreException(new Status(Status.ERROR, NewBuilder.PLUGIN_ID, "Failure to write container source attachments", e));
            } finally {
                IO.close(out);
            }
View Full Code Here

            final File settingsFile = new File(outputDir, PROPERTIES_FILE);
            getLog().debug(String.format("Creating settings at %s", settingsFile.getPath()));
            FileWriter writer = null;
            try {
                writer = new FileWriter(settingsFile);
                settings.store(writer, null);
            } catch ( final IOException ioe ) {
                throw new MojoExecutionException("Unable to write properties file.", ioe);
            } finally {
                IOUtils.closeQuietly(writer);
            }
View Full Code Here

                String uri = (String) prefixToURI.get(prefix);
                props.setProperty(prefix, uri);
            }

            try {
                props.store(os, null);
            } finally {
                // make sure stream is closed
                os.close();
            }
        } catch (Exception e) {
View Full Code Here

                String index = uriToIndex.get(uri).toString();
                props.setProperty(uri, index);
            }

            try {
                props.store(os, null);
            } finally {
                // make sure stream is closed
                os.close();
            }
        } catch (Exception e) {
View Full Code Here

        props.setProperty(String.format(SERIES_STATEMENT_KEY_FORMAT, 1), TEST_SERIES_SELECT_STATEMENT);

        final FileWriter writer = new FileWriter(chartDef);
        try
        {
            props.store(writer, "Test chart definition file");
        }
        finally
        {
            writer.close();
        }
View Full Code Here

        File f = File.createTempFile(getTestName(), ".properties");
        try
        {
            FileOutputStream fos = new FileOutputStream(f);
            properties.store(fos, null);
            fos.close();

            setTestSystemProperty(ClientProperties.DEST_SYNTAX, "ADDR");
            setTestSystemProperty(InitialContext.INITIAL_CONTEXT_FACTORY, "org.apache.qpid.jndi.PropertiesFileInitialContextFactory");
            setTestSystemProperty(InitialContext.PROVIDER_URL,  f.toURI().toURL().toString());
View Full Code Here

        /// and save
        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(origSlingProps);
            orig.store(fos, null);
        } catch (final IOException ioe) {
            throw new MojoExecutionException("Unable to save " + origSlingProps, ioe);
        } finally {
            if ( fis != null ) {
                try { fis.close(); } catch (final IOException ignore) {}
View Full Code Here

        launcherProps.put(aQute.bnd.osgi.Constants.RUNBUNDLES, Processor.join(names, ",\\\n  "));

        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(new File(folder, "launch.properties"));
            launcherProps.store(fos, "launch.properties");
        } catch (IOException e) {
            status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error generating launch properties file.", e));
        } finally {
            try {
                if (fos != null) {
View Full Code Here

        // write the properties
        OutputStream out = null;
        try {
            out = new FileOutputStream(this.repoPropertiesFile);
            props.store(out, null);
        } finally {
            if (out != null) {
                try {
                    out.close();
                } catch (IOException ioe) {
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.