Filelocator not working in exe [message #657838] |
Fri, 04 March 2011 05:02  |
Eclipse User |
|
|
|
i want to get the os location of a file in one my plugins
when i run the code in eclipse environment it works fine but when i export my product as exe it fails
here is my code snippet
Bundle bundle=Platform.getBundle("com.genesyslabs.sipserver.mist.generator");
if(bundle!=null)
{
System.out.println("\n bundle:"+bundle.getSymbolicName()+"\n");
}
IPath pt=new Path("src/workflow/generator.oaw");
URL url = FileLocator.find(bundle,pt, null);
String wfFile = "";
System.err.println("\n wFUrl"+"\n");
String srcgen="/C:/";
try {
if(url!=null)
{
URL fileURL = FileLocator.toFileURL(url);
wfFile=fileURL.getFile().toString();
System.out.println("\nurl:"+url.getPath()+"\n");
System.out.println("\n wfFile:"+wfFile+"\n");
}
else
{
System.out.println("\n url:"+"could not get the url"+"\n");
wfFile="C:\\Documents and Settings\\rtiragat\\dummy workspace\\com.genesyslabs.sipserver.mist.generator\\src\\workflow\\generator.oaw";
System.out.println("\n using the default hard coded workflow location \n");
}
-----------------------------
in url variable is null i.e url is not pointing to any object when i execute it as an exe in win32
please give me a way how i can get the os location of the file
Thanks
Ravi
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.11252 seconds