Merge "Fixed for bug : 1171 - issue while creating subnet"
[controller.git] / opendaylight / md-sal / sal-protocolbuffer-encoding / src / main / java / org / opendaylight / controller / cluster / datastore / node / utils / PathUtils.java
1 package org.opendaylight.controller.cluster.datastore.node.utils;
2
3 public class PathUtils {
4     public static String getParentPath(String currentElementPath){
5         String parentPath = "";
6
7         if(currentElementPath != null){
8             String[] parentPaths = currentElementPath.split("/");
9             if(parentPaths.length > 2){
10                 for(int i=0;i<parentPaths.length-1;i++){
11                     if(parentPaths[i].length() > 0){
12                         parentPath += "/" + parentPaths[i];
13                     }
14                 }
15             }
16         }
17         return parentPath;
18     }
19 }