19 declare(strict_types=1);
36 $path_inside_container =
'/' . ltrim($path_inside_container,
'./');
37 $path_inside_container = rtrim($path_inside_container,
'/');
39 return $path_inside_container;
45 ?
string $revision_title =
null 50 return $this->
upload($result, $stakeholder, $revision_title);
56 ?
string $revision_title =
null 59 $this->
checkZIP(mime_content_type($stream->getMetadata()[
'uri']));
71 string $path_inside_container
73 $path_inside_container = $this->
normalizePath($path_inside_container);
74 if (empty($path_inside_container)) {
77 return $this->resource_builder->createDirectoryInsideContainer(
79 $path_inside_container
85 string $path_inside_container
87 if (empty($path_inside_container)) {
90 return $this->resource_builder->removePathInsideContainer(
92 $path_inside_container
99 string $parent_path_inside_container,
101 $parent_path_inside_container = $this->
normalizePath($parent_path_inside_container);
102 if (empty($parent_path_inside_container)) {
103 $parent_path_inside_container =
'/';
105 return $this->resource_builder->addUploadToContainer(
108 $parent_path_inside_container
115 string $path_inside_container,
117 $path_inside_container = $this->
normalizePath($path_inside_container);
118 if (empty($path_inside_container)) {
121 return $this->resource_builder->addStreamToContainer(
124 $path_inside_container
containerFromStream(FileStream $stream, ResourceStakeholder $stakeholder, ?string $revision_title=null)
addStreamToContainer(ResourceIdentification $container, FileStream $stream, string $path_inside_container,)
addUploadToContainer(ResourceIdentification $container, UploadResult $result, string $parent_path_inside_container,)
checkZIP(bool|string $mimetype)
removePathInsideContainer(ResourceIdentification $container, string $path_inside_container)
normalizePath(string $path_inside_container)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getResource(ResourceIdentification $i)
Class ResourceIdentification.
containerFromUpload(UploadResult $result, ResourceStakeholder $stakeholder, ?string $revision_title=null)
Interface ResourceStakeholder.
upload(UploadResult $result, ResourceStakeholder $stakeholder, ?string $revision_title=null)
Creates a new resource from an upload, the status in this case is always PUBLISHED.
The base interface for all filesystem streams.
newStreamBased(FileStream $stream, ResourceStakeholder $stakeholder, ResourceType $type, ?string $revision_title=null)
createDirectoryInsideContainer(ResourceIdentification $container, string $path_inside_container)