Hello All,
I have a question regarding retrieving content using DFS getAsFile() method
Here is my basic use case:
1. Get content from repository using r_object_id. This content is of pdf format
2. The content should be of type java.io.file to use by my java webapplication
I tried the following
Content content = dataPackage.getDataObjects().get(0).getContents().get(0);
File file = content.getAsFile();
However I am not able to retrieve the physical file object. I see a file called ~dfs123132123.tmp file in the C:\Users\"User Name"\AppData\Local\Temp directory, but it gets deleted immediately after program execution.
Why does this file deleted?How do I save the file being returned into a file object that I can perform java file io operations on?
I am able to successfully retrieve content using URLContent and writing it to a java output stream.
Any help is much appreciated.
Thanks