VirtoCommerce.Platform.Data.Asset.FileSystemBlobProvider.Remove C# (CSharp) Method

Remove() public method

Remove folders and blobs by absolute or relative urls
public Remove ( string urls ) : void
urls string
return void
        public void Remove(string[] urls)
        {
            if (urls == null)
            {
                throw new ArgumentNullException("urls");
            }
            foreach (var url in urls)
            {
                var path = GetAbsoluteStoragePathFromUrl(url);
                // get the file attributes for file or directory
                var attr = File.GetAttributes(path);

                //detect whether its a directory or file
                if ((attr & FileAttributes.Directory) == FileAttributes.Directory)
                {
                    Directory.Delete(path, true);
                }
                else
                {
                    File.Delete(path);
                }
            }
        }