From 2d150c993944878eae8262a41ce54a894197c9b7 Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Thu, 13 Oct 2016 04:20:03 -0400 Subject: [PATCH] Follow-up to dabfb82. Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/Container.java | 13 ++----------- src/itdelatrisu/opsu/Utils.java | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/itdelatrisu/opsu/Container.java b/src/itdelatrisu/opsu/Container.java index 67a4daec..bdabaf42 100644 --- a/src/itdelatrisu/opsu/Container.java +++ b/src/itdelatrisu/opsu/Container.java @@ -27,15 +27,11 @@ import itdelatrisu.opsu.downloads.Updater; import itdelatrisu.opsu.render.CurveRenderState; import itdelatrisu.opsu.ui.UI; -import java.io.IOException; - -import org.codehaus.plexus.util.FileUtils; import org.lwjgl.opengl.Display; import org.newdawn.slick.AppGameContainer; import org.newdawn.slick.Game; import org.newdawn.slick.SlickException; import org.newdawn.slick.opengl.InternalTextureLoader; -import org.newdawn.slick.util.Log; /** * AppGameContainer extension that sends critical errors to ErrorHandler. @@ -148,13 +144,8 @@ public class Container extends AppGameContainer { BeatmapWatchService.removeListeners(); // delete temporary directory - if (Options.TEMP_DIR.isDirectory()) { - try { - FileUtils.deleteDirectory(Options.TEMP_DIR); - } catch (IOException e) { - Log.warn(String.format("Failed to delete temp dir: %s", Options.TEMP_DIR.getAbsolutePath()), e); - } - } + if (Options.TEMP_DIR.isDirectory()) + Utils.deleteDirectory(Options.TEMP_DIR); } @Override diff --git a/src/itdelatrisu/opsu/Utils.java b/src/itdelatrisu/opsu/Utils.java index 9b7e03de..b77bd903 100644 --- a/src/itdelatrisu/opsu/Utils.java +++ b/src/itdelatrisu/opsu/Utils.java @@ -346,7 +346,7 @@ public class Utils { * deletes the directory itself. * @param dir the directory to delete */ - private static void deleteDirectory(File dir) { + public static void deleteDirectory(File dir) { if (dir == null || !dir.isDirectory()) return;