use of org.opengis.metadata.distribution.Distributor in project tika by apache.
the class GeographicInformationParser method getMetaDataDistributionInfo.
private void getMetaDataDistributionInfo(Metadata metadata, DefaultMetadata defaultMetaData) {
Distribution distribution = defaultMetaData.getDistributionInfo();
ArrayList<Format> distributionFormat = (ArrayList<Format>) distribution.getDistributionFormats();
for (Format f : distributionFormat) {
if (f.getName() != null)
metadata.add("DistributionFormatSpecificationAlternativeTitle ", f.getName().toString());
}
ArrayList<Distributor> distributorList = (ArrayList<Distributor>) distribution.getDistributors();
for (Distributor d : distributorList) {
if (d != null && d.getDistributorContact() != null && d.getDistributorContact().getRole() != null)
metadata.add("Distributor Contact ", d.getDistributorContact().getRole().name());
if (d != null && d.getDistributorContact() != null && d.getDistributorContact().getOrganisationName() != null)
metadata.add("Distributor Organization Name ", d.getDistributorContact().getOrganisationName().toString());
}
ArrayList<DigitalTransferOptions> transferOptionsList = (ArrayList<DigitalTransferOptions>) distribution.getTransferOptions();
for (DigitalTransferOptions d : transferOptionsList) {
ArrayList<OnlineResource> onlineResourceList = (ArrayList<OnlineResource>) d.getOnLines();
for (OnlineResource or : onlineResourceList) {
if (or.getLinkage() != null)
metadata.add("TransferOptionsOnlineLinkage ", or.getLinkage().toString());
if (or.getProtocol() != null)
metadata.add("TransferOptionsOnlineProtocol ", or.getProtocol());
if (or.getApplicationProfile() != null)
metadata.add("TransferOptionsOnlineProfile ", or.getApplicationProfile());
if (or.getName() != null)
metadata.add("TransferOptionsOnlineName ", or.getName());
if (or.getDescription() != null)
metadata.add("TransferOptionsOnlineDescription ", or.getDescription().toString());
if (or.getFunction() != null)
metadata.add("TransferOptionsOnlineFunction ", or.getFunction().name());
}
}
}
Aggregations