diff options
Diffstat (limited to 'scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelDescriptorParserSupport.java')
-rw-r--r-- | scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelDescriptorParserSupport.java | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelDescriptorParserSupport.java b/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelDescriptorParserSupport.java index 7d71560bce59..f3f105679677 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelDescriptorParserSupport.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelDescriptorParserSupport.java @@ -32,50 +32,45 @@ import org.openide.filesystems.*; import org.openide.xml.XMLUtil; public class ParcelDescriptorParserSupport - implements ParcelDescriptorParserCookie, FileChangeListener -{ + implements ParcelDescriptorParserCookie, FileChangeListener { private FileObject fo; private Document document; private Set listeners; - public ParcelDescriptorParserSupport(FileObject fo) - { + public ParcelDescriptorParserSupport(FileObject fo) { this.fo = fo; fo.addFileChangeListener(this); } - private synchronized void parseFile() - { + private synchronized void parseFile() { File file = FileUtil.toFile(fo); InputSource is; try { is = new InputSource(new FileInputStream(file)); - } - catch (FileNotFoundException fnfe) { + } catch (FileNotFoundException fnfe) { System.out.println("Couldn't find file: " + file.getName()); return; } document = null; + try { document = XMLUtil.parse(is, false, false, null, null); - } - catch (IOException ioe) { + } catch (IOException ioe) { System.out.println("IO Error parsing file: " + file.getName()); - } - catch (SAXException se) { + } catch (SAXException se) { System.out.println("Sax Error parsing file: " + file.getName()); } } - public synchronized NodeList getScriptElements() - { + public synchronized NodeList getScriptElements() { if (document == null) parseFile(); if (document != null) return document.getElementsByTagName("script"); + return null; } |