Revision 2129 tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImport.groovy

TSImport.groovy (revision 2129)
12 12
import org.txm.objects.Project
13 13
import org.txm.utils.BundleUtils;
14 14
import org.txm.utils.io.FileCopy;
15
import org.txm.utils.io.IOUtils
15 16
import org.apache.log4j.BasicConfigurator;
16 17
import org.txm.importer.xtz.*
17 18
import org.txm.scripts.importer.xtz.*
......
40 41
		
41 42
		super.start(); // call the usual XTZ import
42 43
		
43
		if (successFul) {
44
		if (isSuccessful) {
44 45

  
45 46
			File tigerDir = new File(this.binaryDirectory, "tiger");
46 47
			tigerDir.mkdir();
......
83 84
				IndexBuilderErrorHandler handler = new SimpleErrorHandler(tigerBinDir.getAbsolutePath());
84 85
				XMLIndexing indexing = new XMLIndexing(corpusName, uri, tigerBinDir.getAbsolutePath(), handler,false);
85 86
				indexing.startIndexing();
87
				File logs = new File(tigerBinDir, "indexing.log");
88
				String txt = IOUtils.getText(logs);
89
				if (txt.contains("Error in corpus graph ")) {
90
					println  "Error while importing TIGER corpus: "+txt;
91
					isSuccessful = false;
92
				}
86 93
			}
87 94
			catch (Exception e) { System.out.println(e.getMessage()); }
88 95
		}

Also available in: Unified diff