Locks
A Lock can be used by your custom-developed applications to implement file locking and concurrency features. These locks are advisory, meaning that while a lock can be created, it does not prevent other API requests from being processed concurrently. You are responsible for checking locks prior to accessing a file.
The lock feature is designed to emulate the locking functionality provided by WebDAV. For a deeper understanding of how the lock mechanism works, refer to the WebDAV specification, which outlines how these endpoints function.
Files.com's WebDAV offering and desktop app leverage this locking API to manage concurrent file operations, ensuring consistency when multiple users or systems interact with the same files. It is not used within the Files.com web interface.
Resource Schema
Required
| Property | Description |
|---|---|
| path String | Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. |
Optional
| Property | Description |
|---|---|
| timeout Int64 | Lock timeout in seconds |
| recursive Bool | Does lock apply to subfolders? |
| exclusive Bool | Is lock exclusive? |
| allow_access_by_any_user Bool | Can lock be modified by users other than its creator? |
Read Only
| Property | Description |
|---|---|
| depth String | |
| owner String | Owner of the lock. This can be any arbitrary string. |
| scope String | |
| token String | Lock token. Use to release lock. |
| type String | |
| user_id Int64 | Lock creator user ID |
| username String | Lock creator username |
Resource Import
This Resource supports importing using the following syntax:
Data Source Schema
Required
| Property | Description |
|---|---|
| path String | Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. |
Read Only
| Property | Description |
|---|---|
| timeout Int64 | Lock timeout in seconds |
| depth String | |
| recursive Bool | Does lock apply to subfolders? |
| owner String | Owner of the lock. This can be any arbitrary string. |
| scope String | |
| exclusive Bool | Is lock exclusive? |
| token String | Lock token. Use to release lock. |
| type String | |
| allow_access_by_any_user Bool | Can lock be modified by users other than its creator? |
| user_id Int64 | Lock creator user ID |
| username String | Lock creator username |