Add ApiPath.empty()
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / jaxrs / XmlFormattableBody.java
1 /*
2  * Copyright (c) 2024 PANTHEON.tech, s.r.o. 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 package org.opendaylight.restconf.nb.jaxrs;
9
10 import java.io.IOException;
11 import java.io.OutputStream;
12 import javax.ws.rs.Produces;
13 import javax.ws.rs.core.MediaType;
14 import javax.ws.rs.ext.Provider;
15 import org.opendaylight.restconf.api.FormattableBody;
16 import org.opendaylight.restconf.api.MediaTypes;
17
18 @Provider
19 @Produces({ MediaTypes.APPLICATION_YANG_DATA_XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
20 public final class XmlFormattableBody extends FormattableBodyWriter {
21     @Override
22     void writeTo(final FormattableBody body, final OutputStream out) throws IOException {
23         body.formatToXML(out);
24     }
25 }