Nextcloud PHP API (master)

IFilenameValidator

Tags
since
30.0.0

Table of Contents

Methods

isFilenameValid()  : bool
It is recommended to use `\OCP\Files\Storage\IStorage::isFileValid` instead as this only checks if the filename is valid in general but not for a specific storage which might have additional naming rules.
validateFilename()  : void
It is recommended to use `\OCP\Files\Storage\IStorage::isFileValid` instead as this only checks if the filename is valid in general but not for a specific storage which might have additional naming rules.

Methods

isFilenameValid()

It is recommended to use `\OCP\Files\Storage\IStorage::isFileValid` instead as this only checks if the filename is valid in general but not for a specific storage which might have additional naming rules.

public isFilenameValid(string $filename) : bool
Parameters
$filename : string

The filename to check for validity

Tags
since
30.0.0
Return values
bool

validateFilename()

It is recommended to use `\OCP\Files\Storage\IStorage::isFileValid` instead as this only checks if the filename is valid in general but not for a specific storage which might have additional naming rules.

public validateFilename(string $filename) : void

This will validate a filename and throw an exception with details on error.

Parameters
$filename : string

The filename to check for validity

Tags
throws
InvalidPathException

or one of its child classes in case of an error

since
30.0.0

        
On this page

Search results