title: How to get the path string from a java.nio.Path?
body: <p>Rewrote question with more info</p>
  
  <p>I have some code that creates a <code>Path</code> object using relative paths, like this: <code>Paths.get("..", "folder").resolve("filename")</code>. Later, I want to get the path string "..\folder\filename" from it (I'm on windows, so backslashes). When I run this code using manual compile or from Eclipse, this works fine.</p>
  
  <p>However, when I run it using Maven, it doesn't work any more. The <code>toString()</code> method returns <code>[.., folder, filename]</code> instead of an actual path string. Using <code>path.normalize()</code> doesn't help. Using <code>path.toFile().getPath()</code> does return what I'm looking for, but I feel there should be a solution using just the <code>nio.path</code> API.</p>