com.amazonaws.services.s3.model
Class S3Object

java.lang.Object
  extended by com.amazonaws.services.s3.model.S3Object

public class S3Object
extends Object

Represents an object stored in Amazon S3, including the actual data content, and the object metadata stored by Amazon S3 (such as Content-Type, Content-Length, etc).


Constructor Summary
S3Object()
           
 
Method Summary
 String getBucketName()
          Gets the name of the bucket in which this object is contained.
 String getKey()
          Gets the key under which this object is stored.
 InputStream getObjectContent()
          Gets an input stream containing the contents of this object.
 ObjectMetadata getObjectMetadata()
          Gets the metadata stored by Amazon S3 for this object.
 void setBucketName(String bucketName)
          Sets the name of the bucket in which this object is contained.
 void setKey(String key)
          Sets the key under which this object is stored.
 void setObjectContent(InputStream objectContent)
          Sets the input stream containing this object's contents.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

S3Object

public S3Object()
Method Detail

getObjectMetadata

public ObjectMetadata getObjectMetadata()
Gets the metadata stored by Amazon S3 for this object. The S3ObjectMetadata object includes any custom user metadata supplied by the caller when the object was uploaded, as well as HTTP metadata such as Content-Length and Content-Type.

Returns:
The metadata stored by Amazon S3 for this object.

getObjectContent

public InputStream getObjectContent()
Gets an input stream containing the contents of this object. Callers should be sure to close this input stream as soon as possible, since the object contents aren't buffered in memory and stream directly from Amazon S3.

Returns:
An input stream containing the contents of this object.

setObjectContent

public void setObjectContent(InputStream objectContent)
Sets the input stream containing this object's contents.

Parameters:
objectContent - The input stream containing this object's contents.

getBucketName

public String getBucketName()
Gets the name of the bucket in which this object is contained.

Returns:
The name of the bucket in which this object is contained.

setBucketName

public void setBucketName(String bucketName)
Sets the name of the bucket in which this object is contained.

Parameters:
bucketName - The name of the bucket containing this object.

getKey

public String getKey()
Gets the key under which this object is stored.

Returns:
The key under which this object is stored.

setKey

public void setKey(String key)
Sets the key under which this object is stored.

Parameters:
key - The key under which this object is stored.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.