You only have a few places where you can create files. You can get them through the configuration, e.g.
Core.getConfiguration().getTempPath()
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.
Core.getConfiguration().getFileSeparator()
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 ?