- Timestamp:
- 2004-10-12T12:19:22+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/greenstone3-extensions/vishnu/src/vishnu/builder/LuceneWrapper.java
r8189 r8290 64 64 65 65 public void startIndexing() { 66 67 if( inputDir == null || outputDir == null ){ 68 usage(); 69 System.exit(0); 70 } 71 72 /* check if index dir exists */ 73 File in = new File(inputDir); 74 if (!in.isDirectory()) { 75 System.err.println("input directory ("+inputDir+") not a directory, exiting..."); 76 System.exit(0); 77 } 78 79 /**** check if output directory exists, if not create it ****/ 80 File f = new File(outputDir); 81 if( !f.exists() ){ 82 try { 83 f.mkdirs(); 84 } catch (Exception e) { 85 System.err.println("Couldn't create output directory "+outputDir); 86 System.err.println(e); 87 System.exit(0); 88 } 89 } 66 initialize(); 90 67 try { 91 68 IndexWriter writer = new IndexWriter(outputDir, new StandardAnalyzer(), true); 92 69 // this is a bit of a hack putting import here 93 indexFiles(writer, in, "import/");70 indexFiles(writer, new File(inputDir), "import/"); 94 71 writer.optimize(); 95 72 writer.close();
Note:
See TracChangeset
for help on using the changeset viewer.