You can write files to appropriate locations, such as a temp directory. You can get a reference to this directory by calling
File tempDirectory = Core.getConfiguration().getTempPath()
There are no restrictions on this directory, so no need to ask for permissions.