Skip to content
Snippets Groups Projects
Commit 39fbdb12 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Fixed issue with encoding of '+' character

parent c3a72b1c
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ public class NodeInfo { ...@@ -45,7 +45,7 @@ public class NodeInfo {
public NodeInfo(Node node, User user, String authority, Node linkedNode) { public NodeInfo(Node node, User user, String authority, Node linkedNode) {
this.authority = authority; this.authority = authority;
this.path = getPath(node); this.path = getPath(node);
this.name = URLDecoder.decode(path.substring(path.lastIndexOf("/") + 1), StandardCharsets.UTF_8); this.name = URLDecoder.decode(path.substring(path.lastIndexOf("/") + 1).replace("+", "%2B"), StandardCharsets.UTF_8);
this.size = getSize(node); this.size = getSize(node);
this.type = node.getType(); this.type = node.getType();
this.creator = getCreator(node); this.creator = getCreator(node);
...@@ -80,6 +80,7 @@ public class NodeInfo { ...@@ -80,6 +80,7 @@ public class NodeInfo {
private String decodePath(String uri, String prefix) { private String decodePath(String uri, String prefix) {
return String.join("/", Arrays.stream(uri.substring(prefix.length()).split("/")) return String.join("/", Arrays.stream(uri.substring(prefix.length()).split("/"))
.map(p -> p.replace("+", "%2B"))
.map(p -> URLDecoder.decode(p, StandardCharsets.UTF_8)) .map(p -> URLDecoder.decode(p, StandardCharsets.UTF_8))
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment