jimfs java 内存文件系统实现(Implementation of jimfs JAVA memory file system)

内存文件系统是挺有意思的东西,可以帮助我们解决好多实际的问题,而且比较强大

一些应用场景

  • 配置管理需要文件系统的,但是我们的配置是不同的代码片段
  • 基于内存系统实现文件操作mock
  • 一些操作我们必须使用文件系统才能完成的,或者使用文件系统完成比较方便

jimfs 介绍

谷歌开源的,基本实现的大部分java.nio.file 功能已经实现的功能如下:

  • crud
  • FileChannel…,inputstream, outputstream
  • 软连接以及硬连接
  • watchservice
  • 文件属性
  • windows 以及unix 格式的文件系统

说明

我已经介绍过不少类似nodejs 以及golang的实现,jimfs 也是一个很不错的参考实现

参考资料

https://github.com/google/jimfs

————————

Memory file system is very interesting. It can help us solve many practical problems, and it is relatively powerful

Some application scenarios

  • Configuration management requires a file system, but our configuration is a different code fragment
  • Implementation of file operation mock based on memory system
  • Some operations can only be completed by using the file system, or it is more convenient to use the file system

jimfs 介绍

Google is open source and basically implements most of Java nio. The file function has realized the following functions:

  • crud
  • FileChannel…,inputstream, outputstream
  • Soft connection and hard connection
  • watchservice
  • File properties
  • windows 以及unix 格式的文件系统

explain

I have introduced many implementations similar to nodejs and golang, and jimfs is also a good reference implementation

reference material

https://github.com/google/jimfs