private TestSession NewSession(WorkingDirectory workingDirectory, ArchiveType archiveType, Uuid uuid) { Archive archive = new Archive(archiveType, uuid, workingDirectory); workingDirectory.CopyAddmlFileToAdministrativeMetadata(); ConvertNoarkihToAddmlIfNoark4(archive); var testSession = new TestSession(archive); if (archiveType == ArchiveType.Noark5) { return(testSession); } ArkadeFile addmlFile = archive.AddmlFile; try { AddmlInfo addml = AddmlUtil.ReadFromFile(addmlFile.FullName); var addmlDefinitionParser = new AddmlDefinitionParser(addml, workingDirectory, _statusEventHandler); testSession.AddmlDefinition = addmlDefinitionParser.GetAddmlDefinition(); } catch (Exception exception) { _log.Warning("Reading file " + addmlFile.Name + " failed: " + exception.Message); } return(testSession); }
private static int GetPostCountFromJournal(ArkadeFile journalFile) { JournalHead journalHead = JournalGuillotine.Behead(journalFile); return(journalHead.NumberOfJournalposts); }