public function loadFromFile($fileName = "wsdata", $directory = "")
    {
        if ($directory == "")
            $directory = dirname(__FILE__);

        $filename = sprintf("%s/%s.csv", $directory, $fileName);
        try {
            $fp = @fopen($filename, "r");
            $line = @fgets($fp);
            @fclose($fp);
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        };

        if (!$line) {
            throw new Exception("No data stored");
        }

        $arr = explode(",", $line);
        $this->importFromString($arr[1]);

        return $this;
    }