Search code examples
javaxpageslotus-noteslotus-dominoagents

Cannot access file system from Java Agent


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?


Solution

  • You probably need to increase the security level for the agent. To be able to access the file system from the agent.

    enter image description here