/* * $Id $ * Copyright (c) 2003 mihi * Licensed under the GNU Public License (GPL) as published by the * Free Software Foundation, using version 2 or later of the GPL. You * should have recieved the GPL with this source code, otherwise see * http://www.fsf.org/copyleft/ */ import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.URL; import java.net.URLConnection; public class FetchSeeds { /** * Fetch seednodes. * * @param destination the dir to store the seednodes to * @param sourceURL the URL to fetch the seednode from - must end * with a slash * @return whether new seed nodes could be fetched */ public static boolean fetchSeeds(File destination, String sourceURL) { InputStream in = null; try { URL source = new URL(sourceURL); URLConnection con = source.openConnection(); in = con.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String line; while ((line = br.readLine()) != null) { int pos = line.indexOf(" "); System.out.println(" or FetchSeeds "); System.out.println(" or FetchSeeds "); System.out.println("The default seedURL is http://dev.i2p.net/i2pdb/"); return; } } }