private DataIdentification createIdentificationInfo(final Identifier identifier,
final Set<InternationalString> publisher) throws IOException
{
DefaultDataIdentification identification = null;
Set<InternationalString> project = null;
DefaultLegalConstraints constraints = null;
boolean hasExtent = false;
for (final String path : searchPath) {
decoder.setSearchPath(path);
final Keywords standard = createKeywords(KeywordType.THEME, true);
final Keywords keywords = createKeywords(KeywordType.THEME, false);
final String topic = decoder.stringValue(TOPIC_CATEGORY);
final String type = decoder.stringValue(DATA_TYPE);
final String credits = decoder.stringValue(ACKNOWLEDGMENT);
final String license = decoder.stringValue(LICENSE);
final String access = decoder.stringValue(ACCESS_CONSTRAINT);
final Extent extent = hasExtent ? null : createExtent();
if (standard!=null || keywords!=null || topic != null || type!=null || credits!=null || license!=null || access!= null || extent!=null) {
if (identification == null) {
identification = new DefaultDataIdentification();
}
if (topic != null) addIfAbsent(identification.getTopicCategories(), Types.forCodeName(TopicCategory.class, topic, true));
if (type != null) addIfAbsent(identification.getSpatialRepresentationTypes(), Types.forCodeName(SpatialRepresentationType.class, type, true));
if (standard != null) addIfAbsent(identification.getDescriptiveKeywords(), standard);
if (keywords != null) addIfAbsent(identification.getDescriptiveKeywords(), keywords);
if (credits != null) addIfAbsent(identification.getCredits(), credits);
if (license != null) addIfAbsent(identification.getResourceConstraints(), constraints = new DefaultLegalConstraints(license));
if (access != null) {
for (String keyword : access.split(KEYWORD_SEPARATOR)) {
keyword = keyword.trim();
if (!keyword.isEmpty()) {
if (constraints == null) {
identification.getResourceConstraints().add(constraints = new DefaultLegalConstraints());
}
addIfAbsent(constraints.getAccessConstraints(), Types.forCodeName(Restriction.class, keyword, true));
}
}
}
if (extent != null) {
// Takes only ONE extent, because a NetCDF file may declare many time the same