Ejemplo n.º 1
0
        public void DownloadFolderContent(IServerPath serverPath, ILocalPath localPath, ILogger logger)
        {
            var items = this.VersionControlServer.GetItems(serverPath.AsString(), VersionSpec.Latest, RecursionType.OneLevel);

            foreach (var item in items.Items)
            {
                if (0 == string.Compare(item.ServerItem, serverPath.AsString(), true))
                {
                    continue;
                }

                var itemServerPath = new ServerPath(item.ServerItem);
                var itemLocalPath  = localPath.Subpath(itemServerPath.GetName());

                if (item.ItemType == ItemType.File)
                {
                    logger.Info($"Download file {item.ServerItem} to {itemLocalPath.AsString()}");
                    item.DownloadFile(itemLocalPath.AsString());
                }
                else
                {
                    DownloadFolderContent(itemServerPath, itemLocalPath, logger);
                }
            }
        }
Ejemplo n.º 2
0
        public void GetName_ReturnsTheLastPartFromThePath(string path)
        {
            var serverPath = new ServerPath(path);

            Assert.AreEqual("Test", serverPath.GetName());
        }