public function ensureDirectoryExists($outputFilename)
    {
        $directoryName = dirname($outputFilename);
        @mkdir($directoryName, 0755, true);
        
        //TODO - double-check umask
    
        if (file_exists($directoryName) === false) {
            throw new JigException("Directory $directoryName does not exist and could not be created");
        }
    }