30 parent::__construct($a_obj, $repo_helper, $dav_helper);
63 if ($this->repo_helper->checkCreateAccessForType($this->obj->getRefId(),
'file')) {
65 if ($this->dav_helper->isValidFileNameWithValidFileExtension(
$name)) {
68 $file_dav->handleFileUpload(
$data);
71 $file_obj->setTitle(
$name);
72 $file_obj->setFileName(
$name);
73 $file_obj->setVersion(1);
74 $file_obj->setMaxVersion(1);
75 $file_obj->createDirectory();
78 $file_obj->createReference();
79 $file_obj->putInTree($this->obj->getRefId());
80 $file_obj->setPermissions($this->ref_id);
83 $file_dav =
new ilObjFileDAV($file_obj, $this->repo_helper, $this->dav_helper);
84 $file_dav->handleFileUpload(
$data);
89 throw new Forbidden(
'Invalid file name or file extension');
95 return $file_dav->getETag();
110 if ($this->repo_helper->checkCreateAccessForType($this->getRefId(),
$type) && $this->dav_helper->isDAVableObjTitle(
$name)) {
121 ilLoggerFactory::getLogger(
'WebDAV')->info(get_class($this) .
' ' . $this->obj->getTitle() .
" -> $type is not supported as webdav directory");
122 throw new NotImplemented(
"Create type '$type' as collection is not implemented yet");
125 $new_obj->setType(
$type);
126 $new_obj->setOwner($DIC->user()->getId());
127 $new_obj->setTitle(
$name);
130 $new_obj->createReference();
131 $new_obj->putInTree($this->obj->getRefId());
132 $new_obj->setPermissions($this->obj->getRefId());
152 $child_exists =
false;
153 foreach ($this->repo_helper->getChildrenOfRefId($this->obj->getRefId()) as $child_ref) {
155 if ($this->dav_helper->isDAVableObject($child_ref,
true)) {
157 if ($this->repo_helper->getObjectTitleFromRefId($child_ref,
true) ==
$name) {
158 $child_exists =
true;
161 if ($this->repo_helper->checkAccess(
"read", $child_ref)) {
162 $child_node = $this->dav_helper->createDAVObjectForRefId($child_ref);
169 if (!is_null($child_node)) {
184 $child_nodes = array();
185 foreach ($this->repo_helper->getChildrenOfRefId($this->obj->getRefId()) as $child_ref) {
187 if ($this->dav_helper->isDAVableObject($child_ref,
true)) {
189 if ($this->repo_helper->checkAccess(
"read", $child_ref)) {
191 $child_nodes[$child_ref] = $this->dav_helper->createDAVObjectForRefId($child_ref);
206 foreach ($this->repo_helper->getChildrenOfRefId($this->obj->getRefId()) as $child_ref) {
208 if ($this->dav_helper->isDAVableObject($child_ref,
true)) {
210 if ($this->repo_helper->getObjectTitleFromRefId($child_ref,
true) ==
$name) {
212 if ($this->repo_helper->checkAccess(
"read", $child_ref)) {
createDirectory($name)
Creates a new subdirectory.
getChildCollectionType()
Return the type for child collections of this collection For courses, groups and folders the type is ...
getChildren()
Returns an array with all the child nodes.
Class ilWebDAVRepositoryHelper.
childExists($name)
Checks if a child-node with the specified name exists.
Class ilWebDAVObjDAVHelper.
createFile($name, $data=null)
Creates a new file in the directory.
getChild($name)
Returns a specific child node, referenced by its name.
__construct(ilContainer $a_obj, ilWebDAVRepositoryHelper $repo_helper, ilWebDAVObjDAVHelper $dav_helper)
Check if given object has valid type and calls parent constructor.
static getLogger($a_component_id)
Get component logger.