Java jar中文件的异步FileChannel

Java jar中文件的异步FileChannel,java,spring,classpath,nio,channel,Java,Spring,Classpath,Nio,Channel,有没有办法为类路径上存储在jar中的文件打开异步文件通道 如果我尝试直接创建路径,我会得到FileSystemNotFoundException。 如果我先创建文件系统: URI uri = ...; //get the URI of a file in a jar String[] array = uri.toString().split("!"); FileSystem fs = FileSystems.newFileSystem(URI.create(array[0]), Collecti

有没有办法为类路径上存储在jar中的文件打开
异步文件通道

如果我尝试直接创建
路径
,我会得到
FileSystemNotFoundException
。 如果我先创建文件系统:

URI uri = ...; //get the URI of a file in a jar
String[] array = uri.toString().split("!");
FileSystem fs = FileSystems.newFileSystem(URI.create(array[0]), Collections.emptyMap());
Path path = fs.getPath(array[1]);
AsynchronousFileChannel ch = AsynchronousFileChannel.open(path);
它会随着
不支持操作异常而爆炸:(

有没有办法做到这一点


我的项目是Spring(并为此使用了
ClassPathResource
),因此Spring特定的解决方案是可行的。

JDK中的zip文件系统提供程序不支持异步I/O,所以这就是抛出UOE的原因