Toggle menu

Tidy Store: GET /filestore/http/tidystore

This is an internal method, there shouldn't be any need to use it in your own work.

The tidy store method tidies the file store by removing orphaned files and empty directories. This method may be invoked periodically by a cronjob, preferably at times when the file store is unlikely to be receiving concurrent requests.

Files are considered orphaned if they exist on disk but do not have a corresponding file record.

Due to the asynchronous nature of directory deletions a parent directory cannot be deleted when deleting the last file in a storage directory (eg <root>/1/2/f/<uuid>.ext). This method deletes any of the 4096 possible empty directories. Note that the deletion of empty directories is potentially unsafe at a very low chance if concurrent requests are being made to the file store at the same time.

Request Parameters

None.

Example Request

Tidy Store

Example response - Success

{
    "tidyOrphanedFiles": {
        "deletedFileCount": 1,
        "deletedFiles": [
            "C:\\media\\WkFileStore_storageDir\\0\\1\\0\\f105fc00-64c5-4888-a8d4-c614b758374d.zip"
        ]
    },
    "tidyEmptyDirectories": {
        "visitedDirectoryCount": 37,
        "deletedEmptyDirectoriesCount": 0
    }
}

Last modified on 15 October 2026