diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubProxy.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubProxy.java index 584ad8cb..30f70cbc 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubProxy.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubProxy.java @@ -195,8 +195,8 @@ public final class SubProxy extends BungeeCommon implements Listener { if (recycle.isDirectory()) { int kept = 0; for (File file : recycle.listFiles()) { - try { - if (file.isDirectory()) { + if (file.isDirectory()) { + try { if (new File(recycle, file.getName() + "/info.json").exists()) { FileReader reader = new FileReader(new File(recycle, file.getName() + "/info.json")); YAMLSection info = new YAMLSection(new Gson().fromJson(Util.readAll(reader), Map.class)); @@ -208,16 +208,14 @@ public final class SubProxy extends BungeeCommon implements Listener { } } } - Directories.delete(file); - } else { - Files.delete(file.toPath()); + } catch (Exception e) { + e.printStackTrace(); } - Logger.get("SubServers").info("Removed ./SubServers/Recently Deleted/" + file.getName()); - } catch (Exception e) { - Logger.get("SubServers").warning("Problem scanning ./SubServers/Recently Deleted/" + file.getName()); - e.printStackTrace(); + Directories.delete(file); + } else { Files.delete(file.toPath()); } + Logger.get("SubServers").info("Removed ./SubServers/Recently Deleted/" + file.getName()); } if (kept == 0) { Files.delete(recycle.toPath()); diff --git a/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java b/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java index 69c5520b..72c62576 100644 --- a/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java +++ b/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java @@ -136,8 +136,8 @@ public final class ExHost { if (recycle.isDirectory()) { int kept = 0; for (File file : recycle.listFiles()) { - try { - if (file.isDirectory()) { + if (file.isDirectory()) { + try { if (new File(recycle, file.getName() + "/info.json").exists()) { FileReader reader = new FileReader(new File(recycle, file.getName() + "/info.json")); JSONObject info = new JSONObject(Util.readAll(reader)); @@ -149,16 +149,14 @@ public final class ExHost { } } } - Directories.delete(file); - } else { - Files.delete(file.toPath()); + } catch (Exception e) { + log.error.println(e); } - log.info.println("Removed ./SubServers/Recently Deleted/" + file.getName()); - } catch (Exception e) { - log.error.println("Problem scanning ./SubServers/Recently Deleted/" + file.getName()); - log.error.println(e); + Directories.delete(file); + } else { Files.delete(file.toPath()); } + log.info.println("Removed ./Recently Deleted/" + file.getName()); } if (kept == 0) { Files.delete(recycle.toPath());