|
|||||||||
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.GSObject
public class GSObject
A Google Storage object.
Field Summary |
---|
Fields inherited from class org.jets3t.service.model.StorageObject |
---|
bucketName, dataInputFile, dataInputStream, isMetadataComplete, METADATA_HEADER_HASH_MD5, METADATA_HEADER_ORIGINAL_HASH_MD5, storageClass |
Constructor Summary | |
---|---|
GSObject()
Create an object without any associated information whatsoever. |
|
GSObject(java.io.File file)
Create an object representing a file. |
|
GSObject(java.lang.String key)
Create an object without any associated data, and no associated bucket. |
|
GSObject(java.lang.String key,
java.lang.String dataString)
Create an object representing text data. |
Method Summary | |
---|---|
static GSObject[] |
cast(StorageObject[] objects)
|
java.lang.Object |
clone()
|
GSAccessControlList |
getAcl()
|
void |
setAcl(GSAccessControlList acl)
Set the object's ACL. |
java.lang.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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GSObject(java.io.File file) throws java.security.NoSuchAlgorithmException, java.io.IOException
Mimetypes
), and a content length matching the file's size.
The file's MD5 hash value is also calculated and provided to the service so it
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.
java.io.IOException
- when an i/o error occurred reading the file
java.security.NoSuchAlgorithmException
- when this JRE doesn't support the MD5 hash algorithmpublic GSObject(java.lang.String key, java.lang.String dataString) throws java.security.NoSuchAlgorithmException, java.io.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 the service
so it 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.
java.io.IOException
java.security.NoSuchAlgorithmException
- when this JRE doesn't support the MD5 hash algorithmpublic GSObject(java.lang.String key)
key
- the key name for the object.public GSObject()
Method Detail |
---|
public java.lang.String toString()
toString
in class StorageObject
public GSAccessControlList getAcl()
getAcl
in class StorageObject
public void setAcl(GSAccessControlList acl)
acl
- public java.lang.Object clone()
clone
in class StorageObject
public static GSObject[] cast(StorageObject[] objects)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |