throw new BadRequestException(MALFORMED_VALUE_MESSAGE); if (length > 1 && value.charAt(1) != '.') throw new BadRequestException(MALFORMED_VALUE_MESSAGE); int firstCharacter = value.codePointAt(0); if (firstCharacter == '1') throw new BadRequestException(MALFORMED_VALUE_MESSAGE); return 1000; throw new BadRequestException(MALFORMED_VALUE_MESSAGE); weight += digit; throw new BadRequestException(MALFORMED_VALUE_MESSAGE);
BadRequestException badRequest = new BadRequestException(Messages.MESSAGES.failedProcessingArguments(method.toString()), e); badRequest.setLoggable(true); throw badRequest;
new MarmottaFilterChain(path, chain).doFilter(request, response); } catch (BadRequestException e) { ((HttpServletResponse)response).sendError(400, e.getMessage());
new MarmottaFilterChain(path, chain).doFilter(request, response); } catch (BadRequestException e) { ((HttpServletResponse)response).sendError(400, e.getMessage());
public QueryParamInjector(final Class type, final Type genericType, final AccessibleObject target, final String paramName, final String defaultValue, final boolean encode, final Annotation[] annotations, final ResteasyProviderFactory factory) { super(type, genericType, paramName, QueryParam.class, defaultValue, target, annotations, factory); this.encode = encode; try { this.encodedName = URLDecoder.decode(paramName, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new BadRequestException(Messages.MESSAGES.unableToDecodeQueryString()); } }
BadRequestException badRequest = new BadRequestException(Messages.MESSAGES.failedProcessingArguments(method.toString()), e); badRequest.setLoggable(true); throw badRequest;
throw new BadRequestException(Messages.MESSAGES.malformedParameters(header)); String name = header.substring(offset, equalsIndex).trim(); offset = equalsIndex + 1; throw new BadRequestException(Messages.MESSAGES.quotedStringIsNotClosed(header)); } while (header.charAt(end - 1) == '\\'); String value = header.substring(offset, end); throw new BadRequestException(Messages.MESSAGES.tailingGarbage(header)); return -1; throw new BadRequestException(Messages.MESSAGES.garbageAfterQuotedString(header)); return itemEndIndex + 1; throw new BadRequestException(Messages.MESSAGES.garbageAfterQuotedString(header)); offset = parameterEndIndex + 1;
BadRequestException badRequest = new BadRequestException(Messages.MESSAGES.failedProcessingArguments(method.toString()), e); badRequest.setLoggable(true); throw badRequest;
throw new BadRequestException(Messages.MESSAGES.malformedParameter(parameter)); String name = parameter.substring(0, equalsIndex).trim(); if (!"q".equals(name)) throw new BadRequestException(Messages.MESSAGES.unsupportedParameter(name)); String value = parameter.substring(equalsIndex + 1).trim(); qualityValue = QualityValue.valueOf(value); throw new BadRequestException(Messages.MESSAGES.emptyFieldInHeader(header)); if (content.equals("*")) result.put(null, qualityValue);
throw new BadRequestException(Messages.MESSAGES.malformedMediaType(header)); String type = header.substring(offset, slashIndex); String subtype;
public static Map<Class<?>, Object> addContextDataLevel() { if (getContextDataLevelCount() == maxForwards) { throw new BadRequestException( Messages.MESSAGES.excededMaximumForwards(getContextData(UriInfo.class).getPath())); } Map<Class<?>, Object> map = new HashMap<Class<?>, Object>(); contextualData.push(map); return map; }
throw new BadRequestException(e);
genericType, annotations, mediaType); if (reader == null) throw new BadRequestException(Messages.MESSAGES.couldNotFindMessageBodyReader(genericType, mediaType)); return reader.readFrom(type, genericType, annotations, mediaType, request.getHttpHeaders().getRequestHeaders(), request
private Date formatDate(String date, String paramName) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); try { return df.parse(date); } catch (ParseException e) { throw new BadRequestException("Invalid value for '" + paramName + "', expected format is yyyy-MM-dd"); } }
throw new BadRequestException(MALFORMED_VALUE_MESSAGE); if (length > 1 && value.charAt(1) != '.') throw new BadRequestException(MALFORMED_VALUE_MESSAGE); int firstCharacter = value.codePointAt(0); if (firstCharacter == '1') throw new BadRequestException(MALFORMED_VALUE_MESSAGE); return 1000; throw new BadRequestException(MALFORMED_VALUE_MESSAGE); weight += digit; throw new BadRequestException(MALFORMED_VALUE_MESSAGE);
throw new BadRequestException(MALFORMED_VALUE_MESSAGE); if (length > 1 && value.charAt(1) != '.') throw new BadRequestException(MALFORMED_VALUE_MESSAGE); int firstCharacter = value.codePointAt(0); if (firstCharacter == '1') throw new BadRequestException(MALFORMED_VALUE_MESSAGE); return 1000; throw new BadRequestException(MALFORMED_VALUE_MESSAGE); weight += digit; throw new BadRequestException(MALFORMED_VALUE_MESSAGE);
public QueryParamInjector(final Class type, final Type genericType, final AccessibleObject target, final String paramName, final String defaultValue, final boolean encode, final Annotation[] annotations, final ResteasyProviderFactory factory) { super(type, genericType, paramName, QueryParam.class, defaultValue, target, annotations, factory); this.encode = encode; try { this.encodedName = URLDecoder.decode(paramName, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new BadRequestException(Messages.MESSAGES.unableToDecodeQueryString()); } }
public QueryParamInjector(Class type, Type genericType, AccessibleObject target, String paramName, String defaultValue, boolean encode, Annotation[] annotations, ResteasyProviderFactory factory) { super(type, genericType, paramName, QueryParam.class, defaultValue, target, annotations, factory); this.encode = encode; try { this.encodedName = URLDecoder.decode(paramName, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new BadRequestException(Messages.MESSAGES.unableToDecodeQueryString()); } }
throw new BadRequestException(Messages.MESSAGES.malformedParameters(header)); String name = header.substring(offset, equalsIndex).trim(); offset = equalsIndex + 1; throw new BadRequestException(Messages.MESSAGES.quotedStringIsNotClosed(header)); } while (header.charAt(end - 1) == '\\'); String value = header.substring(offset, end); throw new BadRequestException(Messages.MESSAGES.tailingGarbage(header)); return -1; throw new BadRequestException(Messages.MESSAGES.garbageAfterQuotedString(header)); return itemEndIndex + 1; throw new BadRequestException(Messages.MESSAGES.garbageAfterQuotedString(header)); offset = parameterEndIndex + 1;
throw new BadRequestException(Messages.MESSAGES.malformedParameter(parameter)); String name = parameter.substring(0, equalsIndex).trim(); if (!"q".equals(name)) throw new BadRequestException(Messages.MESSAGES.unsupportedParameter(name)); String value = parameter.substring(equalsIndex + 1).trim(); qualityValue = QualityValue.valueOf(value); throw new BadRequestException(Messages.MESSAGES.emptyFieldInHeader(header)); if (content.equals("*")) result.put(null, qualityValue);