mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-11-21 08:24:25 -06:00
Allow tilde for user home in path (#2075)
This commit is contained in:
parent
64917a2879
commit
94b681c514
@ -56,7 +56,15 @@ public class ResolverForFilesystem implements ContentResolver {
|
||||
if (uri.getScheme() != null && !uri.getScheme().isEmpty() && !uri.getScheme().equals("file")) {
|
||||
return null;
|
||||
}
|
||||
Path pathFromUri = Path.of(uri.getPath());
|
||||
|
||||
String rawPath = uri.getPath();
|
||||
|
||||
// Expand "~" to the user's home directory if it appears at the start of the path
|
||||
if (rawPath.startsWith("~")) {
|
||||
rawPath = System.getProperty("user.home") + rawPath.substring(1);
|
||||
}
|
||||
|
||||
Path pathFromUri = Path.of(rawPath);
|
||||
|
||||
if (Files.isReadable(pathFromUri)) {
|
||||
return pathFromUri;
|
||||
|
Loading…
Reference in New Issue
Block a user