Revision 1688 tmp/org.txm.core/src/java/org/txm/scripts/importer/HTMLIndexer.groovy

HTMLIndexer.groovy (revision 1688)
104 104
		String lasttoken;
105 105
		String page;
106 106
		
107
		def inputData = null;
108
		def factory = null;
109
		
107 110
		try
108 111
		{
109 112
			URL url = htmlFile.toURI().toURL();
110 113
			println "process html file "+url;
111
			def inputData = url.openStream();
112
			def factory = XMLInputFactory.newInstance();
114
			inputData = url.openStream();
115
			factory = XMLInputFactory.newInstance();
113 116
			//factory.setXMLResolver resolver
114 117
			//factory.setProperty(factory.IS_VALIDATING, false)
115 118
			factory.setProperty("javax.xml.stream.supportDTD", false);
......
150 153
			}
151 154
			
152 155
		}
153
		catch(Exception e){println("File "+htmlFile+"\n"+e); return false;}
156
		catch(Exception e){println("File "+htmlFile+"\n"+e); 
157
			if (parser != null) parser.close();
158
		if (inputData != null) inputData.close();
159
		return false;}
160
		
161
		if (parser != null) parser.close();
162
		if (inputData != null) inputData.close();
154 163
		return true;
155 164
	}
156 165
	

Also available in: Unified diff