Package java.util

Examples of java.util.Properties.store()


            Properties properties = new Properties();
            for (Entry<String, String> entry : processedResources.entrySet()) {
                properties.put(entry.getKey(), staticResourcePrefix + entry.getValue());
            }
            // properties.putAll(processedResources);
            properties.store(fos, null);
        } finally {
            try {
                if (fos != null) {
                    fos.close();
                }
View Full Code Here


        // When
        Properties systemProperties = new Properties();
        systemProperties.setProperty("one", "1");
        systemProperties.setProperty("two", "2");       
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        systemProperties.store(out, "");
        task.setSystemProperties(out.toString());
        Embedder embedder = task.newEmbedder();
        // Then
        assertThat(embedder.systemProperties(), equalTo(systemProperties));
    }
View Full Code Here

        out = new FileOutputStream(file.getFD());
        /*
         * If server is interrupted before this line,
         * the version file will remain unchanged.
         */
        props.store(out, null);
        /*
         * Now the new fields are flushed to the head of the file, but file
         * length can still be larger then required and therefore the file can
         * contain whole or corrupted fields from its old contents in the end.
         * If server is interrupted here and restarted later these extra fields
View Full Code Here

        properties.put(RuntimeContext.KEY_BUILD_DATE, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        properties.put(RuntimeContext.KEY_RUNTIME_VERSION, RuntimeContext.getRuntimeVersion());

        OutputStream output = environment.openResource(null, RuntimeContext.PATH_APPLICATION_INFO);
        try {
            properties.store(output, "Created by Asakusa DSL compiler");
        } finally {
            output.close();
        }
    }
View Full Code Here

        Properties properties = new Properties();
        script.storeTo(properties);

        OutputStream output = getEnvironment().openResource(null, path);
        try {
            properties.store(output, getEnvironment().getTargetId());
        } finally {
            output.close();
        }
    }
View Full Code Here

        Properties p = new Properties();
        for (String event : data.keySet()) {
            p.setProperty(event, data.get(event).toString());
        }
        try {
            p.store(output, this.getClass().getName());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

        }

        LOG.debug("Exporting YAESS Batch Script");
        OutputStream output = getEnvironment().openResource(PATH);
        try {
            properties.store(output, MessageFormat.format(
                    "YAESS Batch Script for \"{0}\", version {1}",
                    getBatchId(),
                    BatchScript.VERSION));
        } finally {
            output.close();
View Full Code Here

            p.setProperty(atoms[0], atoms[1]);
        }
        File file = folder.newFile(BATCH_ID + ExecutionScriptHandlerDispatcher.SUFFIX_CONF);
        OutputStream output = new FileOutputStream(file);
        try {
            p.store(output, BATCH_ID);
        } finally {
            output.close();
        }
    }
View Full Code Here

        private ZipEntry createEntryFromProtocol(FileProtocol protocol) throws IOException {
            assert protocol != null;
            Properties properties = new Properties();
            protocol.storeTo(properties);
            buffer.reset();
            properties.store(buffer, protocol.getLocation());
            ZipEntry entry = new ZipEntry(protocol.getLocation());
            entry.setExtra(Arrays.copyOfRange(buffer.getData(), 0, buffer.getLength()));
            return entry;
        }
View Full Code Here

        assert path != null;
        Properties properties = new Properties();
        info.storeTo(properties);
        FSDataOutputStream out = fs.create(path);
        try {
            properties.store(out, MessageFormat.format(
                    "Cache for {0}",
                    info.getId()));
        } finally {
            out.close();
        }
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.