Commit 39fbdb12 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Fixed issue with encoding of '+' character

parent c3a72b1c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ public class NodeInfo {
    public NodeInfo(Node node, User user, String authority, Node linkedNode) {
        this.authority = authority;
        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.type = node.getType();
        this.creator = getCreator(node);
@@ -80,6 +80,7 @@ public class NodeInfo {
    private String decodePath(String uri, String prefix) {

        return String.join("/", Arrays.stream(uri.substring(prefix.length()).split("/"))
                .map(p -> p.replace("+", "%2B"))
                .map(p -> URLDecoder.decode(p, StandardCharsets.UTF_8))
                .collect(Collectors.toList()));
    }