3 * File containing the ezcBaseFilePermissionException class
7 * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
8 * @license http://ez.no/licenses/new_bsd New BSD License
11 * ezcBaseFilePermissionException is thrown whenever a permission problem with
12 * a file, directory or stream occurred.
17 class ezcBaseFilePermissionException
extends ezcBaseFileException
20 * Constructs a new ezcPropertyPermissionException for the property $name.
22 * @param string $path The name of the file.
23 * @param int $mode The mode of the property that is allowed
24 * (ezcBaseFileException::READ, ezcBaseFileException::WRITE,
25 * ezcBaseFileException::EXECUTE,
26 * ezcBaseFileException::CHANGE or
27 * ezcBaseFileException::REMOVE).
28 * @param string $message A string with extra information.
30 function __construct( $path, $mode, $message = null )
34 case ezcBaseFileException
::READ
:
35 $operation = "The file '{$path}' can not be opened for reading";
37 case ezcBaseFileException
::WRITE
:
38 $operation = "The file '{$path}' can not be opened for writing";
40 case ezcBaseFileException
::EXECUTE
:
41 $operation = "The file '{$path}' can not be executed";
43 case ezcBaseFileException
::CHANGE
:
44 $operation = "The permissions for '{$path}' can not be changed";
46 case ezcBaseFileException
::REMOVE
:
47 $operation = "The file '{$path}' can not be removed";
49 case ( ezcBaseFileException
::READ || ezcBaseFileException
::WRITE
):
50 $operation = "The file '{$path}' can not be opened for reading and writing";
57 $messagePart = " ($message)";
60 parent
::__construct( "$operation.$messagePart" );