*/
package org.opendaylight.netconf.md.sal.rest.schema;
-import java.io.IOException;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.ext.Provider;
import javax.xml.stream.XMLStreamException;
import org.opendaylight.restconf.common.schema.SchemaExportContext;
+import org.opendaylight.yangtools.yang.common.YangConstants;
import org.opendaylight.yangtools.yang.model.export.YinExportUtils;
@Provider
-@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE })
+@Produces({ YangConstants.RFC6020_YIN_MEDIA_TYPE })
public class SchemaExportContentYinBodyWriter implements MessageBodyWriter<SchemaExportContext> {
@Override
@Override
public void writeTo(final SchemaExportContext context, final Class<?> type, final Type genericType,
final Annotation[] annotations, final MediaType mediaType,
- final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException,
- WebApplicationException {
+ final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws
+ WebApplicationException {
try {
- YinExportUtils.writeModuleToOutputStream(context.getSchemaContext(), context.getModule(), entityStream);
+ YinExportUtils.writeModuleAsYinText(context.getModule(), entityStream);
} catch (final XMLStreamException e) {
throw new IllegalStateException(e);
}
-
}
}