Consider injecting this entire class with spring. just make sure the temporary folder is injected prior to it.
that way you wont need to call it from the main method.