Ftp ClientEx
IFtpClientEx is a higher-level FTP API built on top of IFtpClient. It adds a local cache of FTP entries and high-level FTP operations.
Use case
We will repeat the example from FtpClient but with enhanced capabilities of the IFtpClientEx.
Get the
IFtpClientExmicroservice from the drone.
Create a group of directories:
Create files in the directories:
Refresh the local entry cache from the remote FTP server (drone):
Print all paths to the console. You should see the files and directories you created.
Remove
FolderExamplewith all its contents:
Check that the directory is gone:
Api
IFtpClientEx
Provides a higher-level, convenience API over a low-level MAVLink FTP client.
Property | Type | Description |
|---|---|---|
|
| Gets the underlying low-level FTP client. |
|
| Gets a read-only observable cache of known remote entries. |
Method | Return Type | Description |
|---|---|---|
|
| Refreshes the local entry cache. |
|
| Downloads a remote file into the specified destination stream. |
|
| Downloads a remote file into the specified IBufferWriter. |
|
| Uploads data from the provided stream into a remote file. |
|
| Downloads a remote file using the MAVLink FTP burst-read mode into the specified destination stream. |
|
| Downloads a remote file using the MAVLink FTP burst-read mode into the specified IBufferWriter. |
|
| Removes a remote directory. |
IFtpClientEx.Refresh
Parameter | Type | Description |
|---|---|---|
|
| Remote directory path to refresh. |
|
| If true, refreshes subdirectories recursively; otherwise refreshes only the specified directory. |
|
| Optional cancel token argument. |
IFtpClientEx.DownloadFile
Parameter | Type | Description |
|---|---|---|
|
| Remote file path to download. |
|
| Destination stream that receives the downloaded bytes. |
|
| Optional progress reporter. |
|
| Maximum size of each read chunk. Must not exceed MavlinkFtpHelper.MaxDataSize. |
|
| Optional cancel token argument. |
Parameter | Type | Description |
|---|---|---|
|
| Remote file path to download. |
|
| Destination buffer writer that receives the downloaded bytes. |
|
| Optional progress reporter. |
|
| Maximum size of each read chunk. Must not exceed MavlinkFtpHelper.MaxDataSize. |
|
| Optional cancel token argument. |
IFtpClientEx.UploadFile
Parameter | Type | Description |
|---|---|---|
|
| Remote file path to create/overwrite and upload to. |
|
| Source stream providing bytes to upload. |
|
| Optional progress reporter. |
|
| Optional cancel token argument. |
IFtpClientEx.BurstDownloadFile
Parameter | Type | Description |
|---|---|---|
|
| Remote file path to download. |
|
| Destination stream that receives the downloaded bytes. |
|
| Optional progress reporter. |
|
| Maximum size of each burst chunk. Must not exceed MavlinkFtpHelper.MaxDataSize. |
|
| Optional cancel token argument. |
Parameter | Type | Description |
|---|---|---|
|
| Remote file path to download. |
|
| Destination buffer writer that receives the downloaded bytes. |
|
| Optional progress reporter. |
|
| Maximum size of each burst chunk. Must not exceed MavlinkFtpHelper.MaxDataSize. |
|
| Optional cancel token argument. |
IFtpClientEx.RemoveDirectory
Parameter | Type | Description |
|---|---|---|
|
| Remote directory path to remove. |
|
| If true, removes all children recursively before removing the directory itself. |
|
| Optional cancel token argument. |