Beispiel #1
0
        /// <summary>
        /// Creates an instance of IFileSystem for a namespace other than the default.
        /// </summary>
        /// <param name="namespaceName">The name of the namespace upon which the file system operates</param>
        /// <returns></returns>
        public IFileSystem Create(FileSystemNamespace namespaceName)
        {
            IFileSystem fs = null;

            // TODO refactor this ugly pattern
            if (namespaceName == FileSystemNamespace.CSS)
            {
                fs = new AzureStorageFileSystem(_css, "css", false);
            }
            else if (namespaceName == FileSystemNamespace.JavaScript)
            {
                fs = new AzureStorageFileSystem(_css, "javascript", false);
            }
            else if (namespaceName == FileSystemNamespace.ReplicationStorageDebug)
            {
                fs = new AzureStorageFileSystem(_css, "replication-debug", true);
            }
            else if (namespaceName == FileSystemNamespace.ReplicationStorageE1)
            {
                fs = new AzureStorageFileSystem(_css, "replication-e1", true);
            }
            else if (namespaceName == FileSystemNamespace.ReplicationStorageE2)
            {
                fs = new AzureStorageFileSystem(_css, "replication-e2", true);
            }

            return(fs);
        }
        /// <summary>
        /// Creates an instance of IFileSystem for a namespace other than the default.
        /// </summary>
        /// <param name="namespaceName">The name of the namespace upon which the file system operates</param>
        /// <returns></returns>
        public IFileSystem Create(FileSystemNamespace namespaceName)
        {
            IFileSystem fs = null;

            // TODO refactor this ugly pattern
            if (namespaceName == FileSystemNamespace.CSS)
                fs = new AzureStorageFileSystem(_css, "css", false);
            else if (namespaceName == FileSystemNamespace.JavaScript)
                fs = new AzureStorageFileSystem(_css, "javascript", false);
            else if (namespaceName == FileSystemNamespace.ReplicationStorageDebug)
                fs = new AzureStorageFileSystem(_css, "replication-debug", true);
            else if (namespaceName == FileSystemNamespace.ReplicationStorageE1)
                fs = new AzureStorageFileSystem(_css, "replication-e1", true);
            else if (namespaceName == FileSystemNamespace.ReplicationStorageE2)
                fs = new AzureStorageFileSystem(_css, "replication-e2", true);

            return fs;
        }
Beispiel #3
0
        public static IFileSystem GetFileSystem(FileSystemNamespace fileSystemNamespace)
        {
            var fileSystemFactory = Context.Current.Resolve <IFileSystemFactory>();

            return(fileSystemFactory.Create(fileSystemNamespace));
        }
Beispiel #4
0
 public static IFileSystem GetFileSystem(FileSystemNamespace fileSystemNamespace)
 {
     var fileSystemFactory = Context.Current.Resolve<IFileSystemFactory>();
     return fileSystemFactory.Create(fileSystemNamespace);
 }