Commit 9918a7b1 authored by Manuel Gunkel's avatar Manuel Gunkel
Browse files

xml writer can now handle filepaths with spaces -- needed for LMD project

parent 470ecf95
......@@ -8,7 +8,7 @@
<version>5.0</version> <relativePath /> </parent> -->
<groupId>embl.almf</groupId>
<artifactId>AutoMicTools_</artifactId>
<version>1.1.27-SNAPSHOT</version>
<version>1.1.28-SNAPSHOT</version>
<name>plugins/AutoMicTools_.jar</name>
<description>Collection of tools for automated (feedback) microscopy data acquisition and analysis</description>
......
......@@ -51,7 +51,7 @@ public abstract class JobDistributor_Abstract extends RunJythonOnMonitoredFiles
private static final String KEY_SAVE_PARAMETERS="Save Parameters";
private static final String KEY_FILE_EXTENSION="Image File Extension";
private static final String KEY_FILL_JOB_PARAMETERS_FROM_FILE="Fill parameters from file";
private static final String KEY_INPUT_JOB_PARAMETERS="Input file with job parameters";
private static final String KEY_INPUT_JOB_PARAMETERS="Input file with job paramters";
private static final String KEY_MICROSCOPE_COMMANDER="Microscope commander";
......
......@@ -2,6 +2,7 @@ package automic.online.jobdistributors.xml;
import java.util.List;
import java.io.File;
import java.io.FileOutputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
......@@ -104,7 +105,10 @@ public class JobDistributorXMLWriter {
DOMSource source = new DOMSource(_document);
StreamResult result = new StreamResult(targetFile);
//changed in order to allow for file paths with spaces ("%20"):
// StreamResult result = new StreamResult(targetFile);
StreamResult result = new StreamResult(new FileOutputStream(targetFile));
transformer.transform(source, result);
// Output to console for testing
StreamResult consoleResult = new StreamResult(System.out);
......
package automic.parameters.xml;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
......@@ -57,12 +59,12 @@ public class ParameterXmlWriter {
return document;
}
private void writeDocumentToFile(Document _document){
private void writeDocumentToFile(Document _document) throws FileNotFoundException{
TransformerFactory transformerFactory = TransformerFactory.newInstance();
DOMSource source = new DOMSource(_document);
StreamResult result = new StreamResult(targetFile);
StreamResult result = new StreamResult(new FileOutputStream(targetFile));
try{
......
package automic.postaq.pipeline.xml;
import java.io.File;
import java.io.FileOutputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
......@@ -102,7 +103,7 @@ public class PipelineXMLWriter {
DOMSource source = new DOMSource(_document);
StreamResult result = new StreamResult(targetFile);
StreamResult result = new StreamResult(new FileOutputStream(targetFile));
transformer.transform(source, result);
// Output to console for testing
StreamResult consoleResult = new StreamResult(System.out);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment