FileSystemProvider delegation

Michael Hall mik3hall at gmail.com
Thu Apr 28 13:55:28 PDT 2011


On Apr 28, 2011, at 5:38 AM, Alan Bateman wrote:

> What does org.truezip.PathDelegate.getFileSystem().provider() return? From the stack trace it looks like it is running sun.nio.fs.BsdFileSystemProvider whereas it should be returning your file system provider.

PathDelegate is supposed to actually be an instance whose provider is the platform one, Bsd in this case. 
Delegated back to when I decide the file isn't an archival one I want to handle differently. 
It goes....

pubilc abstract class AbstractPath {
// Defines helper methods as per zip demo
}

public class PathDelegate extends AbstractPath implements Path {

     Path path;		// Instance of platform, Bsd in this case, Path

// methods do their invocations on the above path instance.
// The 'helper' or convenience methods inherited from AbstractPath are what keeps this from itself being a straight pass through

}

What actually shows as the provider for this class may be the problem though, that it is actually not the Bsd one. I will look into that.
 
> 
> If it helps, our test cases have a "pass through" file system that might be useful to you:
> http://hg.openjdk.java.net/jdk7/jdk7/jdk/raw-file/tip/test/java/nio/file/Files/PassThroughFileSystem.java

Should of known that. I did one of these myself just to make sure that the so far basic testing I have now would run correctly.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20110428/55a58bb2/attachment.html 


More information about the nio-dev mailing list