ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
|
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 | |
uploadFile ($a_data, string $file_dest_path) | |
Write given data (as string) to the given file. More... | |
getPathToDirectory () | |
getPathToFile () | |
This method is called in 2 use cases: More... | |
checkForVirus (string $file_dest_path) | |
setObjValuesForNewFileVersion () | |
Set object values for a new file version. More... | |
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 | |
$obj | |
$versioning_enabled | |
![]() | |
$ref_id | |
$obj | |
$repo_helper | |
$dav_helper | |
Class ilObjFileDAV.
Implementation for ILIAS File Objects represented as WebDAV File Objects
Definition at line 18 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 44 of file class.ilObjFileDAV.php.
References ILIAS\GlobalScreen\Provider\__construct().
|
protected |
Definition at line 273 of file class.ilObjFileDAV.php.
References deleteObjOrVersion(), ilLoggerFactory\getLogger(), and ilUtil\virusHandling().
Referenced by handleFileUpload().
|
protected |
Create history entry and a news notification for file object update.
$a_action |
Definition at line 303 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 319 of file class.ilObjFileDAV.php.
References ilUtil\delDir().
Referenced by checkForVirus(), and handleFileUpload().
ilObjFileDAV::get | ( | ) |
Returns the data.
This method may either return a string or a readable stream resource
Forbidden |
Definition at line 97 of file class.ilObjFileDAV.php.
References getPathToFile().
ilObjFileDAV::getContentType | ( | ) |
Returns the mime-type for a file.
If null is returned, we'll assume application/octet-stream
Definition at line 129 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 148 of file class.ilObjFileDAV.php.
References getPathToFile().
Referenced by put().
ilObjFileDAV::getName | ( | ) |
Returns title of file object.
If it has a forbidden file extension -> ".sec" will be added
Definition at line 117 of file class.ilObjFileDAV.php.
References ilFileUtils\getValidFilename().
Referenced by handleFileUpload().
|
protected |
Definition at line 249 of file class.ilObjFileDAV.php.
Referenced by getPathToFile(), and handleFileUpload().
|
protected |
This method is called in 2 use cases:
Use case 1: Get the path to an already existing file to download it -> read operation Use case 2: Get the path to save a new file into or overwrite an existing one -> write operation
ilFileUtilsException |
Definition at line 263 of file class.ilObjFileDAV.php.
References getPathToDirectory(), and ilFileUtils\getValidFilename().
Referenced by get(), getETag(), getSize(), and handleFileUpload().
ilObjFileDAV::getSize | ( | ) |
Returns the size of the node, in bytes.
Definition at line 166 of file class.ilObjFileDAV.php.
References getPathToFile().
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 |
Definition at line 196 of file class.ilObjFileDAV.php.
References checkForVirus(), createHistoryAndNotificationForObjUpdate(), ilPreview\createPreview(), deleteObjOrVersion(), getName(), getPathToDirectory(), getPathToFile(), ilUtil\getUploadSizeLimitBytes(), ilMimeTypeUtil\lookupMimeType(), ilUtil\makeDirParents(), and uploadFile().
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 72 of file class.ilObjFileDAV.php.
References $data, getETag(), handleFileUpload(), and setObjValuesForNewFileVersion().
ilObjFileDAV::setName | ( | $a_name | ) |
string | $a_name |
Forbidden |
Definition at line 178 of file class.ilObjFileDAV.php.
|
protected |
Set object values for a new file version.
Definition at line 287 of file class.ilObjFileDAV.php.
Referenced by put().
|
protected |
Write given data (as string) to the given file.
string | resource | $a_data | |
string | $file_dest_path |
Exception |
Definition at line 240 of file class.ilObjFileDAV.php.
Referenced by handleFileUpload().
|
protected |
Definition at line 25 of file class.ilObjFileDAV.php.
|
protected |
Definition at line 32 of file class.ilObjFileDAV.php.