return name.endsWith(".torrent");
}
};
try {
Tracker t = new Tracker(new InetSocketAddress(portValue.intValue()));
File parent = new File(directory);
for (File f : parent.listFiles(filter)) {
logger.info("Loading torrent from " + f.getName());
t.announce(TrackedTorrent.load(f));
}
logger.info("Starting tracker with {} announced torrents...",
t.getTrackedTorrents().size());
t.start();
} catch (Exception e) {
logger.error("{}", e.getMessage(), e);
System.exit(2);
}
}