@@ -117,18 +117,20 @@ public FileSystem newFileSystem(Path path, Map<String,?> env) throws IOException
117117 }
118118
119119 static void makeFileSystemUninterruptible (FileSystem res ) {
120- try {
121- // workaround to make the underlying work of the ZipFileSystem
122- // resistant to thread abortion. Without it, the zips become
123- // useless when a consumer thread aborts
124- var zipFileSystemClass = res .getClass ();
125- var chField = zipFileSystemClass .getDeclaredField ("ch" );
126- chField .setAccessible (true );
127- if (chField .get (res ) instanceof FileChannelImpl fileChannel ) {
128- fileChannel .setUninterruptible ();
120+ if (res .getClass ().getName ().contains ("ZipFileSystem" )) {
121+ try {
122+ // workaround to make the underlying work of the ZipFileSystem
123+ // resistant to thread abortion. Without it, the zips become
124+ // useless when a consumer thread aborts
125+ var zipFileSystemClass = res .getClass ();
126+ var chField = zipFileSystemClass .getDeclaredField ("ch" );
127+ chField .setAccessible (true );
128+ if (chField .get (res ) instanceof FileChannelImpl fileChannel ) {
129+ fileChannel .setUninterruptible ();
130+ }
131+ } catch (Exception ex ) {
132+ ILog .get ().error (ex .getMessage (), ex );
129133 }
130- } catch (Exception ex ) {
131- ILog .get ().error (ex .getMessage (), ex );
132134 }
133135 }
134136
0 commit comments