ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ILIAS\Filesystem\Provider\FileReadAccess Interface Reference

Interface FileReadAccess. More...

+ Inheritance diagram for ILIAS\Filesystem\Provider\FileReadAccess:
+ Collaboration diagram for ILIAS\Filesystem\Provider\FileReadAccess:

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...
 

Detailed Description

Interface FileReadAccess.

All readonly file operations of the filesystem service.

Author
Nicolas Schäfli ns@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Since
5.3
Version
1.0
See also
FileAccess

Definition at line 22 of file FileReadAccess.php.

Member Function Documentation

◆ getMimeType()

ILIAS\Filesystem\Provider\FileReadAccess::getMimeType (   $path)

Get a files mime-type.

Parameters
string$pathThe file which should be used to get the mime-type.
Returns
string The mime-type of the file.
Exceptions
FileNotFoundExceptionIf the file is not found.
IOExceptionIf 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.

◆ getSize()

ILIAS\Filesystem\Provider\FileReadAccess::getSize (   $path,
  $fileSizeUnit 
)

Get the size of a file.

The file size units are provided by the DataSize class.

Parameters
string$pathThe path to the file.
int$fileSizeUnitThe unit of the file size, which are defined in the DataSize class.
Returns
DataSize
Since
5.3
Version
1.0
Exceptions
IOExceptionThrown if the file is not accessible or the underlying filesystem adapter failed.
FileNotFoundExceptionThrown if the specified file was not found.
See also
DataSize

Implemented in ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess, ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, and ILIAS\Filesystem\Decorator\ReadOnlyDecorator.

◆ getTimestamp()

ILIAS\Filesystem\Provider\FileReadAccess::getTimestamp (   $path)

Get the timestamp of the file.

Parameters
string$pathThe path to the file.
Returns
The timestamp of the file.
Exceptions
FileNotFoundExceptionIf the file is not found.
IOExceptionIf the file can not be red.
Since
5.3
Version
1.0

Implemented in ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess, and ILIAS\Filesystem\Decorator\ReadOnlyDecorator.

◆ getVisibility()

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.

Parameters
string$pathThe path to the file which should be used.
Returns
string The string 'public' or 'private'.
Exceptions
FileNotFoundExceptionIf the file could not be found.
Since
5.3
Version
1.0

Implemented in ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess, ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, and ILIAS\Filesystem\Decorator\ReadOnlyDecorator.

◆ has()

ILIAS\Filesystem\Provider\FileReadAccess::has (   $path)

Checks whether a file exists.

Parameters
string$pathThe file path which should be checked.
Returns
bool True if the file exists, otherwise false.
Since
5.3
Version
1.0

Implemented in ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, ILIAS\Filesystem\Decorator\ReadOnlyDecorator, and ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess.

◆ read()

ILIAS\Filesystem\Provider\FileReadAccess::read (   $path)

Reads a file content to a string.

Parameters
string$pathThe path to the file which should be read.
Returns
string The file content.
Exceptions
FileNotFoundExceptionIf the file doesn't exist.
IOExceptionIf the file could not be red.
Since
5.3
Version
1.0

Implemented in ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, ILIAS\Filesystem\Decorator\ReadOnlyDecorator, and ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess.

◆ setVisibility()

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.

Parameters
string$pathThe path to the file.
string$visibilityThe new visibility for the given file. This value must be 'private' or 'public'.
Returns
bool True on success or false on failure.
Exceptions

Implemented in ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess, ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator, ILIAS\Filesystem\FilesystemFacade, and ILIAS\Filesystem\Decorator\ReadOnlyDecorator.


The documentation for this interface was generated from the following file: