Examples of RESTException


Examples of org.apache.wink.common.RestException

            result = handler.getResult();
            if (result instanceof JAXBElement<?>) {
                result = ((JAXBElement<?>)result).getValue();
            }
        } catch (IllegalStateException e) {
            throw new RestException("failed to unmarshal object", e);
        } catch (JAXBException e) {
            throw new RestException("failed to unmarshal object", e);
        }
        return result;
    }
View Full Code Here

Examples of org.apache.wink.common.RestException

            // will receive all the
            // SAX events
            ContentHandler xmlSerializer = handler.asContentHandler();
            marshaller.marshal(jaxbObject, xmlSerializer);
        } catch (JAXBException e) {
            throw new RestException("failed to marshal object (" + jaxbObject.getClass().getName()
                + ")", e);
        }
    }
View Full Code Here

Examples of org.apache.wink.common.RestException

                    for (String key : keys) {
                        try {
                            attributes = processingInstructions.get(key);
                            super.processingInstruction(key, attributes);
                        } catch (SAXException e) {
                            throw new RestException("failed to add processing instruction '" + key
                                + "' with attributes '"
                                + attributes
                                + "'", e);
                        }
                    }
View Full Code Here

Examples of org.apache.wink.common.RestException

                specialContentHandler = new SpecialContentHandler(target);
                try {
                    specialContentHandler.startDocument();
                } catch (SAXException e) {
                    // shouldn't happen
                    throw new RestException("xmlSerializer failed", e);
                }
            }
View Full Code Here

Examples of org.apache.wink.common.RestException

            public String endSpecialContent() {
                try {
                    specialContentHandler.endDocument();
                } catch (SAXException e) {
                    // shouldn't happen
                    throw new RestException("xmlSerializer failed", e);
                }
                String contentStr = specialContentHandler.getResult();
                return contentStr;
            }
View Full Code Here

Examples of org.apache.wink.common.RestException

    public boolean hasNext() {
        if (!moved) {
            try {
                lastMoveResult = MPParser.nextPart();
            } catch (IOException e) {
                throw new RestException(e);
            }
            moved = true;
            index++;
        }
        return lastMoveResult;
View Full Code Here

Examples of org.apache.wink.common.RestException

        this.any = any;
    }

    public void checkValidity() {
        if (src != null && any != null) {
            throw new RestException("Content element may have either inline or out-of-line content");
        } else if (src != null && type != null) {
            if (type.equals("text") || type.equals("html") || type.equals("xhtml")) {
                throw new RestException(
                                        "Type attribute of content element must be a valid mime type when content is out-of-line");
            }
        }
    }
View Full Code Here

Examples of org.camunda.bpm.engine.rest.exception.RestException

    protected InputStream getInputStream(FileItemStream stream) {
      try {
        return stream.openStream();
      } catch (IOException e) {
        throw new RestException(Status.INTERNAL_SERVER_ERROR, e);
      }
    }
View Full Code Here

Examples of org.camunda.bpm.engine.rest.exception.RestException

      while (itemIterator.hasNext()) {
        FileItemStream stream = itemIterator.next();
        multipartFormData.addPart(new FormPart(stream));
      }
    } catch (Exception e) {
      throw new RestException(Status.BAD_REQUEST, e, "multipart/form-data cannot be processed");

    }
  }
View Full Code Here

Examples of org.camunda.bpm.engine.rest.exception.RestException

    TypedValue value = null;
    try {
       value = getVariableEntity(variableName, deserializeValue);
    } catch (ProcessEngineException e) {
      String errorMessage = String.format("Cannot get %s variable %s: %s", getResourceTypeName(), variableName, e.getMessage());
      throw new RestException(Status.INTERNAL_SERVER_ERROR, e, errorMessage);
    }

    if (value == null) {
      String errorMessage = String.format("%s variable with name %s does not exist", getResourceTypeName(), variableName);
      throw new InvalidRequestException(Status.NOT_FOUND, errorMessage);
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.