Add method to return all defined networks.
[xudocci.git] / src / main / java / net / pterodactylus / xdcc / core / Core.java
index fb3e61e..b157851 100644 (file)
@@ -17,6 +17,7 @@
 
 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;
@@ -158,6 +159,15 @@ public class Core extends AbstractExecutionThreadService {
        }
 
        /**
+        * 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.
         *