Hi All,
We are using DFS to connect to the documentum server and get the files to our local machine.We are using following piece of code for downloading the files.When we use resultContent.getAsFile() , an temp file is created in temp directory of our machine.. After getting the file using resultContent.getAsFile(), just for the sake of getting the file in to particular place we are reading it and writing using streams.Can we configure the location where the temp file has to be downloaded using DFS code?
Content resultContent = thisDataObject;
if (resultContent.canGetAsFile())
{
System.out.println("Reading the file content as a file. Time-"+new SimpleDateFormat("yyyy/MM/dd HH:mm:ss SSS").format(new Date()));
File src = resultContent.getAsFile();
out = new FileOutputStream("C:\\DFS\\output\\"+names[i]);
in = new FileInputStream(src);
while(true) {
int read = in.read(buffer);
if (read==-1) {
break;
}
out.write(buffer,0,read);
}
out.flush();
out.close();
in.close();
System.out.println("Wrote the file locally. Time-"+new SimpleDateFormat("yyyy/MM/dd HH:mm:ss SSS").format(new Date()));
}
Any inputs on this are greatly appreciated.
Thanks,
Suresh