If a large file is being copied into a diretory. FileUtilService.Exists will return TRUE. That only indicates a 'directory entry' exists, not that the file is there and available.
Is there a way to get that information? If you get Windows' file proeprties it will tell you that the file is 'locked', but I do not see any FileUtilService to get that info.
Is there a solution to that?
TIA
julio
Views
Replies
Total Likes
Possibly you could do it in an Execute Script step using methods available on the Java File object.
Views
Replies
Total Likes
Hi Steve,
That is exactly what I ended up doing.
For future reference here is the script code I used, seems to do the job:
File filename =pathToFile( patExecContext.getProcessDataStringValue("/process_data/@filepath"));
boolean doesFileReallyExists = filename.canWrite();
if (doesFileReallyExists ) {
try {
ran = new RandomAccessFile(filename , "rw");
try {
if (ran != null) ran.close();
} catch (IOException ioe) {
}
} catch (Exception ex) {
doesFileReallyExists = false;
}
}
patExecContext.setProcessDataBooleanValue("/process_data/@fileExists", doesFileReallyExists );
One caveat of that script is that LCES needs R/W access to the file/document.
hth
julio
Views
Replies
Total Likes