Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ import org.glassfish.jersey.media.multipart.MultiPartFeature;

import java.io.IOException;
import java.io.InputStream;

{{^supportJava6}}
import java.nio.file.Files;
{{/supportJava6}}
{{#supportJava6}}
import org.apache.commons.io.FileUtils;
{{/supportJava6}}
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
Expand Down Expand Up @@ -521,7 +527,13 @@ public class ApiClient {
public File downloadFileFromResponse(Response response) throws ApiException {
try {
File file = prepareDownloadFile(response);
{{^supportJava6}}
Files.copy(response.readEntity(InputStream.class), file.toPath());
{{/supportJava6}}
{{#supportJava6}}
// Java6 falls back to commons.io for file copying
FileUtils.copyToFile(response.readEntity(InputStream.class), file);
{{/supportJava6}}
return file;
} catch (IOException e) {
throw new ApiException(e);
Expand Down