Constants

All constants are accessible through the callback.DAVSDK.Constants class.

Error Codes

DAVSDK_ERR_OK
Value: 0
Success.
DAVSDK_ERR_FILE_NOT_FOUND
Value: 2
File or directory not found.
DAVSDK_ERR_PATH_NOT_FOUND
Value: 3
Path or parent not found.
DAVSDK_ERR_PROPERTY_NOT_FOUND
Value: 4
Property not found.
DAVSDK_ERR_ACCESS_DENIED
Value: 5
Access Denied. Used to signal insufficient permissions for item access.
DAVSDK_ERR_INVALID_HANDLE
Value: 6
Invalid item handle. Used to signal an invalid value in various *Context and *Handle parameters. Can be returned by both the component's methods and application event handlers.
DAVSDK_ERR_WRITE_FAULT
Value: 29
The operation of writing the data to the backend storage has failed or has been denied by the storage.
DAVSDK_ERR_READ_FAULT
Value: 30
The operation of reading the data from the backend storage has failed or has been denied by the storage.
DAVSDK_ERR_GENERAL_FAILURE
Value: 31
General failure. The reason for the failure could not be determined.
DAVSDK_ERR_LOCK_VIOLATION
Value: 33
Lock violation. When reported by an event handler, should be used when the file is locked and the operation is not possible due to this lock.
DAVSDK_ERR_INVALID_PASSWORD
Value: 86
A password is missing or incorrect. Returned by the component in the REST API when an access is attempted to a share that is password-protected, but a password is either missing or incorrect.
DAVSDK_ERR_INVALID_PARAMETER
Value: 87
Invalid parameter. When returned by the component's method, indicates an unacceptable value of one of the parameters (please refer to the exception message for additional details). When reported by an event handler, should be used only to signal logical errors in the code (e.g. a negative position passed by the component during file reading/writing) and not to communicate something that an event handler cannot handle temporarily or permanently, e.g. due to the backend's limits or some external state.
DAVSDK_ERR_NOT_IMPLEMENTED
Value: 120
The requested operation is either not implemented by an application or has been disabled using the properties and settings.
DAVSDK_ERR_DIR_NOT_EMPTY
Value: 145
The directory being deleted contains files or subdirectories, and recursive deletion was not requested.
DAVSDK_ERR_LOCK_FAILED
Value: 167
A Lock or Unlock operation failed.
DAVSDK_ERR_ALREADY_EXISTS
Value: 183
An item already exists. When reported by an event handler, should be used to indicate that the operation such as creation, moving, or copying of the item cannot be accomplished because at the destination, there already exists an item with the given name or Id.
DAVSDK_ERR_ITEM_READONLY
Value: 348
An item cannot be moved, deleted, or written to because it is read-only.
DAVSDK_ERR_OPERATION_ABORTED
Value: 995
An operation has been aborted on the transport level (e.g. due to the premature closing of a socket by the client).
DAVSDK_ERR_DISK_OPERATION_FAILED
Value: 1127
A catch-all error code that can be used to tell the component that a backend filesystem operation has failed.
DAVSDK_ERR_USER_NOT_FOUND
Value: 1253
A user with the given username could not be found.
DAVSDK_ERR_CONTENT_BLOCKED
Value: 1296
An upload or download operation was blocked by the application, likely due to invalid content.
DAVSDK_ERR_CONDITION_NOT_SATISFIED
Value: 3060
The HTTP request contained conditions (such as modification period, range of data in a file, or etag) that could not be satisfied.

Desired Operation Values

ACCESS_TYPE_DELETE
Value: 0x00000001
The file or directory is being deleted.
ACCESS_TYPE_RENAME
Value: 0x00000002
The file or directory is being renamed. Renaming doesn't involve opening of a file for reading and is performed within the same directory.
ACCESS_TYPE_MOVE
Value: 0x00000004
The file or directory is being moved. The event is fired for a source file or directory. A separate event is also fired for a destination directory with the ACCESS_TYPE_WRITE flag.
ACCESS_TYPE_READ
Value: 0x00000008
The file is being opened for reading or for reading and writing.
ACCESS_TYPE_WRITE
Value: 0x00000010
The file is being opened for writing or for reading and writing. For directories, this value means that a new file is about to be created in the directory or be moved into the directory.
ACCESS_TYPE_ENUMERATE
Value: 0x00000020
The directory is being enumerated.
ACCESS_TYPE_GET_ATTR
Value: 0x00000040
Information about the file or directory is requested.
ACCESS_TYPE_SET_ATTR
Value: 0x00000080
An explicit operation of changing file times and attributes is performed.
ACCESS_TYPE_BUILD_PATH
Value: 0x00002000
A human-readable path or a file's parent are being requested. Use this check to provide access to a specific file or directory and prevent its parent directories from becoming known to a user.
ACCESS_TYPE_GET_FILENAME
Value: 0x00008000
A request is made to get a filename.

Sort Order

SORT_ORDER_NONE
Value: 0x00000000
No required sort order. A handler is free to use any ordering, given that the sorting algorithm remains unchanged between calls.
SORT_ORDER_NAME_FS
Value: 0x00000002
Sort by human-readable name and item attributes. Directories should come in the list before files, and both files and directories should be sorted according their human-readable names, lexicographically. In recursive enumerations, an entity that resides in the subdirectory must come later than the subdirectory but before files that reside in the parent of that subdirectory.

The following example helps demonstrate this idea. \Dir \Dir\Z.txt \A_File.bin

SORT_ORDER_NAME_LEX
Value: 0x00000003
Sort by human-readable name, lexicographically. Use common string comparison to match item names.
SORT_ORDER_SIZE
Value: 0x00000004
Sort by item size, then by human-readable name.
SORT_ORDER_MODIFICATION_TIME
Value: 0x00000005
Sort by item modification time, then by human-readable name.
SORT_ORDER_CREATION_TIME
Value: 0x00000006
Sort by item creation time, then by human-readable name.

Item Attributes

ITEM_ATTR_FILE
Value: 0x00000001
The item is a file.
ITEM_ATTR_DIRECTORY
Value: 0x00000002
The item is a directory.
ITEM_ATTR_READONLY
Value: 0x00000040
The file is read-only. DAVServer does not block operations based on this attribute, but it does communicate the status of items and directories to clients based on this attribute.
ITEM_ATTR_ANY_FILE
Value: 0x7FFFFFFF
A mask which includes any and all attributes.

File Access Modes

FILE_ACCESS_READ
Value: 0x00000001
Access for reading.
FILE_ACCESS_WRITE
Value: 0x00000002
Access for writing.
FILE_ACCESS_READWRITE
Value: 0x00000003
Access for reading and writing.

File Open Modes

FILE_OPEN_CREATE_NEW
Value: 0x00000000
Create a new file, fail if a file exists. The file should be opened for writing when this flag is used, but the AccessMode parameter may also specify the need for read access.
FILE_OPEN_CREATE_ALWAYS
Value: 0x00000001
If a file exists, truncate it, otherwise create a new file. The file should be opened for writing when this flag is used, but the AccessMode parameter may also specify the need for read access.
FILE_OPEN_OPEN_EXISTING
Value: 0x00000002
If a file exists, open it, otherwise return an error. Use the AccessMode parameter to determine whether the file is to be opened for reading, writing, or both.
FILE_OPEN_OPEN_ALWAYS
Value: 0x00000003
If a file exists, open it, otherwise create a new file. Use the AccessMode parameter to determine whether the file is to be opened for reading, writing, or both.

Requested Information Flags

ITEM_INFO_EXISTENCE
Value: 0x00000000
Item existence is checked. This pseudo-flag with the numeric value 0 is used when the GetFileInfo event is used to check whether the given item exists. When the RequestedInfo parameter is 0, no file or directory information needs to be returned, and just an error should be reported if the item does not exist.
ITEM_INFO_NAME
Value: 0x00000001
Item name is requested.
ITEM_INFO_PARENTID
Value: 0x00000002
The parent of the item is requested.
ITEM_INFO_SIZE
Value: 0x00000008
File size is requested. If an item is a directory, set the corresponding parameter to 0.
ITEM_INFO_ATTR
Value: 0x00000010
Attributes are requested. If the component needs to find out whether the item is a file or a directory, this flag will be the only one set. During other requests, it may come in a combination with other flags.
ITEM_INFO_TIMES
Value: 0x00000020
Times are requested.
ITEM_INFO_OWNER
Value: 0x00000040
The owner of the file is requested.

Conflict Resolution values

CONFLICT_RES_FAIL
Value: 0x00000000
An existing file may not be overwritten.
CONFLICT_RES_REPLACE
Value: 0x00000001
An existing file should be overwritten.
CONFLICT_RES_RENAME
Value: 0x00000002
A file should be written with a different name. If an item Id includes a file name and a file exists, then the name in the Id should be updated accordingly to reflect the name with which the item was created or stored.