Skip to content

Commit

Permalink
URLUtil Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gab1one committed Sep 11, 2017
1 parent f9cc77a commit 2ea8bda
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public static URI encode(String in) {
} catch (MalformedURLException | URISyntaxException e1) {
try {
final URI fromString = URIUtil.fromString(in);
// no scheme specified, we assume 'file://'
if (fromString.getScheme() == null) {
final String fragment = fromString.getFragment();
if (fragment != null) {
return new URI("file", fromString.getSchemeSpecificPart() + "#" + fragment, null);
} else {
return new URI("file", fromString.getSchemeSpecificPart(), fragment);
}
return new URI("file", fromString.getSchemeSpecificPart(), fragment);
} else if (isValidScheme(fromString.getScheme())) {
return fromString;
} else {
Expand Down

0 comments on commit 2ea8bda

Please sign in to comment.