More usage of FileNotFoundException
[core.git] / inc / classes / main / file_directories / input / text / class_FrameworkTextFileInputPointer.php
index fa238a5..16e43d5 100644 (file)
@@ -48,10 +48,13 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
                        // No filename given
                        throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                } elseif (!BaseFrameworkSystem::isReachableFilePath($fileName)) {
-                       // File does not exist!
+                       // File cannot be reached
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_REACHABLE);
-               } elseif (!BaseFrameworkSystem::isReadableFile($fileName)) {
+               } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (!file_exists($fileName))) {
                        // File does not exist!
+                       throw new FileNotFoundException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
+               } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (file_exists($fileName))) {
+                       // File cannot be read from (but exists)
                        throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
                }