File as new File in Java?

0
Hi all I need te process a file in some custom java (dynamic created file, so a template would not fit). I use the Mendix “File manager” to upload the file to an entity that’s a generalization of ‘System.FileDocument’ How can I process this file in Java? Ideally I would like to use the ‘new File(“path”) ‘ in my custom java.   Thanks in advance
asked
1 answers
0

AFAIK that is not possible directly because Mendix files are actually stored in AWS instead of the local file system. What you can do is copy the Mendix file content to a local temp file and use that instead. See this great post by Erwin for more details https://forum.mendix.com/link/questions/8573

To create a temporary file in java see https://www.tutorialspoint.com/java/io/file_createtempfile_directory.htm

Note that temporary files are not automatically removed, you would need to delete them manually after you are done with them.

Hope this helps

answered