X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Ffile_directories%2Finput%2Ftext%2Fclass_FrameworkTextFileInputPointer.php;h=fa238a54dc72fd0f4dd967a3d45dafe637286e9c;hp=5338fe32e55c02a339159df0975853c151e4a91e;hb=de4993bdd2170972f3c004bf7473bfd2032c2dda;hpb=d61f4e1b3b96da51056889c6340d2e935d7e9972 diff --git a/inc/classes/main/file_directories/input/text/class_FrameworkTextFileInputPointer.php b/inc/classes/main/file_directories/input/text/class_FrameworkTextFileInputPointer.php index 5338fe32..fa238a54 100644 --- a/inc/classes/main/file_directories/input/text/class_FrameworkTextFileInputPointer.php +++ b/inc/classes/main/file_directories/input/text/class_FrameworkTextFileInputPointer.php @@ -37,8 +37,9 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer { * be verified here. * * @param $fileName The file name we shall pass to fopen() - * @throws FileIsEmptyException If the provided file name is empty. - * @throws FileIoException If fopen() returns not a file resource + * @throws FileIsEmptyException If the provided file name is empty. + * @throws FileIoException If the file is not reachable + * @throws FileReadProtectedException If the file cannot be read from * @return void */ public static final function createFrameworkTextFileInputPointer ($fileName) { @@ -46,10 +47,10 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer { if ((is_null($fileName)) || (empty($fileName))) { // No filename given throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif (!file_exists($fileName)) { + } elseif (!BaseFrameworkSystem::isReachableFilePath($fileName)) { // File does not exist! - throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_FOUND); - } elseif (!is_readable($fileName)) { + throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_REACHABLE); + } elseif (!BaseFrameworkSystem::isReadableFile($fileName)) { // File does not exist! throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ); }