mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-13 21:08:34 +00:00
Removing tests. Since we don't do those.
Added /lastcmd. Added /tfupdate, mainly for my own use.
This commit is contained in:
@ -937,13 +937,23 @@ public class TFM_Util
|
||||
return affected;
|
||||
}
|
||||
|
||||
public static void downloadFile(String url, File output_file) throws Exception
|
||||
public static void downloadFile(String url, File output_file) throws java.lang.Exception
|
||||
{
|
||||
downloadFile(url, output_file, false);
|
||||
}
|
||||
|
||||
public static void downloadFile(String url, File output_file, boolean verbose) throws java.lang.Exception
|
||||
{
|
||||
URL website = new URL(url);
|
||||
ReadableByteChannel rbc = Channels.newChannel(website.openStream());
|
||||
FileOutputStream fos = new FileOutputStream(output_file);
|
||||
fos.getChannel().transferFrom(rbc, 0, 1 << 24);
|
||||
fos.close();
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
TFM_Log.info("Downloaded " + url + " to " + output_file.toString() + ".");
|
||||
}
|
||||
}
|
||||
|
||||
public static void adminChatMessage(CommandSender sender, String message, boolean senderIsConsole)
|
||||
|
Reference in New Issue
Block a user