package io.quarkus.fs.util;

import java.nio.file.spi.FileSystemProvider;

public class FileSystemProviders {
    /**
     * FileSystemProvider which supports a "jar" scheme, e.g. for opening zip or jar files.
     */
    public static final FileSystemProvider ZIP_PROVIDER;
    static {
        FileSystemProvider foundZipProvider = null;
        for (FileSystemProvider installedProvider : FileSystemProvider.installedProviders()) {
            if (installedProvider.getScheme().equals("jar")) {
                foundZipProvider = installedProvider;
                break;
            }
        }
        ZIP_PROVIDER = foundZipProvider;
    }
}

@@ -333,16 +333,425 @@
 = null;%0A
+        final ClassLoader ccl = Thread.currentThread().getContextClassLoader();%0A        try %7B%0A            // We are loading %22installed%22 FS providers that are loaded from the system classloader anyway%0A            // To avoid potential ClassCastExceptions we are setting the context classloader to the system one%0A            Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());%0A    
         
@@ -849,16 +849,20 @@
         
+    
 if (inst
@@ -900,24 +900,28 @@
 s(%22jar%22)) %7B%0A
+    
             
@@ -982,15 +982,23 @@
     
+    
 break;%0A
+    
     
@@ -999,32 +999,129 @@
               %7D%0A
+            %7D%0A        %7D finally %7B%0A            Thread.currentThread().setContextClassLoader(ccl);%0A
         %7D%0A      

Load FileSystemProviders with system cl