1 11 package org.eclipse.pde.internal.core.builders; 12 13 import java.io.BufferedInputStream ; 14 import java.io.IOException ; 15 import java.io.InputStream ; 16 17 import javax.xml.parsers.ParserConfigurationException ; 18 19 import org.eclipse.core.resources.IFile; 20 import org.eclipse.core.runtime.CoreException; 21 import org.eclipse.pde.internal.core.util.SAXParserWrapper; 22 import org.xml.sax.SAXException ; 23 24 public class DefaultSAXParser { 25 26 public static void parse(IFile file, XMLErrorReporter reporter) { 27 InputStream stream = null; 28 SAXParserWrapper parser = null; 29 try { 30 parser = new SAXParserWrapper(); 31 stream = new BufferedInputStream (file.getContents()); 32 parser.parse(stream, reporter); 33 } catch (CoreException e) { 34 } catch (SAXException e) { 35 } catch (IOException e) { 36 } catch (ParserConfigurationException e) { 37 } finally { 38 try { 39 if (stream != null) 40 stream.close(); 41 } catch (IOException e1) { 42 } 43 } 44 } 45 46 } 47 | Popular Tags |