private Collection buildParentPath()

in mode/cluster/repository/nacos/src/main/java/org/apache/shardingsphere/mode/repository/cluster/nacos/NacosRepository.java [255:266]


    private Collection<KeyValue> buildParentPath(final String key) throws NacosException {
        Collection<KeyValue> result = new LinkedList<>();
        StringBuilder parentPath = new StringBuilder();
        String[] partPath = key.split(PATH_SEPARATOR);
        for (int index = 1; index < partPath.length - 1; index++) {
            String path = parentPath.append(PATH_SEPARATOR).append(partPath[index]).toString();
            if (findExistedInstance(path, false).isEmpty()) {
                result.addAll(build(path));
            }
        }
        return result;
    }