All pastes #86353 Raw Edit

Untitled

public text v1 · immutable
·published 2006-07-12 19:53 UTC
rendered paste body
 private static void unpackdir(File file)
 {
   String[] subfiles = file.list();
   for (int y=0; y<subfiles.length; y++)
   {
    File cfile = new File(file.getPath()+"/"+subfiles[y]);
    if (cfile.isDirectory())
     unpackdir(cfile);

    RE r = new RE(".*\\.r00");
    if(r.match(cfile.getName()))
    {
     System.out.println("Found .r00 file "+cfile);
     tounrar.add(cfile);
    }

    r = new RE(".*\\.part01.rar");
    if(r.match(cfile.getName()))
    {
     System.out.println("Found .part01.rar file "+cfile);
     tounrar.add(cfile);
    }
   }
  }

 private static void unrar()
 {
  //Launch unrar process and monitor exit code
  //tounrar.Add(cfile);
  System.out.println(tounrar.size()+" files to unrar");

  for (int i=0; i<tounrar.size(); i++)
  {
   File file = (File)tounrar.get(i);
   String path = file.getParent();
   String filename = file.getName();
   System.out.println("cd "+path);
   System.out.println("unrar e "+filename);
  }
 }
}