Cloud Storage API v1beta1 (revision 30)



com.google.api.services.storage.model
Class StorageObject.Media

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.json.GenericJson
              extended by com.google.api.services.storage.model.StorageObject.Media
All Implemented Interfaces:
Cloneable, Map<String,Object>
Enclosing class:
StorageObject

public static final class StorageObject.Media
extends GenericJson

Object media data. Provided on your behalf when uploading raw media or multipart/related with an auxiliary media part.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
GenericData.Flags
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
StorageObject.Media()
           
 
Method Summary
 StorageObject.Media clone()
           
 byte[] decodeData()
          URL-safe Base64-encoded data.
 StorageObject.Media encodeData(byte[] data)
          URL-safe Base64-encoded data.
 String getAlgorithm()
          Hash algorithm used.
 String getContentType()
          Content-Type of the object data.
 String getData()
          URL-safe Base64-encoded data.
 String getHash()
          Hash of the data.
 BigInteger getLength()
          Content-Length of the data in bytes.
 String getLink()
          Media download link.
 DateTime getTimeCreated()
          Creation time of the data in RFC 3339 format.
 StorageObject.Media set(String fieldName, Object value)
           
 StorageObject.Media setAlgorithm(String algorithm)
          Hash algorithm used.
 StorageObject.Media setContentType(String contentType)
          Content-Type of the object data.
 StorageObject.Media setData(String data)
          URL-safe Base64-encoded data.
 StorageObject.Media setHash(String hash)
          Hash of the data.
 StorageObject.Media setLength(BigInteger length)
          Content-Length of the data in bytes.
 StorageObject.Media setLink(String link)
          Media download link.
 StorageObject.Media setTimeCreated(DateTime timeCreated)
          Creation time of the data in RFC 3339 format.
 
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
 
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StorageObject.Media

public StorageObject.Media()
Method Detail

getAlgorithm

public String getAlgorithm()
Hash algorithm used. Currently only MD5 is supported. Required if a hash is provided.

Returns:
value or null for none

setAlgorithm

public StorageObject.Media setAlgorithm(String algorithm)
Hash algorithm used. Currently only MD5 is supported. Required if a hash is provided.

Parameters:
algorithm - algorithm or null for none

getContentType

public String getContentType()
Content-Type of the object data.

Returns:
value or null for none

setContentType

public StorageObject.Media setContentType(String contentType)
Content-Type of the object data.

Parameters:
contentType - contentType or null for none

getData

public String getData()
URL-safe Base64-encoded data. This property can be used to insert objects under 64KB in size, and will only be returned in response to the get method for objects so created. When this resource is returned in response to the list method, this property is omitted.

Returns:
value or null for none
See Also:
decodeData()

decodeData

public byte[] decodeData()
URL-safe Base64-encoded data. This property can be used to insert objects under 64KB in size, and will only be returned in response to the get method for objects so created. When this resource is returned in response to the list method, this property is omitted.

Returns:
Base64 decoded value or null for none
Since:
1.14
See Also:
getData()

setData

public StorageObject.Media setData(String data)
URL-safe Base64-encoded data. This property can be used to insert objects under 64KB in size, and will only be returned in response to the get method for objects so created. When this resource is returned in response to the list method, this property is omitted.

Parameters:
data - data or null for none
See Also:
#encodeData()

encodeData

public StorageObject.Media encodeData(byte[] data)
URL-safe Base64-encoded data. This property can be used to insert objects under 64KB in size, and will only be returned in response to the get method for objects so created. When this resource is returned in response to the list method, this property is omitted.

Since:
1.14
See Also:

The value is encoded Base64 or {@code null} for none.


getHash

public String getHash()
Hash of the data. Required if a hash algorithm is provided.

Returns:
value or null for none

setHash

public StorageObject.Media setHash(String hash)
Hash of the data. Required if a hash algorithm is provided.

Parameters:
hash - hash or null for none

getLength

public BigInteger getLength()
Content-Length of the data in bytes.

Returns:
value or null for none

setLength

public StorageObject.Media setLength(BigInteger length)
Content-Length of the data in bytes.

Parameters:
length - length or null for none

getLink

public String getLink()
Media download link.

Returns:
value or null for none

setLink

public StorageObject.Media setLink(String link)
Media download link.

Parameters:
link - link or null for none

getTimeCreated

public DateTime getTimeCreated()
Creation time of the data in RFC 3339 format.

Returns:
value or null for none

setTimeCreated

public StorageObject.Media setTimeCreated(DateTime timeCreated)
Creation time of the data in RFC 3339 format.

Parameters:
timeCreated - timeCreated or null for none

set

public StorageObject.Media set(String fieldName,
                               Object value)
Overrides:
set in class GenericJson

clone

public StorageObject.Media clone()
Overrides:
clone in class GenericJson