private void buildXmlPropertiesFile() { System.out.println( "\nBuilding and checking your pipeline properties file -> " + truncPipePropFile); StringBuilder toPrint = new StringBuilder(); // walk through the prop file String[] prop = IO.loadFileIntoStringArray(truncPipePropFile); Pattern val = Pattern.compile("(<entry key.+>)([D|A|B].*)</entry>"); boolean missingFile = false; for (String s : prop) { // does it match a file needing prepending? Data/, Apps/, Bed/ Matcher mat = val.matcher(s); if (mat.matches()) { File test = new File(referenceDir, mat.group(2)); if (test.exists()) { System.out.println("Found\t" + test); toPrint.append(mat.group(1)); toPrint.append(test.toString()); toPrint.append("</entry>"); } else { System.out.println("Misssing\t" + test); missingFile = true; } } // threads? else if (s.contains("threads")) toPrint.append("<entry key=\"threads\">" + threads + "</entry>"); // nope just save it and add a line return else toPrint.append(s); toPrint.append("\n"); } // anything missing? if so exit if (missingFile) Misc.printErrAndExit( "\nFailed to find all of the files in your properties file, see above.\n"); // OK, write it out completePipelinePropFile = new File(outputDirectory, "pipelineProperties.xml"); if (IO.writeString(toPrint.toString(), completePipelinePropFile) == false) Misc.printErrAndExit("Problem writing -> " + truncPipePropFile); }