* * @param {String} filename * @param {String} content
(filename, content)
| 102 | * @param {String} content |
| 103 | */ |
| 104 | createFile(filename, content) { |
| 105 | filename = Path.join(this.#path, filename); |
| 106 | return new Promise((resolve, reject) => { |
| 107 | sftp.isConnected((connectionID) => { |
| 108 | (async () => { |
| 109 | if (this.#notConnected(connectionID)) { |
| 110 | try { |
| 111 | await this.connect(); |
| 112 | } catch (error) { |
| 113 | reject(error); |
| 114 | return; |
| 115 | } |
| 116 | } |
| 117 | sftp.createFile( |
| 118 | filename, |
| 119 | content ? content : "", |
| 120 | async (_res) => { |
| 121 | resolve(Url.join(this.#base, filename)); |
| 122 | }, |
| 123 | (err) => { |
| 124 | reject(err); |
| 125 | }, |
| 126 | ); |
| 127 | })(); |
| 128 | }); |
| 129 | }); |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * |
nothing calls this directly
no test coverage detected