val static MOUNT_MODULE = "yang-ext"
val static MOUNT_NODE = "mount"
public val static MOUNT = "yang-ext:mount"
+ val static URI_ENCODING_CHAR_SET = "ISO-8859-1"
+ val static URI_SLASH_PLACEHOLDER = "%2F";
@Property
var SchemaContext globalSchema;
private def InstanceIdWithSchemaNode toIdentifier(String restconfInstance, boolean toMountPointIdentifier) {
checkPreconditions
- val pathArgs = Lists.newArrayList(Splitter.on("/").split(restconfInstance))
+ val encodedPathArgs = Lists.newArrayList(Splitter.on("/").split(restconfInstance))
+ val pathArgs = urlPathArgsDecode(encodedPathArgs)
pathArgs.omitFirstAndLastEmptyString
if (pathArgs.empty) {
return null;
private def toUriString(Object object) {
if(object === null) return "";
- return URLEncoder.encode(object.toString)
+// return object.toString.replace("/",URI_SLASH_PLACEHOLDER)
+ return URLEncoder.encode(object.toString,URI_ENCODING_CHAR_SET)
}
private def InstanceIdWithSchemaNode collectPathArguments(InstanceIdentifierBuilder builder, List<String> strings,
}
}
+
+ def urlPathArgsDecode(List<String> strings) {
+ val List<String> decodedPathArgs = new ArrayList();
+ for (pathArg : strings) {
+ decodedPathArgs.add(URLDecoder.decode(pathArg, URI_ENCODING_CHAR_SET))
+ }
+ return decodedPathArgs
+ }
+
}