mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
Specify copy option to overwrite existing temp file, otherwise Files.copy throws FileAlreadyExistsException (#5268)
This commit is contained in:
parent
5de19e3214
commit
22eb72791c
@ -27,6 +27,7 @@ import java.io.InputStream;
|
|||||||
|
|
||||||
{{^supportJava6}}
|
{{^supportJava6}}
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.StandardCopyOption;
|
||||||
{{/supportJava6}}
|
{{/supportJava6}}
|
||||||
{{#supportJava6}}
|
{{#supportJava6}}
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
@ -581,7 +582,7 @@ public class ApiClient {
|
|||||||
try {
|
try {
|
||||||
File file = prepareDownloadFile(response);
|
File file = prepareDownloadFile(response);
|
||||||
{{^supportJava6}}
|
{{^supportJava6}}
|
||||||
Files.copy(response.readEntity(InputStream.class), file.toPath());
|
Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||||
{{/supportJava6}}
|
{{/supportJava6}}
|
||||||
{{#supportJava6}}
|
{{#supportJava6}}
|
||||||
// Java6 falls back to commons.io for file copying
|
// Java6 falls back to commons.io for file copying
|
||||||
|
Loading…
Reference in New Issue
Block a user