public class OSSObject extends GenericResult implements Closeable
In OSS, every file is an OSSObject and every single file should be less than 5G for using Simple upload, Form upload and Append Upload. Only multipart upload could upload a single file more than 5G. Any object has key, data and user metadata. The key is the object's name and the data is object's file content. The user metadata is a dictionary of key-value entries to store some custom data about the object.
Object naming rules构造器和说明 |
---|
OSSObject() |
限定符和类型 | 方法和说明 |
---|---|
void |
close() |
void |
forcedClose()
Forcefully close the response.
|
String |
getBucketName()
Gets the object's bucket name.
|
String |
getKey()
Gets the object's key.
|
InputStream |
getObjectContent()
Get's the object's content in
InputStream . |
ObjectMetadata |
getObjectMetadata()
Gets the object's metadata
|
void |
setBucketName(String bucketName)
Sets the object's bucket name.
|
void |
setKey(String key)
Sets the object's key.
|
void |
setObjectContent(InputStream objectContent)
Sets the object's content in
InputStream . |
void |
setObjectMetadata(ObjectMetadata metadata)
Sets the object's metadata.
|
String |
toString() |
getClientCRC, getRequestId, getResponse, getServerCRC, setClientCRC, setRequestId, setResponse, setServerCRC
public ObjectMetadata getObjectMetadata()
ObjectMetadata
public void setObjectMetadata(ObjectMetadata metadata)
metadata
- Object's metadata.public InputStream getObjectContent()
InputStream
.InputStream
.public void setObjectContent(InputStream objectContent)
InputStream
.objectContent
- The object's content in InputStream
.public String getBucketName()
public void setBucketName(String bucketName)
bucketName
- The object's bucket name.public String getKey()
public void setKey(String key)
key
- Object Key.public void close() throws IOException
close
在接口中 Closeable
close
在接口中 AutoCloseable
IOException
public void forcedClose() throws IOException
IOException
Copyright © 2019. All Rights Reserved.