public class GSObject extends StorageObject implements java.lang.Cloneable
bucketName, dataInputFile, dataInputStream, isMetadataComplete, METADATA_HEADER_HASH_MD5, METADATA_HEADER_ORIGINAL_HASH_MD5, METADATA_HEADER_SERVER_SIDE_ENCRYPTION, serverSideEncryptionAlgorithm, storageClass
METADATA_HEADER_CONTENT_DISPOSITION, METADATA_HEADER_CONTENT_ENCODING, METADATA_HEADER_CONTENT_LANGUAGE, METADATA_HEADER_CONTENT_LENGTH, METADATA_HEADER_CONTENT_MD5, METADATA_HEADER_CONTENT_TYPE, METADATA_HEADER_CREATION_DATE, METADATA_HEADER_DATE, METADATA_HEADER_ETAG, METADATA_HEADER_LAST_MODIFIED_DATE
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
static GSObject[] |
cast(StorageObject[] objects) |
java.lang.Object |
clone() |
GSAccessControlList |
getAcl() |
void |
setAcl(GSAccessControlList acl)
Set the object's ACL.
|
java.lang.String |
toString() |
addAllMetadata, addMetadata, closeDataInputStream, getBucketName, getContentDisposition, getContentEncoding, getContentLanguage, getContentLength, getContentType, getDataInputFile, getDataInputStream, getETag, getKey, getLastModifiedDate, getMd5HashAsBase64, getMd5HashAsHex, getModifiableMetadata, getServerSideEncryptionAlgorithm, getStorageClass, isDirectoryPlaceholder, isMetadataComplete, setAcl, setBucketName, setContentDisposition, setContentEncoding, setContentLanguage, setContentLength, setContentType, setDataInputFile, setDataInputStream, setETag, setKey, setLastModifiedDate, setMd5Hash, setMetadataComplete, setServerSideEncryptionAlgorithm, setStorageClass, verifyData, verifyData, verifyData
addMetadata, addMetadata, addMetadata, containsMetadata, getCompleteMetadataMap, getHttpMetadata, getHttpMetadataMap, getMetadata, getMetadataCaseInsensitiveFromMap, getMetadataMap, getName, getOwner, getServiceMetadata, getServiceMetadataMap, getUserMetadata, getUserMetadataMap, isMatchingMetadataName, lookupMetadataSubsetMap, removeMetadata, replaceAllMetadata, setName, setOwner
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 filejava.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()
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)