properties

dir = C:\\Users 

class

 System.out.println("dir: " + properties.getProperty("dir")); System.out.println("URL: " + url); Path file = Paths.get(properties.getProperty("dir")).resolve(url); System.out.println("path: " + file); 

Conclusion

 dir: C:\Users URL: /file/Новая папка path: C:\file\Новая папка 

Where is Users disappearing?

    2 answers 2

    Remove the first slash from the url . If url = "file/Новая папка" , then everything works correctly.

      The description of the resolve method says:

      This method trivially returns other .

      In translation:

      If the other parameter is an absolute path, then the method simply returns other .

      You pass as the parameter /file/Новая папка . A slash at the beginning of the path means that the directory is specified relative to the root, i.e. drive C - and this is the absolute path, so the method returns C:\file\Новая папка .