Deprecate newFileSystem(...) overloads that default to platform-specific settings
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 296
- Avg merge
- 9m
- Merged PRs (30d)
- 7
Description
The following code
```
try (FileSystem memFs = Jimfs.newFileSystem()) {
Path memFsRoot = memFs.getPath("");
URI uri = memFsRoot.toUri();
Path path = Paths.get(uri);
System.out.println("memFsRoot: " + memFsRoot);
System.out.println("uri: " + uri);
System.out.println("path: " + path);
}
```
prints, on Windows:
```
memFsRoot:
uri: jimfs://4dbef289-e533-4340-8531-fe2cc6b2f0f3/C:/work/
path: C:\work
```
This seems like a bug (even though the `Path` object is linked to the `FileSystem` instance). The path should not need the `C:` drive designation, as far as I can tell, because the GUID in the URI should be sufficient to locate the filesystem. The weird Jimfs `URI` and `Path` syntax makes porting code between Linux and Windows problematic.
On Linux the output is:
```
memFsRoot:
uri: jimfs://4dbef289-e533-4340-8531-fe2cc6b2f0f3/work/
path: /work
```
Contributor guide
Assessment
This issue has not been assessed yet.