: Access denied

Hello everybody, I want to create a file with a custom Java Action. Like this. //encodedString is the content of my future file in base64 byte[] decoded = java.util.Base64.getDecoder().decode(encodedString); File file = new File("test.txt"); FileOutputStream fos = new; fos.write(decoded); fos.flush(); fos.close(); FileInputSt"eam fileInputStream = new FileInputStream(file); return new String(decoded); But with that code I have an error from the accessControl  " access denied ("" "test.txt" "write")". How can I create my file ? Perhaps the folder is protected.  
2 answers

You only have a few places where you can create files. You can get them through the configuration, e.g.


There is also a getResourcesPath() method that may return a writable location. You can find the Java apidocs here. Be aware that when writing code with paths, you should take appropriate measures to deal with file separators, since most people work locally on Windows and standard cloud environments run Linux, e.g.


If you want to persist these files, you should use the System.FileDocument entity,


Thank you ! TempPath is fine for me. 
I just want to compare a file create with my Java action and a fileDocument create with the communityCommon java action StringToFile with the same String content.

In result they are big difference my file is readable and the fileDocument is unreadable... 
If someone can explain me why the fileDocument is unreadable. 

Here i create the fileDocument and download it 

Here I create the my file and I return string i use in java action StringToFile (above)

Then when I compare the FileDocument and my file 

We can see a big difference of content and size... On the left is my file created in the java action and on the right the FileDocument.


Someone have an idea how I have this difference ?