diff --git a/src/main/java/morlok8k/MinecraftLandGenerator/Arraylist.java b/src/main/java/morlok8k/MinecraftLandGenerator/Arraylist.java deleted file mode 100644 index fb1ed51..0000000 --- a/src/main/java/morlok8k/MinecraftLandGenerator/Arraylist.java +++ /dev/null @@ -1,61 +0,0 @@ -/* -####################################################################### -# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # -# Version 2, December 2004 # -# # -# Copyright (C) 2004 Sam Hocevar # -# # -# Everyone is permitted to copy and distribute verbatim or modified # -# copies of this license document, and changing it is allowed as long # -# as the name is changed. # -# # -# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # -# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION # -# # -# 0. You just DO WHAT THE FUCK YOU WANT TO. # -# # -####################################################################### -*//* - - - - -*/ -/** - * - *//* - -package morlok8k.MinecraftLandGenerator; - -import java.util.ArrayList; - -*/ -/** - * @author morlok8k - * - *//* - -public class Arraylist { - - */ -/** - * - * @param list - * @param remove - * @return - *//* - - - public static ArrayList arrayListRemove(final ArrayList list, - final ArrayList remove) { - - boolean changed = list.removeAll(remove); - - if (var.verbose) { - System.out.println("ArrayList changed: " + changed); - } - - return list; - } -} -*/ diff --git a/src/main/java/morlok8k/MinecraftLandGenerator/DownloadFile.java b/src/main/java/morlok8k/MinecraftLandGenerator/DownloadFile.java index cb04bea..7f6d592 100644 --- a/src/main/java/morlok8k/MinecraftLandGenerator/DownloadFile.java +++ b/src/main/java/morlok8k/MinecraftLandGenerator/DownloadFile.java @@ -45,6 +45,7 @@ public class DownloadFile { * @return true if download was successful, false if not * @author piegames */ + @Deprecated public static boolean downloadFile(final String url, final boolean Output) { try { URL download = new URL(url); diff --git a/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java b/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java index 8731a3a..38a49b7 100644 --- a/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java +++ b/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java @@ -24,11 +24,11 @@ import org.apache.commons.logging.LogFactory; import org.joml.Vector3i; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * @@ -37,35 +37,10 @@ import java.io.OutputStream; public class Misc { private static Log log = LogFactory.getLog(Main.class); - /** - * I'd love to use nio, but it requires Java 7.
- * I could use Apache Commons, but i don't want to include a library for one little thing.
- * Copies src file to dst file.
- * If the dst file does not exist, it is created
- * - * @author Corrodias - * @param src - * @param dst - * @throws IOException - */ - - // TODO replace with Java Copy Path + @Deprecated public static void copyFile(final File src, final File dst) throws IOException { - final InputStream copyIn = new FileInputStream(src); - final OutputStream copyOut = new FileOutputStream(dst); - - // Transfer bytes from in to out - final byte[] buf = new byte[1024]; - int len; - while ((len = copyIn.read(buf)) >= 0) { - if (len > 0) { - copyOut.write(buf, 0, len); - } - } - copyIn.close(); - copyOut.flush(); - copyOut.close(); + FileUtils.copyFile(src, dst); } //TODO: add description diff --git a/src/main/java/morlok8k/MinecraftLandGenerator/Out.java b/src/main/java/morlok8k/MinecraftLandGenerator/Out.java deleted file mode 100644 index c20bfcc..0000000 --- a/src/main/java/morlok8k/MinecraftLandGenerator/Out.java +++ /dev/null @@ -1,148 +0,0 @@ -/* -####################################################################### -# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # -# Version 2, December 2004 # -# # -# Copyright (C) 2004 Sam Hocevar # -# # -# Everyone is permitted to copy and distribute verbatim or modified # -# copies of this license document, and changing it is allowed as long # -# as the name is changed. # -# # -# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # -# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION # -# # -# 0. You just DO WHAT THE FUCK YOU WANT TO. # -# # -####################################################################### -*//* - - -package morlok8k.MinecraftLandGenerator; - -import javax.swing.JOptionPane; - -import morlok8k.MinecraftLandGenerator.GUI.MLG_GUI; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -*/ -/** - * - * @author morlok8k - *//* - -public class Out { - private static Log log = LogFactory.getLog(Main.class); - - - - */ -/** - * Outputs a formatted string to System.err as a line. - * - * @param str - * String to display and format - * @author Morlok8k - *//* - - public static void err(final String str) { - System.err.println(var.MLGe + str); - } - - */ -/** - * Outputs a formatted string to System.out as a line. - * - * @param str - * String to display and format - * @author Morlok8k - *//* - - public static void out(final String str) { - System.out.println(var.MLG + str); // is there a better/easier way to do this? I just wanted a lazier way to write "System.out.println(MLG + blah..." - } - - */ -/** - * Outputs a formatted string to System.out as a line. - * - * @param str - * String to display and format - * @author Morlok8k - *//* - - public static void outD(final String str) { - System.out.println(var.MLG + "[DEBUG] " + str); - } - - */ -/** - * Outputs a string to System.out without a newline. - * - * @param str - * String to display and format - * @author Morlok8k - *//* - - public static void outP(final String str) { - System.out.print(str); - } - - */ -/** - * Outputs a formatted string to System.out as a line. - * - * @param str - * String to display and format - * @author Morlok8k - *//* - - static void outS(final String str) { - System.out.println("[Server] " + str); - } - - */ -/** - * Makes a dialog box, and outputs a formatted string to System.out as a line. - * - * @param msg - * Message - * @param title - * title - * @param messageType - * JOptionPane messageType - * - * @author Morlok8k - *//* - - public static void msg(final String msg, final String title, final int messageType) { - String msgType = ""; - - switch (messageType) { - case JOptionPane.ERROR_MESSAGE: - msgType = "Error Message"; - break; - case JOptionPane.INFORMATION_MESSAGE: - msgType = "Information Message"; - break; - case JOptionPane.WARNING_MESSAGE: - msgType = "Warning Message"; - break; - case JOptionPane.QUESTION_MESSAGE: - msgType = "Question Message"; - break; - case JOptionPane.PLAIN_MESSAGE: - msgType = "Message"; - break; - default: - msgType = "Message"; - break; - } - - System.out.println("[" + msgType + "] Title: " + title + var.newLine + msg); - JOptionPane.showMessageDialog(MLG_GUI.frmMLG_GUI, msg, title, messageType); - - } -} -*/