Merge remote-tracking branch 'origin/master' into 6.0.x

This commit is contained in:
William Cheng
2021-03-03 16:19:20 +08:00
1471 changed files with 69970 additions and 14636 deletions

View File

@@ -41,6 +41,8 @@ import java.lang.reflect.Type;
import java.net.URI;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.SecureRandom;
@@ -524,7 +526,7 @@ public class ApiClient {
* with file response. The default value is <code>null</code>, i.e. using
* the system's default tempopary folder.
*
* @see <a href="https://docs.oracle.com/javase/7/docs/api/java/io/File.html#createTempFile">createTempFile</a>
* @see <a href="https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#createTempFile(java.lang.String,%20java.lang.String,%20java.nio.file.attribute.FileAttribute...)">createTempFile</a>
* @return Temporary folder path
*/
public String getTempFolderPath() {
@@ -968,15 +970,15 @@ public class ApiClient {
prefix = filename.substring(0, pos) + "-";
suffix = filename.substring(pos);
}
// File.createTempFile requires the prefix to be at least three characters long
// Files.createTempFile requires the prefix to be at least three characters long
if (prefix.length() < 3)
prefix = "download-";
}
if (tempFolderPath == null)
return File.createTempFile(prefix, suffix);
return Files.createTempFile(prefix, suffix).toFile();
else
return File.createTempFile(prefix, suffix, new File(tempFolderPath));
return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();
}
/**

View File

@@ -47,7 +47,7 @@ import static org.junit.Assert.*;
public class PetApiTest {
private PetApi api = new PetApi();
private static final Logger LOG = LoggerFactory.getLogger(PetApiTest.class);
private final Logger LOG = LoggerFactory.getLogger(PetApiTest.class);
// In the circle.yml file, /etc/host is configured with an entry to resolve petstore.swagger.io to 127.0.0.1
private static String basePath = "http://petstore.swagger.io:80/v2";