Introduced isReachableFilePath() and isReadableFile().
[core.git] / inc / classes / main / file_directories / input / raw / class_FrameworkRawFileInputPointer.php
index 37f5adb..a3b3702 100644 (file)
@@ -37,8 +37,9 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
         * be verified here.
         *
         * @param       $fileName       The file name we shall pass to fopen()
         * 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 is not found or cannot be read
         * @return      void
         */
        public static final function createFrameworkRawFileInputPointer ($fileName) {
         * @return      void
         */
        public static final function createFrameworkRawFileInputPointer ($fileName) {
@@ -46,10 +47,10 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
                if ((is_null($fileName)) || (empty($fileName))) {
                        // No filename given
                        throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                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!
                        // 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);
                }
                        // File does not exist!
                        throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
                }