@@ 293-298 (lines=6) @@ | ||
290 | * @throws NotFoundException |
|
291 | * @throws AlreadyExistsException |
|
292 | */ |
|
293 | public function rename(string $from, string $to): bool { |
|
294 | $path1 = $this->escapePath($from); |
|
295 | $path2 = $this->escapePath($to); |
|
296 | $output = $this->execute('rename ' . $path1 . ' ' . $path2); |
|
297 | return $this->parseOutput($output, $to); |
|
298 | } |
|
299 | ||
300 | /** |
|
301 | * Upload a local file |
|
@@ 310-315 (lines=6) @@ | ||
307 | * @throws NotFoundException |
|
308 | * @throws InvalidTypeException |
|
309 | */ |
|
310 | public function put(string $source, string $target): bool { |
|
311 | $path1 = $this->escapeLocalPath($source); //first path is local, needs different escaping |
|
312 | $path2 = $this->escapePath($target); |
|
313 | $output = $this->execute('put ' . $path1 . ' ' . $path2); |
|
314 | return $this->parseOutput($output, $target); |
|
315 | } |
|
316 | ||
317 | /** |
|
318 | * Download a remote file |
|
@@ 327-332 (lines=6) @@ | ||
324 | * @throws NotFoundException |
|
325 | * @throws InvalidTypeException |
|
326 | */ |
|
327 | public function get(string $source, string $target): bool { |
|
328 | $path1 = $this->escapePath($source); |
|
329 | $path2 = $this->escapeLocalPath($target); //second path is local, needs different escaping |
|
330 | $output = $this->execute('get ' . $path1 . ' ' . $path2); |
|
331 | return $this->parseOutput($output, $source); |
|
332 | } |
|
333 | ||
334 | /** |
|
335 | * Open a readable stream to a remote file |