Пример #1
0
        public RackspaceCloudFilesSynchronizer(RemoteInfo ri, string container, SynchronizeDirection syncDirection)
        {
            this.disposed      = false;
            this.username      = ri.accountName;
            this.apiKey        = ri.accountKey;
            this.syncDirection = syncDirection;
            this.container     = container;
            try
            {
                var cloudIdentity = new CloudIdentity()
                {
                    APIKey = this.apiKey, Username = this.username
                };
                var         cloudFilesProvider      = new CloudFilesProvider(cloudIdentity);
                ObjectStore createContainerResponse = cloudFilesProvider.CreateContainer(container);// assume default region for now

                if (!createContainerResponse.Equals(ObjectStore.ContainerCreated) && !createContainerResponse.Equals(ObjectStore.ContainerExists))
                {
                    Console.WriteLine("Container creation failed! Response: " + createContainerResponse.ToString());
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception in creating container: " + e);
            }
        }