Hi All,
I am trying to download file from KM. I tried following code but it is not taking path into FileInputStream.
String resourcePath = "http://abc.xyz.com:50000/irj/go/km/docs/documents/risha/ XYZ 20409.doc";
IWDResource resource;
String name = "XYZ 20409.doc";
String path = resourcePath;
InputStream stream;
try {
stream = new FileInputStream(path);
resource = WDResourceFactory.createResource( stream, name, WDWebResourceType.DOC, true);
stream.close();
wdComponentAPI.getWindowManager() .createNonModalExternalWindow( resource.getUrl( 0), name).show();
//store resource object in context attribute 'FileResource'
wdContext.currentCtx_va_FileDataElement().setCtx_va_FileResource(resource);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Please helpme out.
Thanks
Risha