public static File writeToTempFile(InputStream inputStream, String prefix, String suffix) throws IOException {

        File file = File.createTempFile(prefix, "." + suffix);
        writeToFile(inputStream, file);
        return file;
    }
public static File writeToTempFile ( InputStream inputStream , String prefix , String suffix ) throws IOException { File file = File . createTempFile ( prefix , "." + suffix ) ; writeToFile ( inputStream , file ) ; return file ; }
Writes from an InputStream to a temporary file