From: Jakub Toth Date: Wed, 5 Oct 2016 13:33:07 +0000 (+0200) Subject: Bug 6848 - update url pattern of restconf from 16 to 17 X-Git-Tag: release/carbon~180 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=1927682ff5f558c9120aafbf68bee75a5d5cfb07;p=netconf.git Bug 6848 - update url pattern of restconf from 16 to 17 Change-Id: I41882d048a3aede5f4c47c3e160537f7a31a1fab Signed-off-by: Jakub Toth --- diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java index 373dbb5adc..179d2ad59c 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java @@ -70,7 +70,7 @@ public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsPr final MultivaluedMap httpHeaders, final InputStream entityStream) throws IOException, WebApplicationException { try { - if(getUriInfo().getAbsolutePath().getPath().contains("restconf/16")){ + if (getUriInfo().getAbsolutePath().getPath().contains(RestconfConstants.DRAFT_PATTERN)) { final org.opendaylight.restconf.jersey.providers.JsonNormalizedNodeBodyReader jsonReaderNewRest = new org.opendaylight.restconf.jersey.providers.JsonNormalizedNodeBodyReader(); jsonReaderNewRest.injectParams(getUriInfo(), getRequest()); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java index 37baa231e7..8359ee0b1d 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java @@ -34,6 +34,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType; +import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlUtils; @@ -93,7 +94,7 @@ public class XmlNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsPro final MultivaluedMap httpHeaders, final InputStream entityStream) throws IOException, WebApplicationException { try { - if (getUriInfo().getAbsolutePath().getPath().contains("restconf/16")) { + if (getUriInfo().getAbsolutePath().getPath().contains(RestconfConstants.DRAFT_PATTERN)) { final org.opendaylight.restconf.jersey.providers.XmlNormalizedNodeBodyReader xmlReaderNewRest = new org.opendaylight.restconf.jersey.providers.XmlNormalizedNodeBodyReader(); xmlReaderNewRest.injectParams(getUriInfo(), getRequest()); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/RestconfConstants.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/RestconfConstants.java index 67b01edf19..b6a2f9f067 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/RestconfConstants.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/RestconfConstants.java @@ -23,6 +23,7 @@ public final class RestconfConstants { public static final SimpleDateFormat REVISION_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); public static final char SLASH = '/'; public static final Splitter SLASH_SPLITTER = Splitter.on(SLASH); + public static final String DRAFT_PATTERN = "restconf/17"; private RestconfConstants() { throw new UnsupportedOperationException("Util class"); diff --git a/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml b/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml index 3153c2f9bc..e93219b820 100644 --- a/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml +++ b/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml @@ -60,7 +60,7 @@ Restconf - /16/* + /17/*