Project

General

Profile

« Previous | Next » 

Revision 53685

Added safeguard parsing of produced xml to catch badly escaped illegal characters (eg etf: \001 escaped as ). Changed harvesting thread execution from ThreadExecutor to Thread.Start

View differences:

Utils.java
164 164
		return null;
165 165
	}
166 166

  
167
	public static Boolean validateXml(String xml){
168
		try {
169
			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
170
			DocumentBuilder builder = factory.newDocumentBuilder();
171
			InputSource is = new InputSource(new StringReader(xml));
172
			builder.parse(is);
173
			return true;
174
		}catch(Exception ex){
175
			return false;
176
		}
177
	}
178

  
167 179
	public static void writeFiles(final Iterable<String> iterable, final String outDir) throws DocumentException, IOException {
168 180

  
169 181
		int skipped = 0;

Also available in: Unified diff