public static async Task CreateWithParentAsync()

in client/Apache.ShenYu.Client/Utils/CollectionExtentions.cs [35:67]


        public static async Task CreateWithParentAsync(
            this ZooKeeper zooKeeper,
            string path,
            byte[] data,
            List<ACL> acl,
            CreateMode createMode
            )
        {
            var paths = path.Split('/');
            var cur = "";
            foreach (var item in paths)
            {
                if (string.IsNullOrEmpty(item))
                {
                    continue;
                }
                cur += $"/{item}";
                var existStat = await zooKeeper.existsAsync(cur, null);
                if (existStat != null)
                {
                    continue;
                }

                if (cur.Equals(path))
                {
                    await zooKeeper.createAsync(cur, data, acl, createMode);
                }
                else
                {
                    await zooKeeper.createAsync(cur, null, acl, createMode);
                }
            }
        }