19 declare(strict_types=1);
51 private FileStreamAccess $fileStreamAccess,
52 private FileAccess $fileAccess,
53 private DirectoryAccess $directoryAccess
62 return $this->directoryAccess->hasDir($path);
70 return $this->directoryAccess->listContents(
$path, $recursive);
78 $this->directoryAccess->createDir($path, $visibility);
84 public function copyDir(
string $source,
string $destination): void
86 $this->directoryAccess->copyDir($source, $destination);
94 $this->directoryAccess->deleteDir($path);
102 return $this->fileAccess->read($path);
110 return $this->fileAccess->has($path);
118 return $this->fileAccess->getMimeType($path);
126 return $this->fileAccess->getTimestamp($path);
134 return $this->fileAccess->
getSize($path, $unit);
142 return $this->fileAccess->setVisibility($path, $visibility);
150 return $this->fileAccess->getVisibility($path);
158 return $this->fileStreamAccess->readStream($path);
166 $this->fileStreamAccess->writeStream($path, $stream);
174 $this->fileStreamAccess->putStream($path, $stream);
182 $this->fileStreamAccess->updateStream($path, $stream);
190 $this->fileAccess->write($path, $content);
198 $this->fileAccess->update($path, $new_content);
204 public function put(
string $path,
string $content): void
206 $this->fileAccess->put($path, $content);
212 public function delete(
string $path):
void 214 $this->fileAccess->delete(
$path);
222 return $this->fileAccess->readAndDelete($path);
230 $this->fileAccess->rename($path, $new_path);
236 public function copy(
string $path,
string $copy_path): void
238 $this->fileAccess->copy($path, $copy_path);
246 return new Finder($this);
write(string $path, string $content)
setVisibility(string $path, string $visibility)
rename(string $path, string $new_path)
__construct(private FileStreamAccess $fileStreamAccess, private FileAccess $fileAccess, private DirectoryAccess $directoryAccess)
FilesystemFacade constructor.
This class provides the data size with additional information to remove the work to calculate the siz...
copyDir(string $source, string $destination)
createDir(string $path, string $visibility=Visibility::PUBLIC_ACCESS)
listContents(string $path='', bool $recursive=false)
getSize(string $path, int $unit)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
readAndDelete(string $path)
put(string $path, string $content)
getSize()
The calculated data size.
getTimestamp(string $path)
copy(string $path, string $copy_path)
getVisibility(string $path)
update(string $path, string $new_content)
const PUBLIC_ACCESS
Public file visibility.
writeStream(string $path, FileStream $stream)
putStream(string $path, FileStream $stream)
updateStream(string $path, FileStream $stream)
The filesystem facade is used internally to satisfy the Filesystem interface because the implementati...
getMimeType(string $path)