\google\appengine\ext\cloud_storage_streams\CloudStorageUrlStatClient

FINAL

Cloud Storage Url Stat Client handles stat() calls for objects and buckets.

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.

Constants

METADATA_HEADER_PREFIX

Prefix for all metadata headers used when parsing and rendering.

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

DEFAULT_READ_SIZE

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

DEFAULT_READ_CACHE_EXPIRY_SECONDS

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

DEFAULT_MAXIMUM_NUMBER_OF_RETRIES

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

DEFAULT_CONNECTION_TIMEOUT_SECONDS

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

DEFAULT_WRITABLE_CACHE_EXPIRY_SECONDS

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

READ_SCOPE

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

WRITE_SCOPE

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

FULL_SCOPE

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

OAUTH_TOKEN_FORMAT

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

PARTIAL_CONTENT_RANGE_FORMAT

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

FINAL_CONTENT_RANGE_FORMAT

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

FINAL_CONTENT_RANGE_NO_DATA

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

DELIMITER

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

FOLDER_SUFFIX

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

WRITABLE_TEMP_FILENAME

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IFREG

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IFDIR

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IRWXU

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IRUSR

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IWUSR

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IXUSR

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IRWXG

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IRGRP

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IWGRP

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IXGRP

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IRWXO

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IROTH

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IWOTH

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

S_IXOTH

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

CONTENT_RANGE_REGEX

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

MEMCACHE_KEY_FORMAT

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

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

MEMCACHE_KEY_HASH_FORMAT

Memcache key format for caching the results of reads from GCS. If the key generated using the filename and range is longer than the maximum allowed memcache key we hash down the value and use this format instead.

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

MEMCACHE_KEY_MAX_LENGTH

The maximum length of a memcache key.

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

WRITABLE_MEMCACHE_KEY_FORMAT

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.

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

MAX_KEYS

Methods

__construct

__construct(string $bucket, string $object, resource $context, $flags)

Construct an object of CloudStorageClient.

Parameters

Name 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.

$flags

__destruct

__destruct()

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

initialize

initialize()

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

dir_readdir

dir_readdir()

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

dir_rewinddir

dir_rewinddir()

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

close

close()

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

delete

delete()

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

eof

eof()

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

flush

flush()

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

read

read( $count_bytes)

Parameters

Name Description

$count_bytes

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

seek

seek( $offset, $whence)

Parameters

Name Description

$offset

$whence

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

stat

stat()

The stat function uses GET requests to the bucket to try and determine if the object is a 'file' or a 'directory', by listing the contents of the bucket and then matching the results against the supplied object name.

If a file ends with "/ then Google Cloud console will show it as a 'folder' in the UI tool, so we consider an object that ends in "/" as a directory as well. For backward compatibility, we also treat files with the "_$folder$" suffix as folders.

tell

tell()

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

write

write( $data)

Parameters

Name Description

$data

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

getMetaData

getMetaData()

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

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

getContentType

getContentType()

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

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

createObjectUrl

STATIC   

createObjectUrl( $bucket, $object = null)

Create a URL for a target bucket and optional object.

Parameters

Name Description

$bucket

$object

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

clearStatCache

STATIC   

clearStatCache(string $filename = null)

Clear the stat cache.

Parameters

Name Description

$filename

string

Option filename to clear from the cache.

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient

getReadMemcacheKey

STATIC   

getReadMemcacheKey(string $url, string $range) : string

Create a memcache key for the read data cache. If the filename is long enough that the key would exceed memcache limits, then a hash of the filename and the range is used to generate the key.

We prefer the human readable key format where possible so users can easily identify which files and segments are stored in memcache.

Parameters

Name Description

$url

string

The url of the file that contains the data being cached.

$range

string

The range oheader f the data being cached.

Returns

string

The memcache key to use for storing data.

Inherited from

\google\appengine\ext\cloud_storage_streams\CloudStorageClient