コード例 #1
0
        private static void DeleteAllBlobs(CloudBlobDirectory cloudBlobDirectory) {
            foreach ( var blob in cloudBlobDirectory.ListBlobs() ) {
                if ( blob is CloudBlob ) {
                    ( (CloudBlob)blob ).DeleteIfExists();
                }

                if ( blob is CloudBlobDirectory ) {
                    DeleteAllBlobs((CloudBlobDirectory)blob);
                }
            }
        }
コード例 #2
0
 public StatelessAzureQueueReader(
     string name,
     CloudQueue primaryQueue,
     CloudBlobDirectory container,
     Lazy<CloudQueue> poisonQueue,
     TimeSpan visibilityTimeout)
 {
     _cloudBlob = container;
     _queue = primaryQueue;
     _posionQueue = poisonQueue;
     _queueName = name;
     _visibilityTimeout = visibilityTimeout;
 }
コード例 #3
0
        public static bool TryGetContainerName(
            AzureStoreConfiguration config, 
            CloudBlobDirectory dir,
            out EventStoreId container)
        {
            var topic = dir.Uri.ToString().Remove(0, dir.Container.Uri.ToString().Length).Trim('/');

            container = null;
            if (EventStoreId.IsValid(topic)!= EventStoreId.Rule.Valid)
                return false;
            container = EventStoreId.Parse(topic);
            return IsValid(config, container);
        }
コード例 #4
0
ファイル: AzureFileSystem.cs プロジェクト: Vinna/DeepInSummer
            private static long GetDirectorySize(CloudBlobDirectory directoryBlob) {
                long size = 0;

                foreach ( var blobItem in directoryBlob.ListBlobs() ) {
                    if ( blobItem is CloudBlob )
                        size += ( (CloudBlob)blobItem ).Properties.Length;

                    if ( blobItem is CloudBlobDirectory )
                        size += GetDirectorySize((CloudBlobDirectory)blobItem);
                }

                return size;
            }
コード例 #5
0
ファイル: AzureFileSystem.cs プロジェクト: Vinna/DeepInSummer
 public AzureBlobFolderStorage(CloudBlobDirectory blob, string rootPath) {
     _blob = blob;
     _rootPath = rootPath;
 }
コード例 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CloudBlob"/> class based on an existing instance.
        /// </summary>
        /// <param name="cloudBlob">An existing reference to a blob.</param>
        public CloudBlob(CloudBlob cloudBlob)
        {
            this.attributes = cloudBlob.Attributes;
            this.container = cloudBlob.container;
            this.parent = cloudBlob.parent;

            this.ServiceClient = cloudBlob.ServiceClient;
        }
コード例 #7
0
        private static FileItem ToFileItem(CloudBlobDirectory dir)
        {
            var uriParts = dir.Uri.LocalPath.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);

            return new FileItem
                       {
                           Name = uriParts.Last(),
                           IsDirectory = !dir.Uri.IsFile,
                           Image = "dir.png",
                           Path = string.Join("/", uriParts.Skip(2)),
                           IsPathAbsolute = false,
                           FileSize = "",
                           Modified = "",
                           Extension = ""
                       };
        }
コード例 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BlobStreamingContainer"/> class.
 /// </summary>
 /// <param name="directory">The directory.</param>
 public BlobStreamingContainer(CloudBlobDirectory directory)
 {
     _directory = directory;
 }
コード例 #9
0
 public MsgSetBlobPack(CloudBlobContainer container, string path)
 {
     dir = container.GetDirectoryReference(path);
 }
コード例 #10
0
 public PrefixTreeBlob(CloudBlobContainer container, string path)
 {
     dir = container.GetDirectoryReference(path);
 }
コード例 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureViewContainer"/> class.
 /// </summary>
 /// <param name="directory">The directory.</param>
 public AzureViewContainer(CloudBlobDirectory directory)
 {
     _directory = directory;
 }
コード例 #12
0
 public AzureBlobFolderStorage(CloudBlobDirectory blob) {
     _blob = blob;
 }