Document customDefinitions =
createNewDocument(new BufferedInputStream(input));
mergeDefinitionDocuments(xmlDefinitionsDocument, customDefinitions);
}
} else {
throw new RepositoryException(
exceptionLocalizer.format(
"device-repository-file-missing",
DeviceRepositoryConstants.DEFINITIONS_XML));
}
// Read in a JDOM document for the hierarchy from the archive.
input = repositoryArchive.getInputFrom(DeviceRepositoryConstants.HIERARCHY_XML);
if (input != null) {
xmlHierarchyDocument = createNewDocument(
new BufferedInputStream(input));
} else {
throw new RepositoryException(
exceptionLocalizer.format(
"device-repository-file-missing",
DeviceRepositoryConstants.HIERARCHY_XML));
}
// Read in a JDOM document for device identification from the archive.
input = repositoryArchive.getInputFrom(DeviceRepositoryConstants.IDENTIFICATION_XML);
if (input != null) {
xmlIdentificationDocument = createNewDocument(
new BufferedInputStream(input));
} else {
throw new RepositoryException(
exceptionLocalizer.format(
"device-repository-file-missing",
DeviceRepositoryConstants.IDENTIFICATION_XML));
}
// Read in a JDOM document for device TAC identification from the
// archive.
input = repositoryArchive.getInputFrom(DeviceRepositoryConstants.TAC_IDENTIFICATION_XML);
if (input != null) {
xmlTACIdentificationDocument = createNewDocument(
new BufferedInputStream(input));
} else {
// No TAC file was found - this is not an error, as TAC data is
// not available in all repositories. Ignore this and leave the
// document null.
}
// Read in a JDOM document for repository from the archive.
revision = retrieveRevision(repositoryArchive, factory);
try {
properties = createMergedProperties(repositoryArchive);
} catch (IOException ioe) {
throw new RepositoryException(
exceptionLocalizer.format(
"device-repository-file-missing",
"policies.properties"),
ioe);
}