19declare(strict_types=1);
67 $this->
filesystem->createDir($path, $visibility);
73 public function copyDir(
string $source,
string $destination): void
81 foreach ($contentList as $content) {
83 if ($content->isFile()) {
85 $position = strpos($content->getPath(), $source);
86 if ($position !==
false) {
87 $destinationFilePath = substr_replace(
93 $this->
copy($content->getPath(), $destinationFilePath);
136 return $this->
filesystem->getTimestamp($path);
156 $this->sanitizer->sanitize(
$path),
166 return $this->
filesystem->getVisibility($path);
182 $this->
filesystem->writeStream($this->sanitizer->sanitize(
$path), $stream);
190 $this->
filesystem->putStream($this->sanitizer->sanitize(
$path), $stream);
198 $this->
filesystem->updateStream($this->sanitizer->sanitize(
$path), $stream);
214 $this->
filesystem->update($this->sanitizer->sanitize(
$path), $new_content);
220 public function put(
string $path,
string $content): void
228 public function delete(
string $path):
void
238 return $this->
filesystem->readAndDelete($path);
248 $this->sanitizer->sanitize($new_path)
255 public function copy(
string $path,
string $copy_path): void
259 $this->sanitizer->sanitize($copy_path)
275 if ($destinationContent !== []) {
276 throw new IOException(
"Destination \"$path\" is not empty can not copy files.");
293 if (!$this->
hasDir($path)) {
This class provides the data size with additional information to remove the work to calculate the siz...
The filesystem white list decorator rewrites forbidden file endings and delegates the rest of the ope...
put(string $path, string $content)
@inheritDoc
ensureDirectoryExistence(string $path)
Checks if the directory exists.
updateStream(string $path, FileStream $stream)
@inheritDoc
getVisibility(string $path)
@inheritDoc
readStream(string $path)
@inheritDoc
deleteDir(string $path)
@inheritDoc
getMimeType(string $path)
@inheritDoc
createDir(string $path, string $visibility=Visibility::PUBLIC_ACCESS)
@inheritDoc
hasDir(string $path)
@inheritDoc
read(string $path)
@inheritDoc
getSize(string $path, int $unit)
@inheritDoc
copyDir(string $source, string $destination)
@inheritDoc
readAndDelete(string $path)
@inheritDoc
update(string $path, string $new_content)
@inheritDoc
ensureEmptyDirectory(string $path)
Ensures that the given path does not exist or is empty.
rename(string $path, string $new_path)
@inheritDoc
write(string $path, string $content)
@inheritDoc
copy(string $path, string $copy_path)
@inheritDoc
listContents(string $path='', bool $recursive=false)
@inheritDoc
writeStream(string $path, FileStream $stream)
@inheritDoc
getTimestamp(string $path)
@inheritDoc
setVisibility(string $path, string $visibility)
@inheritDoc
has(string $path)
@inheritDoc
__construct(private Filesystem $filesystem, private FilenameSanitizer $sanitizer)
putStream(string $path, FileStream $stream)
@inheritDoc
Indicates that the directory is missing or not found.
Indicates general problems with the input or output operations.
The filesystem interface provides the public interface for the Filesystem service API consumer.
The filename sanitizer verifies and fixes file name endings.
The base interface for all filesystem streams.
This interface provides the available options for the filesystem right management of the filesystem s...
const PUBLIC_ACCESS
Public file visibility.