I used the following code to get the path
Path errorFilePath = FileSystems.getDefault().getPath(errorFile);
When I try to move a file using the File NIO, I get the error below:
java.nio.file.InvalidPathException: Illegal char <:> at index 2: \C:\Sample\sample.txt
I also tried using URL.encode(errorFile)
which results in the same error.
ClassLoader.getSystemResource("something").getPath()
- on windows it was droppingfile:
fromfile:/C:/mypath
– Cobia