ILIAS
release_7 Revision v7.30-3-g800a261c036
|
Class ilObjFileDAV. More...
Public Member Functions | |
__construct (ilObjFile $a_obj, ilWebDAVRepositoryHelper $repo_helper, ilWebDAVObjDAVHelper $dav_helper) | |
ilObjFileDAV represents the WebDAV-Interface to an ILIAS-Object More... | |
put ($data) | |
Replaces the contents of the file. More... | |
get () | |
Returns the data. More... | |
getName () | |
Returns title of file object. More... | |
getContentType () | |
Returns the mime-type for a file. More... | |
getETag () | |
Returns the ETag for a file. More... | |
getSize () | |
Returns the size of the node, in bytes. More... | |
setName ($a_name) | |
handleFileUpload ($a_data, $a_file_action) | |
Handle uploaded file. More... | |
![]() | |
__construct (ilObject $a_obj, ilWebDAVRepositoryHelper $repo_helper, ilWebDAVObjDAVHelper $dav_helper) | |
Constructor for DAV Object. More... | |
getRefId () | |
Returns the ref id of this object. More... | |
getObjectId () | |
Returns the object id of this object. More... | |
getLastModified () | |
Returns the last modification time as a unix timestamp. More... | |
delete () | |
Deletes the current node. More... | |
setName ($a_name) | |
Renames the node. More... | |
getName () | |
SabreDAV interface function . More... | |
getObject () | |
Returns ILIAS Object. More... | |
Protected Member Functions | |
getPathToDirectory () | |
getPathToFile () | |
This method only exists for legacy reasons. More... | |
checkForVirus (string $file_dest_path) | |
createHistoryAndNotificationForObjUpdate ($a_action) | |
Create history entry and a news notification for file object update. More... | |
deleteObjOrVersion () | |
Delete an object if there is no other version in it otherwise delete version. More... | |
Protected Attributes | |
$resource_manager | |
$resource_consumer | |
$request | |
$versioning_enabled | |
![]() | |
$ref_id | |
$obj | |
$request | |
$repo_helper | |
$dav_helper | |
Class ilObjFileDAV.
Implementation for ILIAS File Objects represented as WebDAV File Objects
Definition at line 19 of file class.ilObjFileDAV.php.
ilObjFileDAV::__construct | ( | ilObjFile | $a_obj, |
ilWebDAVRepositoryHelper | $repo_helper, | ||
ilWebDAVObjDAVHelper | $dav_helper | ||
) |
ilObjFileDAV represents the WebDAV-Interface to an ILIAS-Object
So an ILIAS is needed in the constructor. Otherwise this object would be useless.
ilObjFile | $a_obj | |
ilWebDAVRepositoryHelper | $repo_helper | |
ilWebDAVObjDAVHelper | $dav_helper |
Definition at line 42 of file class.ilObjFileDAV.php.
References $DIC, and ILIAS\GlobalScreen\Provider\__construct().
|
protected |
Definition at line 285 of file class.ilObjFileDAV.php.
References ilLoggerFactory\getLogger(), and ilUtil\virusHandling().
|
protected |
Create history entry and a news notification for file object update.
$a_action |
Definition at line 300 of file class.ilObjFileDAV.php.
References ilHistory\_createEntry().
Referenced by handleFileUpload().
|
protected |
Delete an object if there is no other version in it otherwise delete version.
Definition at line 316 of file class.ilObjFileDAV.php.
References ilUtil\delDir().
ilObjFileDAV::get | ( | ) |
Returns the data.
This method may either return a string or a readable stream resource
Forbidden |
We need this to satisfy the create process on MacOS. MacOS first posts a 0 size file and then reads it again, before then going on to post the real file.
Definition at line 95 of file class.ilObjFileDAV.php.
References getPathToFile(), and getSize().
ilObjFileDAV::getContentType | ( | ) |
Returns the mime-type for a file.
If null is returned, we'll assume application/octet-stream
Definition at line 141 of file class.ilObjFileDAV.php.
ilObjFileDAV::getETag | ( | ) |
Returns the ETag for a file.
An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change.
Return null if the ETag can not effectively be determined.
The ETag must be surrounded by double-quotes, so something like this would make a valid ETag:
return '"someetag"';
Definition at line 160 of file class.ilObjFileDAV.php.
References getName(), getPathToFile(), and getSize().
Referenced by handleFileUpload().
ilObjFileDAV::getName | ( | ) |
Returns title of file object.
If it has a forbidden file extension -> ".sec" will be added
Definition at line 129 of file class.ilObjFileDAV.php.
References ilFileUtils\getValidFilename().
Referenced by getETag().
|
protected |
Definition at line 262 of file class.ilObjFileDAV.php.
Referenced by getPathToFile().
|
protected |
This method only exists for legacy reasons.
ilFileUtilsException |
Definition at line 275 of file class.ilObjFileDAV.php.
References getPathToDirectory(), and ilFileUtils\getValidFilename().
Referenced by get(), getETag(), and handleFileUpload().
ilObjFileDAV::getSize | ( | ) |
Returns the size of the node, in bytes.
Definition at line 186 of file class.ilObjFileDAV.php.
Referenced by get(), getETag(), and put().
ilObjFileDAV::handleFileUpload | ( | $a_data, | |
$a_file_action | |||
) |
Handle uploaded file.
Either it is a new file upload to a directory or it is an upload to replace an existing file.
Given data can be a resource or data (given from the sabreDAV library)
string | resource | $a_data |
Forbidden |
These are temporary shenanigans for ILIAS 7. Will be removed with ILIAS 8 as it will be expected that migration was run.
Definition at line 213 of file class.ilObjFileDAV.php.
References $DIC, $size, CLIENT_DATA_DIR, createHistoryAndNotificationForObjUpdate(), ilPreview\createPreview(), getETag(), getPathToFile(), ilUtil\getUploadSizeLimitBytes(), and ilFileObjectToStorageMigrationRunner\migrate().
Referenced by put().
ilObjFileDAV::put | ( | $data | ) |
Replaces the contents of the file.
The data argument is a readable stream resource.
After a successful put operation, you may choose to return an ETag. The etag must always be surrounded by double-quotes. These quotes must appear in the actual string you're returning.
Clients may use the ETag from a PUT request to later on make sure that when they update the file, the contents haven't changed in the mean time.
If you don't plan to store the file byte-by-byte, and you return a different object on a subsequent GET you are strongly recommended to not return an ETag, and just return null.
resource | string | $data |
Forbidden |
Definition at line 73 of file class.ilObjFileDAV.php.
References $data, getSize(), and handleFileUpload().
ilObjFileDAV::setName | ( | $a_name | ) |
string | $a_name |
Forbidden |
Definition at line 195 of file class.ilObjFileDAV.php.
|
protected |
Definition at line 23 of file class.ilObjFileDAV.php.
|
protected |
Definition at line 22 of file class.ilObjFileDAV.php.
|
protected |
Definition at line 21 of file class.ilObjFileDAV.php.
|
protected |
Definition at line 30 of file class.ilObjFileDAV.php.