PUT Object

函数签名

/**
* Uploads the specified file to galaxy fds with the specified object name
* under the specified bucket.
*
* @param bucketName The name of the bucket to put the object
* @param objectName The name of the object to put
* @param file The file containing the data to be uploaded to fds
* @return A {@link PutObjectResult} containing the information returned by
* galaxy fds for the newly created object
* @throws GalaxyFDSClientException
*/public PutObjectResult putObject(String bucketName, String objectName,
File file)throws GalaxyFDSClientException;
/**
* Uploads the data from the specified input stream to galaxy fds with the
* specified object name under the specified bucket.
*
* @param bucketName The name of the bucket to put the object
* @param objectName The name of the object to put
* @param input The stream containing the data to be uploaded to fds
* @param metadata Additional metadata instructing fds how to handle the
* uploaded data
* @return A {@link PutObjectResult} containing the information returned by
* galaxy fds for the newly created object
* @throws GalaxyFDSClientException
*/public PutObjectResult putObject(String bucketName, String objectName,
InputStream input, FDSObjectMetadata metadata)throws GalaxyFDSClientException;

POST Object

函数签名

/**
* Uploads the specified file to a galaxy fds bucket, an unique object name
* will be returned after successfully uploading.
*
* @param bucketName The name of the bucket to post the object
* @param file The file containing the data to be uploaded to fds
* @return A {@link PutObjectResult} containing the information returned by
* galaxy fds for the newly created object
* @throws GalaxyFDSClientException
*/public PutObjectResult postObject(String bucketName, File file)throws GalaxyFDSClientException;
/**
* Uploads the data from the specified input stream to a galaxy fds bucket, an
* unique object name will be returned after successfully uploading.
*
* @param bucketName The name of the bucket to put the object
* @param input The stream containing the data to be uploaded to fds
* @param metadata Additional metadata instructing fds how to handle the
* uploaded data
* @return A {@link PutObjectResult} containing the information returned by
* galaxy fds for the newly created object
* @throws GalaxyFDSClientException
*/public PutObjectResult postObject(String bucketName, InputStream input,
FDSObjectMetadata metadata)throws GalaxyFDSClientException;

GET Object

函数签名

/**
* Gets the object stored in galaxy fds with the specified name under the
* specified bucket.
*
* @param bucketName The name of the bucket where the object stores
* @param objectName The name of the object to get
* @return The object stored in galaxy fds under the specifed bucket
* @throws GalaxyFDSClientException
*/public FDSObject getObject(String bucketName, String objectName)throws GalaxyFDSClientException;
/**
* Gets the object stored in galaxy fds with the specified name under the
* specified bucket.
*
* @param bucketName The name of the bucket where the object stores
* @param objectName The name of the object to get
* @param pos The position to start read
* @return The object stored in galaxy fds under the specifed bucket
* @throws GalaxyFDSClientException
*/public FDSObject getObject(String bucketName, String objectName, long pos)throws GalaxyFDSClientException;

示例

HEAD Object

函数签名

/**
* Checks if the object with the specified name under the specified bucket
* exists.
*
* @param bucketName The name of the bucket where the object stores
* @param objectName The name of the object to check
* @return The value true if the specified object exists, otherwise false
* @throws GalaxyFDSClientException
*/publicbooleandoesObjectExist(String bucketName, String objectName)throws GalaxyFDSClientException;

示例

boolean exist = fdsClient.doesObjectExist(BUCKET_NAME, OBJECT_NAME);

PUT Object ACL

函数签名

/**
* Sets the AccessControlList(ACL) of the specified fds object.
*
* @param bucketName The name of the bucket where the object stores
* @param objectName The name of the object to set acl
* @param acl The ACL to set for the specified object
* @throws GalaxyFDSClientException
*/publicvoidsetObjectAcl(String bucketName, String objectName,
AccessControlList acl)throws GalaxyFDSClientException;

示例

GET Object ACL

函数签名

/**
* Gets the AccessControlList(ACL) of the specified fds object.
*
* @param bucketName The name of the bucket where the object stores
* @param objectName The name of the object to get acl
* @return The {@link AccessControlList} of the specified object
* @throws GalaxyFDSClientException
*/public AccessControlList getObjectAcl(String bucketName, String objectName)throws GalaxyFDSClientException;

GET Object metadata

函数签名

/**
* Gets the meta information of object with the specified name under the
* specified bucket.
*
* @param bucketName The name of the bucket where the object stores
* @param objectName The name of the object to get the meta inforamtion
* @return The meta information of the object with the specified name under
* the specified bucket
* @throws GalaxyFDSClientException
*/public FDSObjectMetadata getObjectMetadata(String bucketName,
String objectName)throws GalaxyFDSClientException;

DELETE Object

函数签名

/**
* Deletes the object with the specified name under the specified bucket.
*
* @param bucketName The name of the bucket where the object stores
* @param objectName The name of the object to delete
* @throws GalaxyFDSClientException
*/publicvoiddeleteObject(String bucketName, String objectName)throws GalaxyFDSClientException;

Restore Object

函数签名

/**
* Restore the object from trash.
*
* @param bucketName The name of the bucket where the object stores
* @param objectName The name of the object to restore
* @throws GalaxyFDSClientException
*/publicvoidrestoreObject(String bucketName, String objectName)throws GalaxyFDSClientException;

示例

fdsClient.restoreObject(BUCKET_NAME, OBJECT_NAME);

Rename Object

函数签名

/**
* Rename the object with the specified name under the specified bucket.
*
* @param bucketName The name of the bucket where the object stores
* @param srcObjectName The name of the source object
* @param dstObjectName The name of the destination object
* @throws GalaxyFDSClientException
*/publicvoidrenameObject(String bucketName, String srcObjectName, String dstObjectName)throws GalaxyFDSClientException;

示例

fdsClient.renameObject(BUCKET_NAME, OBJECT_NAME, "dst-object-name");

Prefetch Object

函数签名

/**
* Prefetch the specified object to cdn. The object must have public access
* @param bucketName The name of the bucket where the object stores
* @param objectName The name of the object to prefetch
* @throws GalaxyFDSClientException
*/publicvoidprefetchObject(String bucketName, String objectName)throws GalaxyFDSClientException;

示例

fdsClient.prefetchObject(BUCKET_NAME, OBJECT_NAME);

Refresh Object

函数签名

/**
* Refresh the object cached in cdn. The object must have public access
* @param bucketName The name of the bucket where the object stores
* @param objectName The name of the object to refresh
* @throws GalaxyFDSClientException
*/publicvoidrefreshObject(String bucketName, String objectName)throws GalaxyFDSClientException;

示例

其他

Generate presigned URL

函数签名

/**
* Returns a pre-signed URI for accessing Galaxy FDS resource.
*
* @param bucketName The name of the bucket containing the desired object
* @param objectName The name of the desired object
* @param expiration The time at which the returned pre-signed URL will expire
* @return A pre-signed URL which expires at the specified time, and can be
* used to allow anyone to download the specified object from galaxy
* fds, without exposing the owner's Galaxy secret access key.
* @throws GalaxyFDSClientException
*/public URI generatePresignedUri(String bucketName, String objectName,
Date expiration)throws GalaxyFDSClientException;
/**
* Returns a pre-signed CDN URI for accessing Galaxy FDS resource.
*
* @param bucketName The name of the bucket containing the desired object
* @param objectName The name of the desired object
* @param expiration The time at which the returned pre-signed URL will expire
* @return A pre-signed URL which expires at the specified time, and can be
* used to allow anyone to download the specified object from galaxy
* fds, without exposing the owner's Galaxy secret access key.
* @throws GalaxyFDSClientException
*/public URI generatePresignedCdnUri(String bucketName, String objectName,
Date expiration)throws GalaxyFDSClientException;
/**
* Returns a pre-signed URI for accessing Galaxy FDS resource.
*
* @param bucketName The name of the bucket containing the desired object
* @param objectName The name of the desired object
* @param expiration The time at which the returned pre-signed URL will expire
* @param httpMethod The HTTP method verb to use for this URL
* @return A pre-signed URL which expires at the specified time, and can be
* used to allow anyone to access the specified object from galaxy
* fds, without exposing the owner's Galaxy secret access key.
* @throws GalaxyFDSClientException
*/public URI generatePresignedUri(String bucketName, String objectName,
Date expiration, HttpMethod httpMethod)throws GalaxyFDSClientException;
/**
* Returns a pre-signed CDN URI for accessing Galaxy FDS resource.
*
* @param bucketName The name of the bucket containing the desired object
* @param objectName The name of the desired object
* @param expiration The time at which the returned pre-signed URL will expire
* @param httpMethod The HTTP method verb to use for this URL
* @return A pre-signed URL which expires at the specified time, and can be
* used to allow anyone to access the specified object from galaxy
* fds, without exposing the owner's Galaxy secret access key.
* @throws GalaxyFDSClientException
*/public URI generatePresignedCdnUri(String bucketName, String objectName,
Date expiration, HttpMethod httpMethod)throws GalaxyFDSClientException;
/**
* Returns a pre-signed URI for accessing Galaxy FDS resource.
*
* @param bucketName The name of the bucket containing the desired object
* @param objectName The name of the desired object
* @param subResource The subresource of this request
* @param expiration The time at which the returned pre-signed URL will expire
* @param httpMethod The HTTP method verb to use for this URL
* @return A pre-signed URL which expires at the specified time, and can be
* used to allow anyone to access the specified object from galaxy
* fds, without exposing the owner's Galaxy secret access key.
* @throws GalaxyFDSClientException
*/public URI generatePresignedUri(String bucketName, String objectName,
SubResource subResource, Date expiration, HttpMethod httpMethod)throws GalaxyFDSClientException;
/**
* Returns a pre-signed URI for accessing Galaxy FDS resource.
*
* @param bucketName The name of the bucket containing the desired object
* @param objectName The name of the desired object
* @param subResources The subresource list of this request
* @param expiration The time at which the returned pre-signed URL will expire
* @param httpMethod The HTTP method verb to use for this URL
* @return A pre-signed URL which expires at the specified time, and can be
* used to allow anyone to access the specified object from galaxy
* fds, without exposing the owner's Galaxy secret access key.
* @throws GalaxyFDSClientException
*/public URI generatePresignedUri(String bucketName, String objectName,
List<String> subResources, Date expiration, HttpMethod httpMethod)throws GalaxyFDSClientException;
/**
* Returns a pre-signed CDN URI for accessing Galaxy FDS resource.
*
* @param bucketName The name of the bucket containing the desired object
* @param objectName The name of the desired object
* @param subResource The subresource of this request
* @param expiration The time at which the returned pre-signed URL will expire
* @param httpMethod The HTTP method verb to use for this URL
* @return A pre-signed URL which expires at the specified time, and can be
* used to allow anyone to access the specified object from galaxy
* fds, without exposing the owner's Galaxy secret access key.
* @throws GalaxyFDSClientException
*/public URI generatePresignedCdnUri(String bucketName, String objectName,
SubResource subResource, Date expiration, HttpMethod httpMethod)throws GalaxyFDSClientException;
/**
* Returns a pre-signed CDN URI for accessing Galaxy FDS resource.
*
* @param bucketName The name of the bucket containing the desired object
* @param objectName The name of the desired object
* @param subResources The subresource list of this request
* @param expiration The time at which the returned pre-signed URL will expire
* @param httpMethod The HTTP method verb to use for this URL
* @return A pre-signed URL which expires at the specified time, and can be
* used to allow anyone to access the specified object from galaxy
* fds, without exposing the owner's Galaxy secret access key.
* @throws GalaxyFDSClientException
*/public URI generatePresignedCdnUri(String bucketName, String objectName,
List<String> subResources, Date expiration, HttpMethod httpMethod)throws GalaxyFDSClientException;