Package org.cruxframework.crux.core.server.rest.spi

Examples of org.cruxframework.crux.core.server.rest.spi.BadRequestException


            properties[i].getWriteMethod().invoke(result, params[i].inject(request));
          }
        }
        catch (Exception e)
        {
      throw new BadRequestException("Can not read request values for ValueObject parameter: " + baseClass.getCanonicalName(),
                      "Can not read request parameter for path: " + request.getUri().getPath(), e);
        }
    return result;
    }
View Full Code Here


    {
      body = StreamUtils.readAsUTF8(is);
    }
    catch (IOException e)
    {
      throw new BadRequestException("Can not read request body for path: " + request.getUri().getPath());
    }
    return extractValue(body, request);
  }
View Full Code Here

          }
                  value = this.reader.readValue(strVal);
                }
                catch (Exception e)
                {
              throw new BadRequestException("Can not read request body for path: " + request.getUri().getPath(), e);
                }
      }
      else
      {
        throw new UnsupportedMediaTypeException("Media type not supported: " + mediaType.toString());
View Full Code Here

    {
      throw f;
    }
    catch (Exception e)
    {
      BadRequestException badRequest = new BadRequestException("Failed processing arguments of " + method.toString(), "Can not invoke requested service with given arguments", e);
      throw badRequest;
    }
  }
View Full Code Here

          {
            return constructor.newInstance(strVal.toCharArray()[0]);
          }
          catch (Exception f)
          {
            throw new BadRequestException(errorMsg, CAN_NOT_INVOKE_USING_ARGUMENTS_MSG, e);   
          }
        }
       
        throw new BadRequestException(errorMsg, CAN_NOT_INVOKE_USING_ARGUMENTS_MSG, e);
      }
    }
    else if (valueOf != null)
    {
      try
      {
        return valueOf.invoke(null, strVal);
      }
      catch (Exception e)
      {
        throw new BadRequestException("Unable to extract parameter from http request: " + getParamSignature(), CAN_NOT_INVOKE_USING_ARGUMENTS_MSG, e);
      }
    }
    return null;
  }
View Full Code Here

      }

      if (segmentIndex + numSegments > request.getUri().getPathSegments().size())
      {

        throw new BadRequestException("Number of matched segments greater than actual", "Can not invoke requested service");
      }
      PathSegment[] encodedSegments = new PathSegment[numSegments];
      PathSegment[] decodedSegments = new PathSegment[numSegments];
      for (int i = 0; i < numSegments; i++)
      {
View Full Code Here

TOP

Related Classes of org.cruxframework.crux.core.server.rest.spi.BadRequestException

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.