Creating a folder/directory automatically

2
Hi everyone, I have a usecase where I need to create a pdf file (not a problem) and save that in a specific directory in my system locally. I need to create that directory automatically if it doesn’t exist and save that pdf there. Could anyone tell me if there is a java action or anything else to create a folder/directory? Thanks
asked
3 answers
2

I’m not sure what you’re trying to do, but I’d setup an SFTP server and have your application save documents in there. You could have some script on the receiving system monitoring the SFTP folder to move incoming files to some preferred location when necessary. Check out the SFTP module in the market place.

answered
5

Hi,

You can create folder using 

      File f1 = new File(path);  
      f1.mkdir();

 

Thanks.

answered
3

Where are you deploying? Because this will never work in the cloud. In the Mendix cloud you can only read and write to the path you can retrieve with com.mendix.cor.conf, Interface Configuration, method getResourcesPath():

See also documentation here: https://docs.mendix.com/addons/apd-addon/ig-one-java-security-settings

Regards,

Ronald

 

answered