devoured elysium
devoured elysium

Reputation: 105067

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

Upvotes: 9

Views: 2915

Answers (4)

wischan
wischan

Reputation: 3740

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

Upvotes: 9

openCage
openCage

Reputation: 2775

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.

Upvotes: 0

dwegener
dwegener

Reputation: 482

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

Upvotes: 1

ALRubinger
ALRubinger

Reputation: 31

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

Upvotes: 0

Related Questions