Setting default file system behavior in Java 7

Java 7 introduces a great API for writing custom file systems. Consider a use case where I do not want to implement a new file system, I just want to customize the behavior of the existing one. For example, flip every bit that is written / read from it.

It seems to me that in the current jdk there are no corresponding possibilities for this. AbstractFileSystemProvider, a provider that extends WindowsFileSystemProvider, is a closed package, so I cannot reuse it. I have not even found a specific implementation for Linux.

Problem # 1: There is no useful abstraction of the current file system for the extension.

Suppose I only apply to Windows. WindowsFileSystemProvider is publicly available, so I can really easily override newByteChannel and do with it. But alas!

Problem # 2: WindowsFileSystem is not publicly available, so I really need to encode a completely new file system in order to introduce a new provider.

Am I missing something or is this function completely raw and not ready for writers to use applications?

+4
source share
1 answer

After accessing core-libs-dev in openjdk, I got the following response:

(. FileSystems.getDefault , ). , , , . , PassThroughFileSystem jdk/test, , , .

PassThroughFileSystem - , , . , -, , , , .

+2

All Articles