Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



google/appengine/ext/cloud_storage_streams/CloudStorageClient.php

Table of Contents
Copyright 2007 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

Package: Default
CloudStorageClient provides default fail implementations for all of the methods that the stream wrapper might potentially call.

Derived classes then only implement the methods that are relevant to the operations that they perform.

Children
\google\appengine\ext\cloud_storage_streams\CloudStorageDeleteClient
\google\appengine\ext\cloud_storage_streams\CloudStorageWriteClient
\google\appengine\ext\cloud_storage_streams\CloudStorageRenameClient
\google\appengine\ext\cloud_storage_streams\CloudStorageReadClient
\google\appengine\ext\cloud_storage_streams\CloudStorageUrlStatClient
\google\appengine\ext\cloud_storage_streams\CloudStorageDirectoryClient

Constants

> V Constant METADATA_HEADER_PREFIX = 'x-goog-meta-'
Prefix for all metadata headers used when parsing and rendering.
> V Constant DEFAULT_READ_SIZE = 524288
> V Constant DEFAULT_READ_CACHE_EXPIRY_SECONDS = 3600
> V Constant DEFAULT_MAXIMUM_NUMBER_OF_RETRIES = 2
> V Constant DEFAULT_WRITABLE_CACHE_EXPIRY_SECONDS = 600
> V Constant READ_SCOPE = "https://www.googleapis.com/auth/devstorage.read_only"
> V Constant WRITE_SCOPE = "https://www.googleapis.com/auth/devstorage.read_write"
> V Constant FULL_SCOPE = "https://www.googleapis.com/auth/devstorage.full_control"
> V Constant OAUTH_TOKEN_FORMAT = "OAuth %s"
> V Constant PARTIAL_CONTENT_RANGE_FORMAT = "bytes %d-%d/*"
> V Constant FINAL_CONTENT_RANGE_FORMAT = "bytes %d-%d/%d"
> V Constant FINAL_CONTENT_RANGE_NO_DATA = "bytes */%d"
> V Constant DELIMITER = '/'
> V Constant FOLDER_SUFFIX = '_$folder$'
> V Constant WRITABLE_TEMP_FILENAME = "/_ah_is_writable_temp_file"
> V Constant S_IFREG = 32768
> V Constant S_IFDIR = 16384
> V Constant S_IRWXU = 448
> V Constant S_IRUSR = 256
> V Constant S_IWUSR = 128
> V Constant S_IXUSR = 64
> V Constant S_IRWXG = 56
> V Constant S_IRGRP = 32
> V Constant S_IWGRP = 16
> V Constant S_IXGRP = 8
> V Constant S_IRWXO = 7
> V Constant S_IROTH = 4
> V Constant S_IWOTH = 2
> V Constant S_IXOTH = 1
> V Constant CONTENT_RANGE_REGEX = "/bytes\s+(\d+)-(\d+)\/(\d+)/i"
> V Constant MEMCACHE_KEY_FORMAT = "_ah_gs_read_cache_%s_%s"
Memcache key format for caching the results of reads from GCS.

The parameters are the object url (as a string) and the read range, as a string (e.g. bytes=0-512000). Example key for a cloud storage file gs://bucket/object.png _ah_gs_read_cache_https://storage.googleapis.com/bucket/object.png_bytes=0-524287

> V Constant WRITABLE_MEMCACHE_KEY_FORMAT = "_ah_gs_write_bucket_cache_%s"
Memcache key format for caching the results of checking if a bucket is writable.

The only way to check if an app can write to a bucket is by actually writing a file. As the ACL on a bucket is unlikely to change then we can cache the result.

Methods

method public __construct (string $bucket, string $object = null, resource $context = null) : void

Construct an object of CloudStorageClient.

Parameters
Name Type Description
$bucket string

The name of the bucket.

$object string

The name of the object, or null if there is no object.

$context resource

The stream context to use.

method public __destruct () : void

method public close () : void

method public createObjectUrl ( $bucket,  $object = null) : void
static

Create a URL for a target bucket and optional object.

Parameters
Name Type Description
$bucket
$object
Details
VisibleForTesting
method public delete () : void

method public dir_readdir () : void

method public dir_rewinddir () : void

method public eof () : void

method public flush () : void

method public getContentType () : void

Subclass can override this method to return the MIME content type of the underlying GCS object.

method public getMetaData () : void

Subclass can override this method to return the metadata of the underlying GCS object.

method public initialize () : void

method public read ( $count_bytes) : void

Parameters
Name Type Description
$count_bytes
method public seek ( $offset,  $whence) : void

Parameters
Name Type Description
$offset
$whence
method public stat () : void

method public tell () : void

method public write ( $data) : void

Parameters
Name Type Description
$data
Documentation was generated by phpDocumentor 2.0.0a12 .