package net.pterodactylus.xdcc.core;
+import static net.pterodactylus.xdcc.data.Channel.TO_NETWORK;
import static net.pterodactylus.xdcc.data.Download.FILTER_RUNNING;
import java.io.File;
}
/**
+ * Returns all defined networks.
+ *
+ * @return All defined networks
+ */
+ public Collection<Network> networks() {
+ return FluentIterable.from(channels).transform(TO_NETWORK).toSet();
+ }
+
+ /**
* Returns all configured channels. Due to various circumstances, configured
* channels might not actually be joined.
*
return;
}
- /* remove download. */
- downloads.remove(pack.name(), download.get());
-
/* stop the DCC receiver. */
if (download.get().dccReceiver() != null) {
download.get().dccReceiver().stop();
+ } else {
+ /* remove download if it hasn’t started yet. */
+ downloads.remove(pack.name(), download.get());
}
/* remove the request from the bot, too. */