DirectorySize
From Tomes Support Wiki
DirectorySize
The DirectorySize request allows the client to determine the size of the content contained in a tree of folders. This endpoint is called before a recursive download is attempted to ensure sufficient room exists on the device. This endpoint must return the total count and size in bytes of all files and folders at the requested path and below, recursively. Directories should be considered to occupy zero bytes, and file sizes must be calculated before any transport compression is applied.
Request
The request contains the "sv" parameter containing the client's version and the "p" parameter containing the desired path encoded with HexEncoding.
http://127.0.0.1:8080/DirectorySize?sv=0100&p=2f53616d706c6544617461
Response
Response is an XML message as follows:
<response> <action>/DirectorySize</action><!-- endpoint echo'd back --> <status>200</status><!-- 200 for ok, 404 for invalid path, 500 if server error, 403 if password required --> <path>/SampleData</path> <!-- Path echo'd back --> <size>13412846</size> <!-- Size of all contained files in bytes, as a decimal --> <count>25</count> <!-- Count of all contained files, excluding directories, decimal --> </response>