--- /dev/null
+/*
+ * XdccDownloader - DccDownloadFailed.java - Copyright © 2013 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.irc.event;
+
+import net.pterodactylus.irc.DccReceiver;
+
+import com.google.common.base.Optional;
+
+/**
+ * Notifies a listener that a DCC download has failed.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+public class DccDownloadFailed {
+
+ /** The DCC receiver. */
+ private final DccReceiver dccReceiver;
+
+ /** The cause of the failure. */
+ private final Throwable cause;
+
+ /**
+ * Creates a new DCC download failed event.
+ *
+ * @param dccReceiver
+ * The DCC receiver
+ * @param cause
+ * The cause of the failure (may be {@code null})
+ */
+ public DccDownloadFailed(DccReceiver dccReceiver, Throwable cause) {
+ this.dccReceiver = dccReceiver;
+ this.cause = cause;
+ }
+
+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the DCC receiver.
+ *
+ * @return The DCC receiver
+ */
+ public DccReceiver dccReceiver() {
+ return dccReceiver;
+ }
+
+ /**
+ * Returns the cause of the failure.
+ *
+ * @return The cause of the failure, or {@link Optional#absent()} if the cause
+ * is unknown
+ */
+ public Optional<Throwable> cause() {
+ return Optional.fromNullable(cause);
+ }
+
+}
--- /dev/null
+/*
+ * XdccDownloader - DccDownloadFinished.java - Copyright © 2013 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.irc.event;
+
+import net.pterodactylus.irc.DccReceiver;
+
+/**
+ * Notifies a listener that a DCC download has successfully finished.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+public class DccDownloadFinished {
+
+ /** The DCC receiver. */
+ private final DccReceiver dccReceiver;
+
+ /**
+ * Creates a new DCC download finished event.
+ *
+ * @param dccReceiver
+ * The DCC receiver
+ */
+ public DccDownloadFinished(DccReceiver dccReceiver) {
+ this.dccReceiver = dccReceiver;
+ }
+
+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the DCC receiver.
+ *
+ * @return The DCC receiver
+ */
+ public DccReceiver dccReceiver() {
+ return dccReceiver;
+ }
+
+}