Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aliaksandr Halavatyi
AutoMicTools
Commits
9918a7b1
Commit
9918a7b1
authored
Jul 13, 2021
by
Manuel Gunkel
Browse files
xml writer can now handle filepaths with spaces -- needed for LMD project
parent
470ecf95
Changes
5
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
9918a7b1
...
...
@@ -8,7 +8,7 @@
<version>5.0</version> <relativePath /> </parent> -->
<groupId>
embl.almf
</groupId>
<artifactId>
AutoMicTools_
</artifactId>
<version>
1.1.2
7
-SNAPSHOT
</version>
<version>
1.1.2
8
-SNAPSHOT
</version>
<name>
plugins/AutoMicTools_.jar
</name>
<description>
Collection of tools for automated (feedback) microscopy data acquisition and analysis
</description>
...
...
src/main/java/automic/online/jobdistributors/JobDistributor_Abstract.java
View file @
9918a7b1
...
...
@@ -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 param
e
ters"
;
private
static
final
String
KEY_INPUT_JOB_PARAMETERS
=
"Input file with job paramters"
;
private
static
final
String
KEY_MICROSCOPE_COMMANDER
=
"Microscope commander"
;
...
...
src/main/java/automic/online/jobdistributors/xml/JobDistributorXMLWriter.java
View file @
9918a7b1
...
...
@@ -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
);
...
...
src/main/java/automic/parameters/xml/ParameterXmlWriter.java
View file @
9918a7b1
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
{
...
...
src/main/java/automic/postaq/pipeline/xml/PipelineXMLWriter.java
View file @
9918a7b1
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment