Java 中文件系统和 jar/zip 的抽象层
是否有一个 Java 库,它在文件系统和 jar/zip 上提供了一个抽象层。我检查了 apache common vfs 但它不支持列出目录内容和文件重命名等操作对于罐子/拉链。
假设有一些代码,它使用 java.io.File 及其朋友来访问文件系统中的文件,如果这些文件位于 Jar/Zip 中,我需要使其工作。我想找到一个与java.io.File
非常相似的API,以使代码重构更容易。
Is there a Java library, which provides an abstraction layer over the file system and jar/zip. I checked apache common vfs but it does not support such operations as listing directory content and file rename for Jar/Zip.
Suppose there is some code, which uses java.io.File
and its friends to access files in the file system, and I need to make it work if these files are in Jar/Zip. I would like to find an API, which is very similar to java.io.File
, to make the code refactoring easier.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我还没有使用过它,但是您是否正在寻找 Zip 文件Java 7 中引入了 System Provider?
I haven't used it yet, but are you looking for the Zip File System Provider introduced in Java 7?
Zip 文件系统提供程序不能作为抽象层工作,正是因为 java.io.File:
我能找到的最接近的 API 是 Christian Schlichtherle 的 TrueZIP/TrueVFS https://truevfs.java.net/ 但它有自己的问题。
Zip File System Provider doesn't work as the abstraction layer exactly because of java.io.File:
The closest API I could find is TrueZIP/TrueVFS by Christian Schlichtherle https://truevfs.java.net/ but it has its own issues.