A DESCRIPTION OF THE PROBLEM :
Attempt to construct a Path instance of e.g. 'c:\temp\ kljdsj \file.tmp' - with space at beginnig or end of a path element causes validation failure.
From another side, new File("c:\\temp\\ kljdsj \\file.tmp") allows to operate referenced file as usual and file system has no problems with such file names.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Path.of("c:\\temp").resolve("eruyer \\file.tmp")
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Instance of Path["c:\temp\eruyer \file.tmp"] is successfully constructed
ACTUAL -
Path.of("c:\\temp").resolve("eruyer \\file.tmp") -> InvalidPathException, even if referenced file exists
---------- BEGIN SOURCE ----------
Path.of("c:\\temp").resolve("eruyer \\file.tmp");
---------- END SOURCE ----------
Attempt to construct a Path instance of e.g. 'c:\temp\ kljdsj \file.tmp' - with space at beginnig or end of a path element causes validation failure.
From another side, new File("c:\\temp\\ kljdsj \\file.tmp") allows to operate referenced file as usual and file system has no problems with such file names.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Path.of("c:\\temp").resolve("eruyer \\file.tmp")
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Instance of Path["c:\temp\eruyer \file.tmp"] is successfully constructed
ACTUAL -
Path.of("c:\\temp").resolve("eruyer \\file.tmp") -> InvalidPathException, even if referenced file exists
---------- BEGIN SOURCE ----------
Path.of("c:\\temp").resolve("eruyer \\file.tmp");
---------- END SOURCE ----------
- relates to
-
JDK-8190546 File.toPath() reject directory names with trailing space
-
- Closed
-
-
JDK-8354450 Using a File with a path containing a trailing space should fail when alternative data streams are disabled (win)
-
- In Progress
-
- links to