An endpoint that moves a specified file to a specified path. This can also cause renaming - it's an equivalent of Linux's mv command.
- Verb:
POST
- Path:
/file/move
Query parameters:
| Name |
Value |
Default value |
Description |
source |
string |
required |
A path to a file which should be moved. |
destination |
string |
required |
A new path for the file. |
overwrite |
true or false |
false |
Whether to overwrite if there already is a file at the destination path. |
Responses:
204 No Content - when the file was successfully moved.
404 Not Found - when couldn't find the file or if the path is pointing to a directory.
409 Conflict - when there already is a file at the destination path but overwrite is set to false.
400 Bad Request - when the path is invalid or when the new path is invalid.
Extra info
The new path of the file should be also verified with isPathValid to make sure the outcome will be what user expects.
User can request to move file /docs/private/poetry.md to /docs/private/hidden/art.md. It means that:
- Directory
hidden needs to be created.
- File
poetry.md needs to be copied as art.md to the hidden directory.
- File
poetry.md needs to be deleted.
If the overwrite is set to true and the destination points to an already existing file, it will be overwritten.
An endpoint that moves a specified file to a specified path. This can also cause renaming - it's an equivalent of Linux's
mvcommand.POST/file/moveQuery parameters:
sourcedestinationoverwritetrueorfalsefalseResponses:
204 No Content- when the file was successfully moved.404 Not Found- when couldn't find the file or if the path is pointing to a directory.409 Conflict- when there already is a file at the destination path butoverwriteis set to false.400 Bad Request- when the path is invalid or when the new path is invalid.Extra info
The new path of the file should be also verified with
isPathValidto make sure the outcome will be what user expects.User can request to move file
/docs/private/poetry.mdto/docs/private/hidden/art.md. It means that:hiddenneeds to be created.poetry.mdneeds to be copied asart.mdto thehiddendirectory.poetry.mdneeds to be deleted.If the
overwriteis set totrueand the destination points to an already existing file, it will be overwritten.