mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Merge pull request #5469 from hitch17/fix-verifycarddatatest
buildfix for VerifyCardDataTest
This commit is contained in:
commit
b62dc39ea1
3 changed files with 8 additions and 1 deletions
|
@ -47,4 +47,7 @@ class JsonCard {
|
|||
public List<String> variations;
|
||||
public String watermark;
|
||||
public String tcgplayerProductId;
|
||||
public String scryfallId;
|
||||
public boolean isAlternative;
|
||||
public String frameEffect;
|
||||
}
|
||||
|
|
|
@ -20,4 +20,5 @@ public class JsonToken {
|
|||
public String uuid;
|
||||
public String watermark;
|
||||
public boolean isOnlineOnly;
|
||||
public String scryfallId;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.io.FileInputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.text.Normalizer;
|
||||
|
@ -120,7 +121,9 @@ public final class MtgJson {
|
|||
if (stream == null) {
|
||||
File file = new File(filename);
|
||||
if (!file.exists()) {
|
||||
InputStream download = new URL("http://mtgjson.com/v4/json/" + filename).openStream();
|
||||
URLConnection connection = new URL("https://mtgjson.com/json/" + filename).openConnection();
|
||||
connection.setRequestProperty("user-agent", "xmage");
|
||||
InputStream download = connection.getInputStream();
|
||||
Files.copy(download, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
System.out.println("Downloaded " + filename + " to " + file.getAbsolutePath());
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue