Storing FileDocument in specific folder

For a project at a customer I need to store a FileDocument (.xml file) into a specific folder. A program running on the server will read this file and than replace it with an answer-file. This answer-file I can retrieve with the Community Commons 'storeURLToFileDocument' java action. But how do I get the file in that specific folder in the first place? I figured that I probably also need a java action for that, and was wondering if someone had such an action in store for me! Many thanks in advance!
1 answers

You can write a filedocument to a folder (if the server has rights there) with a javaaction (param filedoc FileDocument, param fullpath String)

    InputStream in  = Core.getFileDocumentContent(getContext(), filedoc.getMendixObject());
    OutputStream out = new FileOutputStream(fullpath);, out);