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

Interface FileWriteAccess. More...

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

Public Member Functions

 write ($path, $content)
 Writes the content to a new file. More...
 
 update ($path, $newContent)
 Updates the content of a file. More...
 
 put ($path, $content)
 Creates a file or updates an existing one. More...
 
 delete ($path)
 Deletes a file. More...
 
 readAndDelete ($path)
 Reads the entire file content into a string and removes the file afterwards. More...
 
 rename ($path, $newPath)
 Moves a file from the source to the destination. More...
 
 copy ($path, $copyPath)
 Copy the source file to a destination. More...
 

Detailed Description

Interface FileWriteAccess.

All write 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 FileWriteAccess.php.

Member Function Documentation

◆ copy()

ILIAS\Filesystem\Provider\FileWriteAccess::copy (   $path,
  $copyPath 
)

Copy the source file to a destination.

Parameters
string$pathThe source path to the file which should be copied.
string$copyPathThe destination path of the file copy.
Returns
void
Exceptions
FileNotFoundExceptionIf the source file does not exist.
FileAlreadyExistsExceptionIf the destination file already exists.
IOExceptionIf the file could not be copied to the destination.
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.

◆ delete()

ILIAS\Filesystem\Provider\FileWriteAccess::delete (   $path)

Deletes a file.

Parameters
string$pathThe path to the file which should be deleted.
Returns
void
Exceptions
FileNotFoundExceptionIf the file was not found.
IOExceptionIf the file was found but the delete operation finished with errors.
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.

◆ put()

ILIAS\Filesystem\Provider\FileWriteAccess::put (   $path,
  $content 
)

Creates a file or updates an existing one.

Parameters
string$pathThe path to the file which should be created or updated.
string$contentThe content which should be written to the file.
Returns
void
Exceptions
IOExceptionIf the file could not be created or updated.
Since
5.3
Version
1.0
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.

◆ readAndDelete()

ILIAS\Filesystem\Provider\FileWriteAccess::readAndDelete (   $path)

Reads the entire file content into a string and removes the file afterwards.

Parameters
string$pathThe file which should be red and removed.
Returns
string The entire file content.
Exceptions
FileNotFoundExceptionIf the file was not found.
IOExceptionIf the file could not red or deleted.
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.

◆ rename()

ILIAS\Filesystem\Provider\FileWriteAccess::rename (   $path,
  $newPath 
)

Moves a file from the source to the destination.

Parameters
string$pathThe current path of the file which should be moved.
string$newPathThe new path of the file.
Returns
void
Exceptions
FileNotFoundExceptionIf the source file is not found.
FileAlreadyExistsExceptionIf the destination file is already existing.
IOExceptionIf the file could not be moved.
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.

◆ update()

ILIAS\Filesystem\Provider\FileWriteAccess::update (   $path,
  $newContent 
)

Updates the content of a file.

Replaces the file content with a new one.

Parameters
string$pathThe path to the file which should be updated.
string$newContentThe new file content.
Returns
void
Exceptions
FileNotFoundExceptionIf the file is not found.
IOExceptionIf the file could not be updated.
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.

◆ write()

ILIAS\Filesystem\Provider\FileWriteAccess::write (   $path,
  $content 
)

Writes the content to a new file.

Parameters
string$pathThe path to the file which should be created.
string$contentThe content which should be written to the new file.
Returns
void
Exceptions
FileAlreadyExistsExceptionIf the file already exists.
IOExceptionIf the file could not be created or written.
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.


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