[Gvsig_desarrolladores] gvSIG extension path

erwan bocher erwan.bocher en gmail.com
Mie Nov 8 16:58:04 CET 2006


Hi César,

It works.

Muchas gracias.

R1.




On 11/8/06, César Martínez Izquierdo <cesar.martinez en iver.es> wrote:
>
> erwan bocher wrote:
> > Hi,
> >
> > I'd like to display the path where my extension is saved like
> > D:/gvsig/linux/workspace/gvSIG
> > -1_0-rc1-src/extGeoSQLBuilder/.
> >
> > I use this method  :
> >
> > System.out.println(GeoSQLBuilder.class.getClassLoader().getResource("./"));
> >
> > It work fine in eclipse debug environment but not when my extension (in
> > jar) is  in the gvsig extension folder. I have a null value. I don't
> > understand why.
> >
> > Any ideas are welcome.
> >
> > Cheers
> >
> > R1.
> >
>
> Do you really want to know the extension's project dir
> ("D:/gvsig/linux/workspace/gvSIG-1_0-rc1-src/extGeoSQLBuilder/")
> or the dir where the extension is installed
>
> ("D:/gvsig/linux/workspace/gvSIG-1_0-rc1-src/_fwAndami/gvSIG/extensiones/packageName/")?
>
> If you want to get the second option, you can use:
>
> ClassLoader loader = this.getClass().getClassLoader();
> if (loader instanceof PluginClassLoader) {
>     // this should be always true if we are in an extension
>
>         PluginClassLoader ploader = (PluginClassLoader) loader;
>         System.out.println(loader.getPluginName());
> }
>
> This justs gets the extension's packageName.
>
> If you wish the full extension's dir, you can use:
>
> System.out.println(PluginServices.getPluginServices
> (this).getPluginDirectory().getAbsolutePath());
>
>
> Best regards,
>
>   César
>
> _______________________________________________
> gvSIG_desarrolladores mailing list
> gvSIG_desarrolladores en runas.cap.gva.es
> http://runas.cap.gva.es/mailman/listinfo/gvsig_desarrolladores
>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://runas.cap.gva.es/pipermail/gvsig_desarrolladores/attachments/20061108/94b95109/attachment-0001.htm


Más información sobre la lista de distribución gvSIG_desarrolladores