|
@@ -62,8 +62,11 @@ public class StorageLocation implements Comparable<StorageLocation>{
|
|
|
// make sure all URIs that point to a file have the same scheme
|
|
|
try {
|
|
|
File uriFile = new File(uri.getPath());
|
|
|
- String absPath = uriFile.getAbsolutePath();
|
|
|
- uri = new URI("file", null, absPath, uri.getQuery(), uri.getFragment());
|
|
|
+ String uriStr = uriFile.toURI().normalize().toString();
|
|
|
+ if (uriStr.endsWith("/")) {
|
|
|
+ uriStr = uriStr.substring(0, uriStr.length() - 1);
|
|
|
+ }
|
|
|
+ uri = new URI(uriStr);
|
|
|
} catch (URISyntaxException e) {
|
|
|
throw new IllegalArgumentException(
|
|
|
"URI: " + uri + " is not in the expected format");
|