title: Getting FileSystemNotFoundException from ZipFileSystemProvider when creating a path to a resource
body: <p>I have a Maven project and inside a method I want to create a path for a directory in my resources folder. This is done like this:</p>
  
  <pre><code>try {
      final URI uri = getClass().getResource("/my-folder").toURI();
      Path myFolderPath = Paths.get(uri);
  } catch (final URISyntaxException e) {
      ...
  }
  </code></pre>
  
  <p>The generated <code>URI</code> looks like <code>jar:file:/C:/path/to/my/project.jar!/my-folder</code>.</p>
  
  <p>The stacktrace is as following:</p>
  
  <pre><code>Exception in thread "pool-4-thread-1" java.nio.file.FileSystemNotFoundException
      at com.sun.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:171)
      at com.sun.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:157)
      at java.nio.file.Paths.get(Paths.java:143)
  </code></pre>
  
  <p>The <code>URI</code> seems to be valid. The part before <code>!</code> points to the generated jar-file and the part after it to <code>my-folder</code> in the root of the archive. I have used this instructions before to create paths to my resources. Why am I getting an exception now?</p>