* * @param {String} dirname
(dirname)
| 134 | * @param {String} dirname |
| 135 | */ |
| 136 | createDir(dirname) { |
| 137 | dirname = Path.join(this.#path, dirname); |
| 138 | return new Promise((resolve, reject) => { |
| 139 | sftp.isConnected((connectionID) => { |
| 140 | (async () => { |
| 141 | if (this.#notConnected(connectionID)) { |
| 142 | try { |
| 143 | await this.connect(); |
| 144 | } catch (error) { |
| 145 | reject(error); |
| 146 | return; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | sftp.mkdir( |
| 151 | this.#safeName(dirname), |
| 152 | async (_res) => { |
| 153 | resolve(Url.join(this.#base, this.#safeName(dirname))); |
| 154 | }, |
| 155 | (err) => { |
| 156 | reject(err); |
| 157 | }, |
| 158 | ); |
| 159 | })(); |
| 160 | }); |
| 161 | }); |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Write to a file on server |
nothing calls this directly
no test coverage detected