问题
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