Beispiel #1
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.xmind.core.internal.dom.XMLLoader#doLoadXMLFile(org.xmind.core.io
   * .IInputSource, java.lang.String)
   */
  protected Document doLoadXMLFile(IInputSource source, String entryPath)
      throws IOException, CoreException {
    try {
      InputStream stream = getInputStream(source, entryPath);
      if (stream == null) {
        throw new CoreException(Core.ERROR_NO_SUCH_ENTRY, entryPath);
      }

      Document doc;
      try {
        DocumentBuilder loader = builder.getDocumentLoader();
        doc = loader.parse(stream);
      } catch (Throwable e) {
        Exception e2 =
            checkChecksum(
                source, entryPath, stream, new CoreException(Core.ERROR_FAIL_PARSING_XML, e));
        if (e2 instanceof IOException) throw (IOException) e2;
        throw (CoreException) e2;
      } finally {
        stream.close();
      }

      Exception ex = checkChecksum(source, entryPath, stream, null);
      if (ex instanceof CoreException) throw (CoreException) ex;

      return doc;
    } finally {
      markLoaded(entryPath);
    }
  }
Beispiel #2
0
 public Document createDocument() {
   return builder.createDocument();
 }