@@ 546-558 (lines=13) @@ | ||
543 | * @link https://www.dropbox.com/developers/documentation/http/documentation#files-move |
|
544 | * |
|
545 | */ |
|
546 | public function move($fromPath, $toPath) |
|
547 | { |
|
548 | //From and To paths cannot be null |
|
549 | if (is_null($fromPath) || is_null($toPath)) { |
|
550 | throw new DropboxClientException("From and To paths cannot be null."); |
|
551 | } |
|
552 | ||
553 | //Response |
|
554 | $response = $this->postToAPI('/files/move', ['from_path' => $fromPath, 'to_path' => $toPath]); |
|
555 | ||
556 | //Make and Return the Model |
|
557 | return $this->makeModelFromResponse($response); |
|
558 | } |
|
559 | ||
560 | /** |
|
561 | * Copy a file or folder to a different location |
|
@@ 573-585 (lines=13) @@ | ||
570 | * @link https://www.dropbox.com/developers/documentation/http/documentation#files-copy |
|
571 | * |
|
572 | */ |
|
573 | public function copy($fromPath, $toPath) |
|
574 | { |
|
575 | //From and To paths cannot be null |
|
576 | if (is_null($fromPath) || is_null($toPath)) { |
|
577 | throw new DropboxClientException("From and To paths cannot be null."); |
|
578 | } |
|
579 | ||
580 | //Response |
|
581 | $response = $this->postToAPI('/files/copy', ['from_path' => $fromPath, 'to_path' => $toPath]); |
|
582 | ||
583 | //Make and Return the Model |
|
584 | return $this->makeModelFromResponse($response); |
|
585 | } |
|
586 | ||
587 | /** |
|
588 | * Restore a file to the specific version |
|
@@ 688-700 (lines=13) @@ | ||
685 | * |
|
686 | * @throws \Kunnu\Dropbox\Exceptions\DropboxClientException |
|
687 | */ |
|
688 | public function getTemporaryLink($path) |
|
689 | { |
|
690 | //Path cannot be null |
|
691 | if (is_null($path)) { |
|
692 | throw new DropboxClientException("Path cannot be null."); |
|
693 | } |
|
694 | ||
695 | //Get Temporary Link |
|
696 | $response = $this->postToAPI('/files/get_temporary_link', ['path' => $path]); |
|
697 | ||
698 | //Make and Return the Model |
|
699 | return $this->makeModelFromResponse($response); |
|
700 | } |
|
701 | ||
702 | /** |
|
703 | * Save a specified URL into a file in user's Dropbox |