Dear All,
I am trying to open a file which is located at
src/mimes/Components/com.sap.tut.wd.uploaddownloadinteractiveform.UploadDownloadInteractiveFormComp,
I am using this sample code given by sap..
*
IWDAttributeInfo attInfo =
wdContext.currentContextElement().node().getNodeInfo().
getAttribute("PdfSource");
ISimpleTypeModifiable type = attInfo.getModifiableSimpleType();
IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) type;
binaryType.setFileName("TravelRequest.pdf"); // Set file name
binaryType.setMimeType(WDWebResourceType.PDF); // set the mime type
String fileName ="temp
webdynpro
web
local
TutWD_UploadDownloadInteractiveForm_Init
Components
com.sap.tut.wd.uploaddownloadinteractiveform.UploadDownloadInteractiveFormComp1
TravelRequest.pdf";
// path to the source file
/* converts the binary file to a byte array and moves it to the text element */
try
{
File file = new File(fileName);
FileInputStream in = new FileInputStream(file);
ByteArrayOutputStream out = new ByteArrayOutputStream();
int length;
byte[] part = new byte [10 * 1024];
while ((length = in.read(part)) != -1)
{
out.write(part, 0, length);
}
in.close();
wdContext.currentContextElement().
setPdfSource(out.toByteArray());
} catch(Exception e)
{
throw new WDRuntimeException(e);
}
*
But I am getting runtime exception...
java.io.FileNotFoundException: temp\webdynpro\web\local\TutWD_UploadDownloadInteractiveForm_Init\Components\com.sap.tut.wd.uploaddownloadinteractiveform.UploadDownloadInteractiveFormComp1\TravelRequest.pdf (The system cannot find the path specified)
Please tell me what could be the reason...
Thanks in Advance