Search in sources :

Example 6 with QuestsIndex

use of delta.games.lotro.lore.quests.index.QuestsIndex in project lotro-tools by dmorcellet.

the class QuestsIndexLoader method doIt.

/**
 * Load quests index for my.lotro.com and write it to a file.
 * @param indexFile Target file.
 * @return <code>true</code> if it was done, <code>false</code> otherwise.
 */
public boolean doIt(File indexFile) {
    boolean ret = false;
    QuestsIndexJSONParser parser = new QuestsIndexJSONParser();
    QuestsIndex index = parser.parseQuestsIndex();
    if (index != null) {
        QuestsIndexWriter writer = new QuestsIndexWriter();
        ret = writer.write(indexFile, index, "UTF-8");
        if (!ret) {
            _logger.error("Cannot write quests index file [" + indexFile + "]");
        }
    } else {
        _logger.error("Quests index is null");
    }
    return ret;
}
Also used : QuestsIndex(delta.games.lotro.lore.quests.index.QuestsIndex) QuestsIndexWriter(delta.games.lotro.lore.quests.index.io.xml.QuestsIndexWriter)

Aggregations

QuestsIndex (delta.games.lotro.lore.quests.index.QuestsIndex)6 QuestDescription (delta.games.lotro.lore.quests.QuestDescription)3 QuestsManager (delta.games.lotro.lore.quests.QuestsManager)3 QuestCategory (delta.games.lotro.lore.quests.index.QuestCategory)2 QuestSummary (delta.games.lotro.lore.quests.index.QuestSummary)2 QuestsIndexWriter (delta.games.lotro.lore.quests.index.io.xml.QuestsIndexWriter)2 ExtensionPredicate (delta.common.utils.files.filter.ExtensionPredicate)1 Downloader (delta.downloads.Downloader)1 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharacterSummary (delta.games.lotro.character.CharacterSummary)1 CharacterLog (delta.games.lotro.character.log.CharacterLog)1 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)1 CharacterClass (delta.games.lotro.common.CharacterClass)1 Race (delta.games.lotro.common.Race)1 QuestXMLParser (delta.games.lotro.lore.quests.io.xml.QuestXMLParser)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1