AzureBlobFileSystem.AzureBlobStorageProvider.CreateFile C# (CSharp) Method

CreateFile() public method

public CreateFile ( string path ) : IStorageFile
path string
return IStorageFile
        public IStorageFile CreateFile(string path)
        {
            var container = EnsurePathIsRelativeAndEnsureContainer(ref path);

            if (container.BlobExists(path))
            {
                throw new ArgumentException("File " + path + " already exists");
            }

            var blob = container.GetBlockBlobReference(path);
            var contentType = GetContentType(path);
            if (!String.IsNullOrWhiteSpace(contentType))
            {
                blob.Properties.ContentType = contentType;
            }

            blob.UploadFromByteArray(new byte[0], 0, 0);
            return new AzureBlobFileStorage(blob, this);
        }