Follow-up to dabfb82.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2016-10-13 04:20:03 -04:00
parent dabfb827ee
commit 2d150c9939
2 changed files with 3 additions and 12 deletions

View File

@ -27,15 +27,11 @@ import itdelatrisu.opsu.downloads.Updater;
import itdelatrisu.opsu.render.CurveRenderState; import itdelatrisu.opsu.render.CurveRenderState;
import itdelatrisu.opsu.ui.UI; import itdelatrisu.opsu.ui.UI;
import java.io.IOException;
import org.codehaus.plexus.util.FileUtils;
import org.lwjgl.opengl.Display; import org.lwjgl.opengl.Display;
import org.newdawn.slick.AppGameContainer; import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.Game; import org.newdawn.slick.Game;
import org.newdawn.slick.SlickException; import org.newdawn.slick.SlickException;
import org.newdawn.slick.opengl.InternalTextureLoader; import org.newdawn.slick.opengl.InternalTextureLoader;
import org.newdawn.slick.util.Log;
/** /**
* AppGameContainer extension that sends critical errors to ErrorHandler. * AppGameContainer extension that sends critical errors to ErrorHandler.
@ -148,13 +144,8 @@ public class Container extends AppGameContainer {
BeatmapWatchService.removeListeners(); BeatmapWatchService.removeListeners();
// delete temporary directory // delete temporary directory
if (Options.TEMP_DIR.isDirectory()) { if (Options.TEMP_DIR.isDirectory())
try { Utils.deleteDirectory(Options.TEMP_DIR);
FileUtils.deleteDirectory(Options.TEMP_DIR);
} catch (IOException e) {
Log.warn(String.format("Failed to delete temp dir: %s", Options.TEMP_DIR.getAbsolutePath()), e);
}
}
} }
@Override @Override

View File

@ -346,7 +346,7 @@ public class Utils {
* deletes the directory itself. * deletes the directory itself.
* @param dir the directory to delete * @param dir the directory to delete
*/ */
private static void deleteDirectory(File dir) { public static void deleteDirectory(File dir) {
if (dir == null || !dir.isDirectory()) if (dir == null || !dir.isDirectory())
return; return;