Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
4a71ee18
Commit
4a71ee18
authored
Nov 12, 2019
by
Piotr Gawron
Browse files
sbgn2String doens't create temporary file
parent
3a8d4e6f
Changes
1
Show whitespace changes
Inline
Side-by-side
converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlConverter.java
View file @
4a71ee18
...
...
@@ -4,7 +4,6 @@ import java.io.*;
import
javax.xml.bind.JAXBException
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.text.StringEscapeUtils
;
import
org.apache.logging.log4j.core.LogEvent
;
import
org.sbgn.SbgnUtil
;
...
...
@@ -51,10 +50,10 @@ public class SbgnmlXmlConverter extends Converter {
MinervaLoggerAppender
.
unregisterLogEventStorage
(
appender
);
}
try
{
File
tempFile
=
File
.
createTempFile
(
"sbgnmlExportTempFile"
,
".tmp"
);
SbgnUtil
.
writeTo
File
(
exportedData
,
tempFile
);
try
(
FileInputStream
inputStream
=
new
FileInputStream
(
tempFile
))
{
String
xml
=
IOUtils
.
toString
(
inputStream
,
"UTF-8"
);
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
(
);
SbgnUtil
.
writeTo
(
exportedData
,
baos
);
String
xml
=
new
String
(
baos
.
toByteArray
()
,
"UTF-8"
);
if
(
notes
.
length
()
>
0
)
{
int
position
=
xml
.
indexOf
(
"<map language"
);
if
(
position
<
0
)
{
...
...
@@ -65,7 +64,6 @@ public class SbgnmlXmlConverter extends Converter {
xml
=
xml
.
substring
(
0
,
position
)
+
notesNode
+
xml
.
substring
(
position
);
}
return
xml
;
}
}
catch
(
IOException
|
JAXBException
e
)
{
throw
new
ConverterException
(
e
);
}
...
...
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