Bump versions to 4.0.0-SNAPSHOT
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / md / sal / rest / schema / SchemaExportContentYinBodyWriter.java
index b8a8314d1f7db2f7502ac3ecf9bf5c18038770a8..9f4f8be89ce2b226e1304115e5c3080a02168b63 100644 (file)
@@ -7,7 +7,6 @@
  */
 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;
@@ -19,10 +18,11 @@ import javax.ws.rs.ext.MessageBodyWriter;
 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
@@ -40,13 +40,12 @@ public class SchemaExportContentYinBodyWriter implements MessageBodyWriter<Schem
     @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);
         }
-
     }
 }