}
}
if (! required.isEmpty()) {
throw missingAttributes(reader, required);
}
final MultiplePathFilterBuilder importBuilder = PathFilters.multiplePathFilterBuilder(true);
final MultiplePathFilterBuilder exportBuilder = PathFilters.multiplePathFilterBuilder(export);
int eventType;
while ((eventType = reader.nextTag()) != END_DOCUMENT) {
switch (eventType) {
case END_TAG: {
if (services.equals(D_EXPORT)) {
// If services are to be re-exported, add META-INF/services -> true near the end of the list
exportBuilder.addFilter(PathFilters.getMetaInfServicesFilter(), true);
}
if (export) {
// If re-exported, add META-INF/** -> false at the end of the list (require explicit override)
exportBuilder.addFilter(PathFilters.getMetaInfSubdirectoriesFilter(), false);
exportBuilder.addFilter(PathFilters.getMetaInfFilter(), false);
}
final PathFilter exportFilter = exportBuilder.create();
final PathFilter importFilter;
if (importBuilder.isEmpty()) {
importFilter = services.equals(D_NONE) ? PathFilters.getDefaultImportFilter() : PathFilters.getDefaultImportFilterWithServices();
} else {
if (! services.equals(D_NONE)) {