ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Interface FileReadAccess. More...
Public Member Functions | |
read ($path) | |
Reads a file content to a string. More... | |
has ($path) | |
Checks whether a file exists. More... | |
getMimeType ($path) | |
Get a files mime-type. More... | |
getTimestamp ($path) | |
Get the timestamp of the file. More... | |
getSize ($path, $fileSizeUnit) | |
Get the size of a file. More... | |
setVisibility ($path, $visibility) | |
Sets the visibility for a file. More... | |
getVisibility ($path) | |
Get the file visibility. More... | |
Interface FileReadAccess.
All readonly file operations of the filesystem service.
Definition at line 22 of file FileReadAccess.php.
ILIAS\Filesystem\Provider\FileReadAccess::getMimeType | ( | $path | ) |
Get a files mime-type.
string | $path | The file which should be used to get the mime-type. |
FileNotFoundException | If the file is not found. |
IOException | If the mime-type could not be determined. |
Implemented in ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, ILIAS\Filesystem\Decorator\ReadOnlyDecorator, and ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess.
ILIAS\Filesystem\Provider\FileReadAccess::getSize | ( | $path, | |
$fileSizeUnit | |||
) |
Get the size of a file.
The file size units are provided by the DataSize class.
string | $path | The path to the file. |
int | $fileSizeUnit | The unit of the file size, which are defined in the DataSize class. |
IOException | Thrown if the file is not accessible or the underlying filesystem adapter failed. |
FileNotFoundException | Thrown if the specified file was not found. |
Implemented in ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess, ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, and ILIAS\Filesystem\Decorator\ReadOnlyDecorator.
ILIAS\Filesystem\Provider\FileReadAccess::getTimestamp | ( | $path | ) |
Get the timestamp of the file.
string | $path | The path to the file. |
FileNotFoundException | If the file is not found. |
IOException | If the file can not be red. |
Implemented in ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess, and ILIAS\Filesystem\Decorator\ReadOnlyDecorator.
ILIAS\Filesystem\Provider\FileReadAccess::getVisibility | ( | $path | ) |
Get the file visibility.
The file visibility could be 'public' or 'private'.
Please note that the Visibility interface defines two constants PUBLIC_ACCESS and PRIVATE_ACCESS to ease the development process.
string | $path | The path to the file which should be used. |
FileNotFoundException | If the file could not be found. |
Implemented in ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess, ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, and ILIAS\Filesystem\Decorator\ReadOnlyDecorator.
ILIAS\Filesystem\Provider\FileReadAccess::has | ( | $path | ) |
Checks whether a file exists.
string | $path | The file path which should be checked. |
Implemented in ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, ILIAS\Filesystem\Decorator\ReadOnlyDecorator, and ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess.
ILIAS\Filesystem\Provider\FileReadAccess::read | ( | $path | ) |
Reads a file content to a string.
string | $path | The path to the file which should be read. |
FileNotFoundException | If the file doesn't exist. |
IOException | If the file could not be red. |
Implemented in ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, ILIAS\Filesystem\Decorator\ReadOnlyDecorator, and ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess.
ILIAS\Filesystem\Provider\FileReadAccess::setVisibility | ( | $path, | |
$visibility | |||
) |
Sets the visibility for a file.
Please note that the $visibility must 'public' or 'private'.
The Visibility interface provides two constants PUBLIC_ACCESS and PRIVATE_ACCESS. We strongly encourage the consumers of this API to use the constants.
string | $path | The path to the file. |
string | $visibility | The new visibility for the given file. This value must be 'private' or 'public'. |
Implemented in ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess, ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, and ILIAS\Filesystem\Decorator\ReadOnlyDecorator.