AzureBlobFileSystem.AzureBlobStorageProvider.EnsurePathIsRelativeAndEnsureContainer C# (CSharp) Method

EnsurePathIsRelativeAndEnsureContainer() private method

private EnsurePathIsRelativeAndEnsureContainer ( string &path ) : CloudBlobContainer
path string
return CloudBlobContainer
        private CloudBlobContainer EnsurePathIsRelativeAndEnsureContainer(ref string path)
        {
            var containerName = path.Split('/').First();

            CloudBlobContainer container;
            lock (_lock)
            {
                container = Containers.SingleOrDefault(c => c.Name == containerName);

                if (container == null)
                {
                    container = BlobClient.GetContainerReference(containerName);

                    if (!container.Exists())
                    {
                        container = ContainerFactory(containerName);
                    }

                    Containers.Add(container);
                }
            }

            if (path.StartsWith("/") || path.StartsWith("http://") || path.StartsWith("https://"))
                throw new ArgumentException("Path must be relative");

            path = string.Join("/", path.Split('/').Skip(1));

            return container;
        }