Beispiel #1
0
        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);
        }
Beispiel #2
0
        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)
            {
                AddmlInfo addml = AddmlUtil.ReadFromFile(archive.GetStructureDescriptionFileName());
                testSession.AddmlDefinition = new AddmlDefinitionParser(addml, workingDirectory).GetAddmlDefinition();
            }

            return(testSession);
        }
Beispiel #3
0
        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)
            {
                FileInfo addmlFile = archive.GetStructureDescriptionFile();
                if (addmlFile.Exists) // file does not exist when user want to just do a simple packaging job
                {
                    AddmlInfo addml = AddmlUtil.ReadFromFile(addmlFile.FullName);
                    testSession.AddmlDefinition = new AddmlDefinitionParser(addml, workingDirectory, _statusEventHandler).GetAddmlDefinition();
                }
            }

            return(testSession);
        }