Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
bcf83efa
Commit
bcf83efa
authored
May 11, 2020
by
Piotr Gawron
Browse files
properly handle uris
parent
5c6c0aba
Pipeline
#26533
passed with stage
in 11 minutes and 7 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
bcf83efa
...
...
@@ -3,6 +3,8 @@ minerva (14.0.12) stable; urgency=medium
*
Bug
fix
:
removing
comment
from
submap
did
not
work
*
Bug
fix
:
reaction
name
containing
"<"
character
was
exported
inproperly
to
CellDesigner
(#
1227
)
*
Bug
fix
:
doi
annotation
was
inproperly
parsed
from
CellDesigner
file
and
resulted
in
not
clickable
link
(#
1231
)
--
Piotr
Gawron
<
piotr
.
gawron
@
uni
.
lu
>
Mon
,
11
May
2020
17
:
00
:
00
+
0200
...
...
model/src/main/java/lcsb/mapviewer/model/map/MiriamType.java
View file @
bcf83efa
package
lcsb.mapviewer.model.map
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -911,7 +913,13 @@ public enum MiriamType {
if
(!
foundUri
.
endsWith
(
"/"
))
{
// add one character for separator
uriLength
++;
}
return
new
MiriamData
(
foundType
,
miriamUri
.
substring
(
uriLength
));
String
resource
=
miriamUri
.
substring
(
uriLength
);
try
{
resource
=
URLDecoder
.
decode
(
resource
,
"UTF-8"
);
}
catch
(
UnsupportedEncodingException
e
)
{
logger
.
warn
(
"Problematic uri: "
+
resource
,
e
);
}
return
new
MiriamData
(
foundType
,
resource
);
}
throw
new
InvalidArgumentException
(
"Invalid miriam uri: "
+
miriamUri
);
}
...
...
model/src/test/java/lcsb/mapviewer/model/map/MiriamTypeTest.java
View file @
bcf83efa
...
...
@@ -117,4 +117,11 @@ public class MiriamTypeTest extends ModelTestFunctions {
}
}
@Test
public
void
testGetMiriamForDoiUri
()
{
MiriamData
md
=
MiriamType
.
getMiriamByUri
(
"urn:miriam:doi:10.1109%2F5.771073"
);
logger
.
debug
(
md
);
assertTrue
(
md
.
getResource
().
contains
(
"/"
));
}
}
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