FileUpload Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. fileupload. FileUpload
- com.
public final class FileUpload
Provide means to upload file in the Azure Storage using the IoTHub.
Constructor Summary
| Constructor | Description |
|---|---|
| FileUpload(DeviceClientConfig config) |
CONSTRUCTOR |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| void |
closeNow()
Close the file upload cancelling all existing uploads and shutting down the thread pool. |
| synchronized void |
uploadToBlobAsync(String blobName, InputStream inputStream, long streamLength, IotHubEventCallback statusCallback, Object statusCallbackContext)
Upload the file to container, which was associated to the iothub. |
Methods inherited from java.lang.Object
Constructor Details
FileUpload
public FileUpload(DeviceClientConfig config)
CONSTRUCTOR
Parameters:
Throws:
Method Details
closeNow
public void closeNow()
Close the file upload cancelling all existing uploads and shutting down the thread pool.
Throws:
uploadToBlobAsync
public synchronized void uploadToBlobAsync(String blobName, InputStream inputStream, long streamLength, IotHubEventCallback statusCallback, Object statusCallbackContext)
Upload the file to container, which was associated to the iothub. This function will start the upload process, and back the execution to the caller. The upload process will be executed in background. When it is completed, the background thread will trigger the callback with the upload status.
Parameters:
Throws:
null or empty,
inputStream is null or not available,
streamLength is negative,
statusCallback is null
null or empty,
inputStream is null or not available,
streamLength is negative,
statusCallback is null