protected function checkPath(/*# string */$path)
    {
        // get the directory
        $dir = dirname(realpath($path));

        if (!is_dir($dir)) {
            mkdir($dir, 0777, true);
        }

        if (!is_dir($dir) || !is_writable($dir)) {
            throw new LogicException(
                Message::get(Message::MSG_PATH_NONWRITABLE, $dir),
                Message::MSG_PATH_NONWRITABLE
            );
        }
    }