Skip to content

Commit

Permalink
PathConverter fails for file paths with spaces. Fixes x-stream#52.
Browse files Browse the repository at this point in the history
  • Loading branch information
joehni committed Apr 20, 2016
1 parent 5a42c74 commit 163de5d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions xstream-distribution/src/content/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ <h1 id="upcoming-1.4.x">Upcoming 1.4.x maintenance release</h1>

<p>Not yet released.</p>

<h2>Minor changes</h2>

<ul>
<li>GHI:#52: PathConverter fails for file paths with spaces.</li>
</ul>

<h2>API changes</h2>

<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public Object fromString(final String str) {
return Paths.get(uri);
}
} catch (final URISyntaxException e) {
throw new ConversionException(e);
return Paths.get(str);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ public void testPathOfDefaultFileSystem() {
assertBothWays(Paths.get(uri), "<path>" + absolutePathName + "</path>");
}

public void testPathWithSpecialCharacters() {
assertBothWays(Paths.get("with space"), "<path>with space</path>");
assertBothWays(Paths.get("with+plus"), "<path>with+plus</path>");
assertBothWays(Paths.get("with&ampersand"), "<path>with&amp;ampersand</path>");
}

public void testPathOfNonDefaultFileSystem() throws IOException {
final Map<String, String> env = new HashMap<>();
env.put("create", "true");
Expand Down

0 comments on commit 163de5d

Please sign in to comment.