Question about FileSystemProvider API in JDK7
Alan Bateman
Alan.Bateman at oracle.com
Mon Oct 21 07:54:38 UTC 2013
On 21/10/2013 06:30, Pisarev, Vitaliy wrote:
> Hello,
>
> I was directed to this list by Brian Goetz, I am a new member and I am not yet acquainted with how things go in these mailing lists.
> I am an SW Engineer and I am looking for some insight about the new FileSystemProvider API. I posted a question on SO:
>
> http://stackoverflow.com/questions/19425836/tweaking-the-behavior-of-the-default-file-system-in-java-7
>
> I hope this reaches you and your answer reaches me back.
>
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.
If on the other hand that you are looking for something at the lower
level, say to intercept calls to the operating system then there isn't
anything in the APi for that. To do customizations at that level
requires using a native interposer library, or if Windows then it means
using something like Detours [1].
-Alan.
[1] http://research.microsoft.com/pubs/68568/huntusenixnt99.pdf
More information about the core-libs-dev
mailing list