Examples of XcapException


Examples of org.cipango.kaleo.xcap.XcapException

  throws ServletException, IOException
  {
    try
    {
      if (XcapService.POST.equals(request.getMethod()))
        throw new XcapException(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
     
      _xcapService.service(request, response);
    }
    catch (Exception e)
    {
View Full Code Here

Examples of org.cipango.kaleo.xcap.XcapException

      os.write(getContent(resource.getDocument().getDom(), false));
      os.close();
    }
    catch (Exception e)
    {
      throw new XcapException("Unable to save document in " + file,
          HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e);
    }
  }
View Full Code Here

Examples of org.cipango.kaleo.xcap.XcapException

      try {     
        DOMParser parser = new DOMParser();
        parser.parse(new InputSource(new ByteArrayInputStream(content.getBytes())));
        document = parser.getDocument();     
      } catch (Throwable e) {
        XcapException e1 = new XcapException("Unable to read XML content",
            HttpServletResponse.SC_CONFLICT, e);
        StringBuffer sb = new StringBuffer();
        sb.append(XcapException.XCAP_ERROR_HEADER);
        sb.append("<not-well-formed/>");
        sb.append(XcapException.XCAP_ERROR_FOOTER);
       
        e1.setContent(XcapException.XCAP_ERROR_CONTENT_TYPE, sb.toString().getBytes());
 
        throw e1;
      }
      if (resource.isAllDocument())
      {
View Full Code Here

Examples of org.cipango.kaleo.xcap.XcapException

      VerifierHandler handler = verifier.getVerifierHandler();
      verifier.verify(document);

      if (!handler.isValid())
      {
        XcapException e1 = new XcapException(
            "Unable to validate document after insertion",
            HttpServletResponse.SC_CONFLICT);
        StringBuffer sb = new StringBuffer();
        sb.append(XcapException.XCAP_ERROR_HEADER);
        sb.append("<schema-validation-error/>");
        sb.append(XcapException.XCAP_ERROR_FOOTER);
        e1.setContent(XcapException.XCAP_ERROR_CONTENT_TYPE, sb
            .toString().getBytes());
        throw e1;
      }
    } catch (XcapException e)
    {
      throw e;
    } catch (Throwable e)
    {
      XcapException e1 = new XcapException(
          "Unable to validate document after insertion",
          HttpServletResponse.SC_CONFLICT, e);
      StringBuffer sb = new StringBuffer();
      sb.append(XcapException.XCAP_ERROR_HEADER);
      sb.append("<schema-validation-error/>");
      sb.append(XcapException.XCAP_ERROR_FOOTER);

      e1.setContent(XcapException.XCAP_ERROR_CONTENT_TYPE, sb.toString()
          .getBytes());
      throw e1;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.