BUG 2302 : odl-clustering-test-app should not be part of the odl-restconf-all feature set
[controller.git] / opendaylight / northbound / commons / src / main / java / org / opendaylight / controller / northbound / commons / exception / UnsupportedMediaTypeException.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.controller.northbound.commons.exception;
10
11 import javax.ws.rs.WebApplicationException;
12 import javax.ws.rs.core.Response;
13 import javax.ws.rs.core.MediaType;
14
15 /**
16  * Status Code 415 (Unsupported Media Type)
17  *
18  * The server is refusing to service the request because the entity of
19  * the request is in a format not supported by the requested resource
20  * for the requested method.
21  *
22  *
23  *
24  */
25 public class UnsupportedMediaTypeException extends WebApplicationException {
26     private static final long serialVersionUID = 1L;
27
28     public UnsupportedMediaTypeException(String string) {
29         super(Response.status(Response.Status.UNSUPPORTED_MEDIA_TYPE).entity(
30                 string).type(MediaType.TEXT_PLAIN).build());
31     }
32 }