Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33870

Re: Implementing FileSystem without MANIFEST.MF/META-INF/services

Newsgroups comp.lang.java.programmer
Date 2016-02-24 00:14 -0800
References <12be97a8-deb6-4684-a352-e01c3fd48285@googlegroups.com> <naj0rg$12k0$1@gioia.aioe.org>
Message-ID <f2327b98-10be-47ca-87c8-939228161ffb@googlegroups.com> (permalink)
Subject Re: Implementing FileSystem without MANIFEST.MF/META-INF/services
From david.raver@gmail.com

Show all headers | View raw


On Wednesday, February 24, 2016 at 2:26:32 AM UTC+1, Arne Vajhøj wrote:
> On 2/23/2016 2:41 PM, david...@gmail.com wrote:
> > I'm trying to set up a file system (by implementing
> > FileSystemProvider, FileSystem, FileStore, etc.) so that later a user
> > could only call FileSystems.getFileSystem(uri), with a specific URI
> > (custom scheme, host, path, etc).
> >
> > This is normally done by putting an entry into jar's
> > MANIFEST.MF/META-INF/services, so that a JVM - using that information
> > - can set it up itself, but I don't have that option. I want to do it
> > programmatically. How can this be done?
> 
> Class.forName ????
> 
> Arne

Yes, that works (it would be even simpler to just call a constructor of my extension of FileSystem class). But...

But it requires knowledge of class name and, more importantly, even an instance of class loader that has to be used to load/define a class (using Class.forName(String, boolean, ClassLoader)). I can't expose that to the user.

The platform would have to initialize everything before handing control to the user. The user would then get the FileSystem instance using an URI, like I described above.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Implementing FileSystem without MANIFEST.MF/META-INF/services david.raver@gmail.com - 2016-02-23 11:41 -0800
  Re: Implementing FileSystem without MANIFEST.MF/META-INF/services Arne Vajhøj <arne@vajhoej.dk> - 2016-02-23 20:26 -0500
    Re: Implementing FileSystem without MANIFEST.MF/META-INF/services david.raver@gmail.com - 2016-02-24 00:14 -0800
      Re: Implementing FileSystem without MANIFEST.MF/META-INF/services Martin Gregorie <martin@address-in-sig.invalid> - 2016-02-24 18:45 +0000
        Re: Implementing FileSystem without MANIFEST.MF/META-INF/services david.raver@gmail.com - 2016-02-24 12:31 -0800

csiph-web