tweak the syntax
This commit is contained in:
parent
a3b8f4c917
commit
d5d5b47cdb
@ -372,7 +372,15 @@ public class BrushCommands {
|
||||
if (!file.exists()) {
|
||||
if (!filename.equals("#clipboard") && filename.length() >= 7) {
|
||||
try {
|
||||
URL url = new URL("https://i.imgur.com/" + filenamePng);
|
||||
URL url;
|
||||
if (filename.startsWith("http")) {
|
||||
url = new URL(filename);
|
||||
if (!url.getHost().equals("i.imgur.com")) {
|
||||
throw new FileNotFoundException(filename);
|
||||
}
|
||||
} else {
|
||||
url = new URL("https://i.imgur.com/" + filenamePng);
|
||||
}
|
||||
ReadableByteChannel rbc = Channels.newChannel(url.openStream());
|
||||
stream = Channels.newInputStream(rbc);
|
||||
System.out.println("Loaded " + url);
|
||||
|
Loading…
Reference in New Issue
Block a user