[Bluej-discuss] Accessing the archives..

Gordon Royle gordon at csse.uwa.edu.au
Wed Aug 16 00:59:44 BST 2006


[Apologies if this arrives twice - the first time I sent it the mail  
appeared to vanish without trace]


> I realize that this question might have come up previously.  
> Unfortunately
> the archives in http://lists.bluej.org/pipermail/bluej-discuss/  
> consist of
> lots (about 68) of tiny zipped files, so it is impossible to  
> download and
> search them.
>

Whaddya mean.. impossible... if you can do it by hand but it would be  
boring and dull, then get a computer to do it!

Here is a quickly hacked up program to suck them all off the list and  
unzip them...

Just run this and pipe into grep and you'll be done.. or just alter  
the code to do the searching in place...

Cheers

Gordon

import java.net.URL;
import java.util.zip.GZIPInputStream;
import java.io.*;

public class BlueJArchive
{

     private static String[] months =  
{"January","February","March","April","May","June","July","August","Sept 
ember","October","November","December"};

     public static void getEmAll() {
       getYear(2000);
       getYear(2001);
       getYear(2002);
       getYear(2003);
       getYear(2004);
       getYear(2005);
       getYear(2006);
     }

     public static void getYear(int year) {
         for (int month=0; month<((year==2006)?8:12); month++)
          getFile(year+"-"+months[month]);
      }

     public static void getFile(String which) {
       try {
         URL url = new URL("http://lists.bluej.org/pipermail/bluej- 
discuss/"+which+".txt.gz");
         GZIPInputStream gz = new GZIPInputStream(url.openStream());
         BufferedReader br = new BufferedReader(new InputStreamReader 
(gz));

         String s = null;
         do {
           s = br.readLine();
           System.out.println(s);
         } while (s != null);
        } catch (IOException e) {
                System.out.println("error "+e);
      }
   }

    public static void main(String[] args) {
      getEmAll();
    }
}


More information about the bluej-discuss mailing list