Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any available in-memory FileSystem implementations for Java7 nio2?

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

like image 603
devoured elysium Avatar asked Oct 20 '12 11:10

devoured elysium


2 Answers

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

like image 109
wischan Avatar answered Nov 11 '22 12:11

wischan


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

like image 33
dwegener Avatar answered Nov 11 '22 13:11

dwegener