File Management
This command is for advanced users wanting to directly access to the File System API of Mica server.
mica file PATH <CREDENTIALS> [OPTIONS] [EXTRA]
Arguments
Argument |
Description |
---|---|
|
Path of file or folder in the file system, for instance: /study/foo |
Options
Option |
Description |
---|---|
|
Download file. |
|
Upload a local file to a folder in Mica file system, requires the folder to be in DRAFT state. If the destination folder does not exist it will be created. |
|
Create a folder at a specific location, requires the file to be in DRAFT state. |
|
Copy a file to the specified destination folder. |
|
Move a file to the specified destination folder, requires the file to be in DRAFT state. |
|
Delete a file on Mica file system, requires the file to be in DELETED state. |
|
Rename a file, requires the file to be in DRAFT state. |
|
Change file status. |
|
Publish a file, requires the file to be in UNDER_REVIEW state. |
|
Unpublish a file. |
Credentials
Authentication is done by username/password credentials.
Option |
Description |
---|---|
|
Mica server base url. |
|
User name. User with appropriate permissions is expected depending of the REST resource requested. |
|
User password. |
Extras
Option |
Description |
---|---|
|
Show the command help’s message |
|
Verbose output |
Example
Get the JSON representation of file /study/foo/bar.pdf
mica file /study/foo/bar.pdf -mk https://mica-demo.obiba.org -u administrator -p password -j
Download file /study/foo/bar.pdf
mica file /study/foo/bar.pdf -mk https://mica-demo.obiba.org -u administrator -p password --download > bar.pdf
Upload a file to /study/foo
mica file /study/foo -mk https://mica-demo.obiba.org -u administrator -p password --upload ~/bar.pdf
Change status and publish file /study/foo/bar.pdf
mica file /study/foo/bar.pdf -mk https://mica-demo.obiba.org -u administrator -p password --status UNDER_REVIEW
mica file /study/foo/bar.pdf -mk https://mica-demo.obiba.org -u administrator -p password --publish