All pastes #17295 Raw Edit

Unnamed

public text v1 · immutable
#17295 ·published 2005-07-09 05:35 UTC
rendered paste body
Index: src/net/drmods/plugins/irc/IRCNuke.java
===================================================================
--- src/net/drmods/plugins/irc/IRCNuke.java	(revision 1214)
+++ src/net/drmods/plugins/irc/IRCNuke.java	(working copy)
@@ -171,27 +171,6 @@
 			}
 		}
 
-		// rename
-		String toDirPath;
-		String toName = "[NUKED]-" + nukeDir.getName();
-		try {
-			toDirPath = nukeDir.getParentFile().getPath();
-		} catch (FileNotFoundException ex) {
-			logger.fatal("", ex);
-			out.add("FileNotFoundException");
-			return out;
-		}
-		try {
-			nukeDir.renameTo(toDirPath, toName);
-			nukeDir.createDirectory(ftpuser.getName(), ftpuser.getGroup(),
-					"REASON-" + nukemsg);
-		} catch (IOException ex) {
-			logger.warn("", ex);
-			out.add(" cannot rename to \"" + toDirPath + "/" + toName + "\": "
-					+ ex.getMessage());
-			return out;
-		}
-
 		long nukeDirSize = 0;
 		long nukedAmount = 0;
 
@@ -228,6 +207,28 @@
 				.getCommandManagerFactory().getHandlersMap().get(Nuke.class);
 		dpsn.getNukeLog().add(nuke);
 		getGlobalContext().getConnectionManager().dispatchFtpEvent(nuke);
+
+		// rename
+		String toDirPath;
+		String toName = "[NUKED]-" + nukeDir.getName();
+		try {
+			toDirPath = nukeDir.getParentFile().getPath();
+		} catch (FileNotFoundException ex) {
+			logger.fatal("", ex);
+			out.add("FileNotFoundException");
+			return out;
+		}
+		try {
+			nukeDir.renameTo(toDirPath, toName);
+			nukeDir.createDirectory(ftpuser.getName(), ftpuser.getGroup(),
+					"REASON-" + nukemsg);
+		} catch (IOException ex) {
+			logger.warn("", ex);
+			out.add(" cannot rename to \"" + toDirPath + "/" + toName + "\": "
+					+ ex.getMessage());
+			return out;
+		}
+
 		return out;
 	}