|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jets3t.service.model.BaseStorageItem
org.jets3t.service.model.StorageObject
org.jets3t.service.model.S3Object
public class S3Object
An S3 object.
Field Summary | |
---|---|
static String |
S3_VERSION_ID
|
static String |
STORAGE_CLASS_REDUCED_REDUNDANCY
|
static String |
STORAGE_CLASS_STANDARD
|
Fields inherited from class org.jets3t.service.model.StorageObject |
---|
METADATA_HEADER_HASH_MD5, METADATA_HEADER_ORIGINAL_HASH_MD5 |
Constructor Summary | |
---|---|
S3Object()
Create an object without any associated information whatsoever. |
|
S3Object(File file)
Create an object representing a file. |
|
S3Object(S3Bucket bucket,
File file)
Create an object representing a file. |
|
S3Object(S3Bucket bucket,
String key)
Create an object without any associated data. |
|
S3Object(S3Bucket bucket,
String key,
String dataString)
Create an object representing text data. |
|
S3Object(String key)
Create an object without any associated data, and no associated bucket. |
|
S3Object(String key,
byte[] data)
Create an object representing binary data. |
|
S3Object(String key,
String dataString)
Create an object representing text data. |
Method Summary | |
---|---|
static S3Object[] |
cast(StorageObject[] objects)
|
Object |
clone()
|
String |
getVersionId()
|
void |
setAcl(AccessControlList acl)
Set the object's ACL. |
String |
toString()
|
Methods inherited from class org.jets3t.service.model.BaseStorageItem |
---|
addMetadata, addMetadata, containsMetadata, getMetadata, getMetadataMap, getName, getOwner, removeMetadata, replaceAllMetadata, setName, setOwner |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String STORAGE_CLASS_STANDARD
public static final String STORAGE_CLASS_REDUCED_REDUNDANCY
public static final String S3_VERSION_ID
Constructor Detail |
---|
public S3Object(S3Bucket bucket, File file) throws NoSuchAlgorithmException, IOException
Mimetypes
), and a content length matching the file's size.
The file's MD5 hash value is also calculated and provided to S3, so the service
can verify that no data are corrupted in transit.
NOTE: The automatic calculation of a file's MD5 hash digest as performed by this constructor could take some time for large files, or for many small ones.
bucket
- the bucket the object belongs to, or will be placed in.file
- the file the object will represent. This file must exist and be readable.
IOException
- when an i/o error occurred reading the file
NoSuchAlgorithmException
- when this JRE doesn't support the MD5 hash algorithmpublic S3Object(File file) throws NoSuchAlgorithmException, IOException
Mimetypes
), and a content length matching the file's size.
The file's MD5 hash value is also calculated and provided to S3, so the service
can verify that no data are corrupted in transit.
NOTE: The automatic calculation of a file's MD5 hash digest as performed by this constructor could take some time for large files, or for many small ones.
file
- the file the object will represent. This file must exist and be readable.
IOException
- when an i/o error occurred reading the file
NoSuchAlgorithmException
- when this JRE doesn't support the MD5 hash algorithmpublic S3Object(S3Bucket bucket, String key, String dataString) throws NoSuchAlgorithmException, IOException
text/plain; charset=utf-8
, and a content length matching the
string's length.
The given string's MD5 hash value is also calculated and provided to S3, so the service
can verify that no data are corrupted in transit.
NOTE: The automatic calculation of the MD5 hash digest as performed by this constructor could take some time for large strings, or for many small ones.
bucket
- the bucket the object belongs to, or will be placed in.key
- the key name for the object.dataString
- the text data the object will contain. Text data will be encoded as UTF-8.
This string cannot be null.
IOException
NoSuchAlgorithmException
- when this JRE doesn't support the MD5 hash algorithmpublic S3Object(String key, String dataString) throws NoSuchAlgorithmException, IOException
text/plain; charset=utf-8
, and a content length matching the
string's length.
The given string's MD5 hash value is also calculated and provided to S3, so the service
can verify that no data are corrupted in transit.
NOTE: The automatic calculation of the MD5 hash digest as performed by this constructor could take some time for large strings, or for many small ones.
key
- the key name for the object.dataString
- the text data the object will contain. Text data will be encoded as UTF-8.
This string cannot be null.
IOException
NoSuchAlgorithmException
- when this JRE doesn't support the MD5 hash algorithmpublic S3Object(String key, byte[] data) throws NoSuchAlgorithmException, IOException
application/octet-stream
, and a content length matching the
byte array's length.
The MD5 hash value of the byte data is also calculated and provided to the target
service, so the service can verify that no data are corrupted in transit.
key
- the key name for the object.data
- the byte data the object will contain, cannot be null.
IOException
NoSuchAlgorithmException
- when this JRE doesn't support the MD5 hash algorithmpublic S3Object(String key)
key
- the key name for the object.public S3Object(S3Bucket bucket, String key)
bucket
- the bucket the object belongs to, or will be placed in.key
- the key name for the object.public S3Object()
Method Detail |
---|
public String toString()
toString
in class StorageObject
public void setAcl(AccessControlList acl)
x-amz-acl
.
setAcl
in class StorageObject
acl
- public String getVersionId()
public Object clone()
clone
in class StorageObject
public static S3Object[] cast(StorageObject[] objects)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |