ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
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) | |
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 Returns the name of the node.This is used to generate the url.
| |
getObject () | |
Returns ILIAS Object. More... | |
![]() | |
getLastModified () | |
Returns the last modification time as a unix timestamp. More... | |
delete () | |
Deletes the current node. More... | |
setName ($name) | |
Renames the node. More... | |
Protected Member Functions | |
fileUploadWithStream ($a_data, string $file_dest_path) | |
Write given data (as Resource) to the given file. More... | |
fileUploadWithString (string $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 () | |
Create history entry and a news notification for file object update. More... | |
Protected Attributes | |
$obj | |
![]() | |
$ref_id | |
$obj | |
$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 38 of file class.ilObjFileDAV.php.
|
protected |
Definition at line 290 of file class.ilObjFileDAV.php.
References ilLoggerFactory\getLogger(), and ilUtil\virusHandling().
Referenced by handleFileUpload().
|
protected |
Create history entry and a news notification for file object update.
Definition at line 319 of file class.ilObjFileDAV.php.
References ilHistory\_createEntry().
Referenced by handleFileUpload().
|
protected |
Write given data (as Resource) to the given file.
Resource | $a_data | |
string | $file_dest_path |
Exception |
Definition at line 225 of file class.ilObjFileDAV.php.
References ilLoggerFactory\getLogger().
Referenced by handleFileUpload().
|
protected |
Write given data (as string) to the given file.
string | $a_data | |
string | $file_dest_path |
Forbidden |
Definition at line 255 of file class.ilObjFileDAV.php.
Referenced by handleFileUpload().
ilObjFileDAV::get | ( | ) |
Returns the data.
This method may either return a string or a readable stream resource
Forbidden |
Implements Sabre\DAV\IFile.
Definition at line 83 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
Implements Sabre\DAV\IFile.
Definition at line 114 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"';
Implements Sabre\DAV\IFile.
Definition at line 133 of file class.ilObjFileDAV.php.
References $path, and getPathToFile().
Referenced by put().
ilObjFileDAV::getName | ( | ) |
Returns title of file object.
If it has a forbidden file extension -> ".sec" will be added
Implements Sabre\DAV\INode.
Definition at line 102 of file class.ilObjFileDAV.php.
References ilFileUtils\getValidFilename().
Referenced by handleFileUpload().
|
protected |
Definition at line 266 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 280 of file class.ilObjFileDAV.php.
References $path, getPathToDirectory(), and ilFileUtils\getValidFilename().
Referenced by get(), getETag(), getSize(), and handleFileUpload().
ilObjFileDAV::getSize | ( | ) |
Returns the size of the node, in bytes.
Implements Sabre\DAV\IFile.
Definition at line 151 of file class.ilObjFileDAV.php.
References getPathToFile().
ilObjFileDAV::handleFileUpload | ( | $a_data | ) |
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 |
BadRequest | |
Forbidden |
Definition at line 182 of file class.ilObjFileDAV.php.
References checkForVirus(), createHistoryAndNotificationForObjUpdate(), fileUploadWithStream(), fileUploadWithString(), ilLoggerFactory\getLogger(), getName(), getPathToDirectory(), getPathToFile(), ilMimeTypeUtil\lookupMimeType(), and ilUtil\makeDirParents().
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 |
BadRequest | |
Forbidden |
Implements Sabre\DAV\IFile.
Definition at line 65 of file class.ilObjFileDAV.php.
References $data, getETag(), handleFileUpload(), and setObjValuesForNewFileVersion().
ilObjFileDAV::setName | ( | $a_name | ) |
string | $a_name |
Forbidden |
Implements Sabre\DAV\INode.
Definition at line 163 of file class.ilObjFileDAV.php.
|
protected |
Set object values for a new file version.
Definition at line 305 of file class.ilObjFileDAV.php.
Referenced by put().
|
protected |
Definition at line 26 of file class.ilObjFileDAV.php.