I want to check in the file system if file exists. This code is working in SSJS and I can correctly see if the file exists or not:
var filePath = "/folder/temp.xlsx";
var inStream:NotesStream = session.createStream();
if( inStream.open(filePath,"ASCII") ){
if( inStream.getBytes()>0 ){
....
}else{...}
}else{...}
but this code, looking for the exaxt same file is not working in an agent: (!!)
Session session = getSession();
Stream inStream = session.createStream();
String filePath = "/folder/temp.xslx";
if( inStream.open(filePath,"ASCII")){
if(inStream.getBytes()>0){
...
}else{...}
}else{...}
It always goes into the 2nd else which means that inStream.open(file...) is false.
what is the difference between xpages file access and agent file access? any solutions?
You probably need to increase the security level for the agent. To be able to access the file system from the agent.