[udig-devel] Migrating to uDig 1.1, 1 compiling error

Schmitt, Magna (CIP) M.SCHMITT at CGIAR.ORG
Wed Oct 4 07:23:24 PDT 2006


Hello:
I am almost finishing my compilation but I have 1 error remained:
In one of my plugins i have this code to read the sld file of a shapefile:

    URL base=handle.getIdentifier();
    String strUrl=base.getFile().substring(0,base.getFile().lastIndexOf("."))+".sld";
     strUrl=base.getProtocol()+":"+strUrl;
     System.out.println(strUrl);                 
      url=new URL(strUrl);
     StyleFactory factory=StyleFactoryFinder.createStyleFactory();
    SLDStyle reader=new SLDStyle(factory,url);  //What can I put here instead??
    Style[] style=reader.readXML();
     System.out.println("style name: "+style[0].getName());

I tried with StyleBuilder but I do not know were to include the URL to tell the program were to find the .sld file and read it.
Hope you can help me with this code line....
Thank you in advance,
Magna


More information about the udig-devel mailing list