title: How would i get the subpath from a specific directory from a path?
body: <p>Okay I can't quite word it, but i need the following:</p>
  
  <p><code>C:\Temp\Something\GroupName\...\file.ts -&gt; GroupName\...\file.ts</code></p>
  
  <p>I want to extract the path from a folder till the end.</p>
  
  <p>I came up with this disaster right here, but I am sure i am reinventing the wheel.</p>
  
  <pre><code>private Path extractGroupPath(Path path, String groupName) {
      int i;
      for (i = 0; i &lt; path.getNameCount(); i++) {
          if (path.getName(i).startsWith(groupName)) {
              break;
          }
      }
      Path groupPath = Paths.get("");
      for (; i &lt; path.getNameCount(); i++) {
          groupPath = groupPath.resolve(path.getName(i));
      }
      return groupPath;
  }
  </code></pre>