InnerUploadApiUtil
class InnerUploadApiUtil
Description: OTA network API interface tool class
method generateQueryString
public String generateQueryString()
Description: Generate query string for upload file
Input parameters: None。
Output parameters: passing query for drone
Related parameters: None。
method generateSignString
public String generateSignString(String appId, String notice, String timestamp, String sKey)
Description: Generate sign string
Input parameters: appId: application id notice: notice timestamp: time stamp of file sKey: application key
Output parameters: sign string return
Related parameters: None。
method joinParamString
private String joinParamString(String appId, String notice, String timestamp)
Description: Joining param strings
Input parameters: appId: application id notice: notice timestamp: time stamp
Output parameters: Join string return
Related parameters: None。
method generateSignString
private String generateSignString(String message, String appKey)
Description: Generate sing string from message and application key
Input parameters: message: message appKey: application key
Output parameters: mac with java value send
Related parameters: None。
method hMacWithJava
private String hMacWithJava(String data, String key)
throws NoSuchAlgorithmException, InvalidKeyException
Description: Create java value with mac
Input parameters: data: string data key: application key
Output parameters: Return string data
Related parameters: NoSuchAlgorithmException,InvalidKeyException。
method getSalt
private String getSalt(int n)
Description: Get salt data with n size
Input parameters: n: size
Output parameters: Salt data passes
Related parameters: None。
method genPreSignedUploadUrl
public void genPreSignedUploadUrl(GenPreSignedUploadUrlReqBean bean,
CommonCallbacks.CompletionCallbackWithParam<GenPreSignedUploadUrlResBean> callback)
Description: Generate sign upload url with callback
Input parameters: bean: model object callback: callback for upload sign url
Output parameters: None。
Related parameters: CompletionCallbackWithParam,GenPreSignedUploadUrlResBean。
method updateStatus
public void updateStatus(UploadReqBean bean, CommonCallbacks.CompletionCallbackWithParam<UploadResBean> callback)
Description: Update status for url request
Input parameters: bean: model object callback: callback for completion
Output parameters: None。
Related parameters: CompletionCallbackWithParam,UploadResBean。
method finishSuccessNotify
public void finishSuccessNotify(FinishNotifyReqBean bean, CommonCallbacks.CompletionCallbackWithParam<UploadResBean> callback)
Description: Passing upload finish notification with callback
Input parameters: bean: finish notify model object callback: callback for notify
Output parameters: None。
Related parameters: CompletionCallbackWithParam,UploadResBean。
method refreshPreSignedUploadUrl
public void refreshPreSignedUploadUrl(FinishNotifyReqBean bean,
CommonCallbacks.CompletionCallbackWithParam<GenPreSignedUploadUrlResBean> callback)
Description: Refreshing upload url
Input parameters: bean: notify request bean class callback: callback for finish refreshing
Output parameters: None。
Related parameters: CompletionCallbackWithParam,GenPreSignedUploadUrlResBean。
method uploadFile
public void uploadFile(File file, String preSignedUploadUrl, FileTypeEnum fileType, FileTransmissionListener<String> listener)
Description: Upload file
Input parameters: file: local file to be uploaded preSignedUploadUrl: pre-signed upload URL fileType: file type FileConstants class has instructions listener: listening interface
Output parameters: None。
Related parameters: None。
method getPreSignedUploadUrl
public String getPreSignedUploadUrl()
Description: Get url which is built
Input parameters: None。
Output parameters: return sign upload url as string
Related parameters: None。
method setPreSignedUploadUrl
public void setPreSignedUploadUrl(String preSignedUploadUrl)
Description: Setting url which which will build
Input parameters: preSignedUploadUrl: object of preSigned Upload Url
Output parameters: None。
Related parameters: None。