Tweaking the behavior of the default file system in Java 7

怎甘沉沦 提交于 2019-12-05 14:44:34

After contacting core-libs-dev in openjdk, I got the following answer:

The service provider interface allows you to replace the default provider or interpose on it (see the FileSystems.getDefault docs for the details on how this is configured). When you interpose on the default provider then you have the opportunity to do your customization although it can be tricky to ensure that you get all the delegation right. As a starting point then look at the PassThroughFileSystem in jdk/test tree, this is a provider used by some of the tests and may be what you are looking for.

The PassThroughFileSystem is a nice reference implementation that demonstrates how one can implement a custom provider with proper delegation to the default one. That being said, in my opinion the problem is still there but at least we have a better starting point.

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