Any available in-memory FileSystem implementations for Java7 nio2?

杀马特。学长 韩版系。学妹 提交于 2019-12-20 10:44:17

问题


I was looking for in-memory nio2 FileSystem implementations, that would allow me to more easily test my IO-dependent code.

It seems natively, Java only provides (in my JDK) a Win32FileSystem and a ZipFileSystem.

It seems ShrinkWrap has something of the kind, but seems to mainly deal with ZIP File Systems or whatsoever.

I'd guess by the time being, some of you are already incorporating the new nio FileSystem IO in your own projects and could help me with this?

Thanks


回答1:


https://github.com/google/jimfs provides this functionality. I never tested it myself.




回答2:


You can try https://github.com/marschall/memoryfilesystem. Should be a perfect fit for your needs.




回答3:


ShrinkWrap does indeed have an NIO.2 in-memory filesystem implementation, and the directory reporting as "false" issue noted by Patrick has been fixed (by him. :) ): https://github.com/shrinkwrap/shrinkwrap/commit/3319e64c455a5f0e601b19066318d28c4bea3df1

S, ALR




回答4:


https://github.com/openCage/memoryfs is such an in-memory filesystem. It implements most but not yet all of the nio2 API.

Note: I am the author. Let me know if you find a bug or need a feature.



来源:https://stackoverflow.com/questions/12988135/any-available-in-memory-filesystem-implementations-for-java7-nio2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!