(
&self,
file_name: &str,
data: Vec<u8>,
file_path: Option<&str>,
)
| 59 | } |
| 60 | |
| 61 | async fn upload_object( |
| 62 | &self, |
| 63 | file_name: &str, |
| 64 | data: Vec<u8>, |
| 65 | file_path: Option<&str>, |
| 66 | ) -> std::io::Result<()> { |
| 67 | let path = match file_path { |
| 68 | Some(file_path) => self.base_path.join(file_path).join(file_name), |
| 69 | None => self.base_path.join(file_name), |
| 70 | }; |
| 71 | if let Some(parent) = path.parent() { |
| 72 | if !parent.exists() { |
| 73 | std::fs::create_dir_all(parent)?; |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | std::fs::write(path, data) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | #[async_trait] |
no test coverage detected