title: How to get the length of a Path in java?
body: <p>How do you get the length of a Path? Am I missing something here? Strangely enough, int length() nor any similar method is implemented in the Path class. Example: for the path </p>
  
  <pre><code>C:\foo\bar\anotherfolder\subfolder
  </code></pre>
  
  <p>the method would return 4.</p>