7e1e036683b9aba55a0405ed30ebae9bdb236f0c
[neutron.git] / northbound-api / src / main / java / org / opendaylight / neutron / northbound / api / BadRequestException.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.neutron.northbound.api;
10
11 import javax.ws.rs.WebApplicationException;
12 import javax.ws.rs.core.MediaType;
13 import javax.ws.rs.core.Response;
14
15 /**
16  * Status Code 400 (Bad Request)
17  *
18  * <p>
19  * The request could not be understood by the server due to malformed syntax.
20  * The client SHOULD NOT repeat the request without modifications.
21  */
22 public class BadRequestException extends WebApplicationException {
23     private static final long serialVersionUID = 1L;
24
25     public BadRequestException(String string) {
26         super(Response.status(Response.Status.BAD_REQUEST).entity(string).type(MediaType.TEXT_PLAIN).build());
27     }
28 }