public void processFile(Path file) throws IOException {
        writeHeading(FileUtil.getCanonicalPath(file));

        Path newFile = file.getParent().resolve(file.getFileName().toString() + ".tmp");
        Files.deleteIfExists(newFile);
        int replaceCount = 0;
        try (BufferedReader buffReader = new BufferedReader(Files.newBufferedReader(file));
                BufferedWriter buffWriter = new BufferedWriter(Files.newBufferedWriter(newFile))) {
            String line;
            int lineCount = 0;
            while ((line = buffReader.readLine()) != null) {
                lineCount++;
                for (Parameter parameter : parameterFile.getParameter()) {
                    if (line.contains(parameter.getName())) {
                        line = line.replace(parameter.getName(), parameter.getValue());
                        replaceCount++;
                        System.out.println(FileUtil.getCanonicalPath(file) +
                                ": Replaced " + parameter.getName() + " with " + parameter.getValue() +
                                " at line " + lineCount);
                    }
                }
                buffWriter.write(line);
                buffWriter.newLine();
            }
        }

        if (replaceCount == 0) {
            System.out.println("Nothing replaced in file");
            Files.delete(newFile);
        } else {
            Files.delete(file);
            Files.move(newFile, file);
        }
        System.out.println();
    }
Usage java stroom.util.config.Configure
<pre><code>{@code <parameter file> <files to process>}</code></pre>
stroom-util/src/main/java/stroom/util/config/Configure.java