Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Contents: 

Table of Contents


Note

User resources are configured to be stored in the root cache space, defined by default as /data/home/xnat/cache. Cache spaces are not considered to be reliable long-term storage; many XNAT administrators set up cron jobs to clear this space.

...

Returns all resource directories for the currently logged-in user. User resources are stored in the file system at CACHE_HOME/users/USERID/resources

Code Block
GET - /data/user/cache/resources/

...

Code Block
PUT - /data/user/cache/resources/{FOLDER}


Parameters:

{FOLDER}Path parameter – the resource ID
formatOptional querystring parameter
contentOptional querystring parameter
tagsOptional querystring parameter

Response:

200OK
412Precondition Failed (Occurs if the user is a guest account)


Get User Cache Resource File Listing

Code Block
GET - /data/user/cache/resources/{FOLDER}/files

Parameters:

{FOLDER}Path parameter – the resource ID
format
  • XML (default)
  • html
  • json
  • csv

Response:

Code Block
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body>
    <table class="x_rs_t" cellpadding="0" cellspacing="0">
        <thead class="x_rs_thead">
            <tr class="x_rs_tr_head">
                <th>Name</th><th>Size</th><th>URI</th>
            </tr>
        </thead>
        <tbody id="dataRows">
            <tr class="x_rs_tr_data odd">
                <td>test.txt</td><td>4</td><td><a href='/xnat/data/user/cache/resources/junk/files/test.txt'>/data/user/cache/resources/junk/files/test.txt</a></td>
            </tr>
        </tbody>
    </table>
</body>
</html>

...

Code Block
PUT - /data/user/cache/resources/{FOLDER}/files/{FILE}

Parameters:

{FOLDER}Path parameter – the resource ID
{FILE}Path parameter – the filename you wish to save your file as
fileForm data – the file you wish to upload

Response: None


Delete A File From A User Cache Resource

Code Block
DELETE - /data/user/cache/resources/{FOLDER}/files/{FILE}

Parameters:

{FOLDER}Path parameter – the resource ID
{FILE}Path parameter – the filename you wish to delete