Example #1
0
 // harvest directory
 public void harvestDir(File dir) throws Exception {
   File f = new File(dir, INDEX);
   if (f.exists()) {
     System.out.println("Ignoring harvest dest " + dir);
     return;
   }
   System.out.println("Searching " + dir + " ...");
   File[] fs = dir.listFiles();
   for (int i = 0; i < fs.length; i++) harvest(fs[i]);
 }
Example #2
0
 // constructor
 public Harvest(File destDir) throws Exception {
   this.destDir = destDir;
   if (!destDir.exists()) destDir.mkdir();
   if (!destDir.isDirectory()) throw new Exception("Can't create dest dir " + destDir);
   File finx = new File(destDir, INDEX);
   inxwrt = new PrintWriter(new FileWriter(finx), true);
   ninxs = 0;
   mmlIDs = new Hashtable<Integer, String>();
   pappl = new PApplication(new String[0]);
 }