19declare(strict_types=1);
46 public function copy(
int $targetObjId): void
57 '/(' . $this->config->getSubDirectoryPrefix() .
')(\d*)\/(.*)$/',
58 '${1}' . $targetObjId .
'/${3}',
59 $this->getRelativePath()
64 }
catch (Exception
$e) {
69 public function delete():
void
71 if ($this->
filesystem->hasDir($this->getIconDirectory())) {
74 }
catch (Exception
$e) {
86 return $this->config->getSupportedFileExtensions();
99 $this->
filesystem->copy($sourceFilePath, $fileName);
119 rename($temp_icon->getAbsolutePath(), $this->getFullPath());
120 $this->
filesystem->setVisibility($relative_path,
'public');
123 foreach ($this->config->getUploadPostProcessors() as $processor) {
124 $processor->process($relative_path);
130 public function saveFromHttpRequest(): void
140 if ($this->
upload->hasUploads() && !$this->upload->hasBeenProcessed()) {
144 $result = array_values($this->
upload->getResults())[0];
145 if ($result->isOK()) {
146 $this->
upload->moveOneFileTo(
155 foreach ($this->config->getUploadPostProcessors() as $processor) {
156 $processor->process($fileName);
172 public function remove():
void
190 if (!$this->
filesystem->has(dirname($iconDirectory))) {
191 $this->
filesystem->createDir(dirname($iconDirectory));
194 if (!$this->
filesystem->has($iconDirectory)) {
201 return implode(DIRECTORY_SEPARATOR, [
202 $this->config->getBaseDirectory(),
203 $this->config->getSubDirectoryPrefix() . $this->getObjId()
209 return self::ICON_BASENAME .
'.' . $this->config->getTargetFileExtension();
214 return implode(DIRECTORY_SEPARATOR, [
232 return implode(DIRECTORY_SEPARATOR, [
240 $target_dir = implode(DIRECTORY_SEPARATOR, [
Indicates general problems with the input or output operations.
Resolves a user-supplied temp file identifier to an absolute path that is guaranteed to refer to a re...
getSupportedFileExtensions()
persistIconState(string $fileName)
saveFromTempFileName(string $tempfile_name)
createCustomIconDirectory()
__construct(protected Filesystem $filesystem, protected FileUpload $upload, protected Configuration $config, protected int $objId)
createFromImportDir(string $source_dir)
saveFromSourceFile(string $sourceFilePath)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static _deleteContainerSettings(int $a_id, string $a_keyword="", bool $a_keyword_like=false)
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static getDataDir()
get data directory (outside webspace)
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
const WEB
The filesystem within the ilias web root.
The filesystem interface provides the public interface for the Filesystem service API consumer.