Package org.dbwiki.data.io

Examples of org.dbwiki.data.io.CopyPasteInputHandler


   * @param url
   * @throws org.dbwiki.exception.WikiException
   */
  protected void pasteURL(WikiDataRequest  request, String url) throws org.dbwiki.exception.WikiException {
    if (url != null) {
      CopyPasteInputHandler ioHandler = new CopyPasteInputHandler();
      String sourceURL = url;
      if (sourceURL.indexOf("?") != -1) {
        sourceURL = sourceURL + "&" + RequestParameter.ParameterCopyPasteExport;
      } else {
        sourceURL = sourceURL + "?" + RequestParameter.ParameterCopyPasteExport;
      }
      try {
        new SAXCallbackInputHandler(ioHandler, false).parse(new URL(sourceURL).openStream(), false, false);
      } catch (java.io.IOException ioException) {
        throw new WikiFatalException(ioException);
      } catch (org.xml.sax.SAXException saxException) {
        throw new WikiFatalException(saxException);
      }
      /* TODO: The version parameter may be missing in the source URL when copying from
       * an external source.
       */
      this.database().paste(request.wri().resourceIdentifier(), ioHandler.getPasteNode(), url, request.user());
    } else {
      throw new WikiRequestException(WikiRequestException.InvalidUrl, "(null)");
    }
  }
View Full Code Here

TOP

Related Classes of org.dbwiki.data.io.CopyPasteInputHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.