예제 #1
0
파일: Bucket.cs 프로젝트: neil-119/GAE-NET
        public Bucket(string bucketId, CloudAuthenticator authenticator, StorageConfiguration configuration)
        {
            this._bucketId = bucketId;
            this._authenticator = authenticator;
            this._config = configuration;

            _authenticator.GetInitializer().GZipEnabled = _config.EnableGzip;
            _googleStorageService = new Google.Apis.Storage.v1.StorageService(_authenticator.GetInitializer());
        }
예제 #2
0
        public Bucket(string bucketId, CloudAuthenticator authenticator, StorageConfiguration configuration)
        {
            this._bucketId      = bucketId;
            this._authenticator = authenticator;
            this._config        = configuration;

            _authenticator.GetInitializer().GZipEnabled = _config.EnableGzip;
            _googleStorageService = new Google.Apis.Storage.v1.StorageService(_authenticator.GetInitializer());
        }
예제 #3
0
        private bool IsKeyUsed(CloudAuthenticator authenticator, string key)
        {
            // TODO consider using AllocateIds()
            var result = new Google.Apis.Datastore.v1beta3.DatastoreService(authenticator.GetInitializer()).Projects.Lookup(new LookupRequest
            {
                Keys = new List <Key>
                {
                    new Key
                    {
                        Path = new List <PathElement>
                        {
                            new PathElement
                            {
                                Name = key,
                                Kind = typeof(T).Name
                            }
                        }
                    }
                }
            }, authenticator.GetProjectId()).Execute();

            return(result.Found.Any());
        }