Search in sources :

Example 1 with Distribution

use of org.opengis.metadata.distribution.Distribution 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());
        }
    }
}
Also used : OnlineResource(org.opengis.metadata.citation.OnlineResource) Format(org.opengis.metadata.distribution.Format) Distributor(org.opengis.metadata.distribution.Distributor) Distribution(org.opengis.metadata.distribution.Distribution) CheckedArrayList(org.apache.sis.internal.util.CheckedArrayList) ArrayList(java.util.ArrayList) DigitalTransferOptions(org.opengis.metadata.distribution.DigitalTransferOptions)

Aggregations

ArrayList (java.util.ArrayList)1 CheckedArrayList (org.apache.sis.internal.util.CheckedArrayList)1 OnlineResource (org.opengis.metadata.citation.OnlineResource)1 DigitalTransferOptions (org.opengis.metadata.distribution.DigitalTransferOptions)1 Distribution (org.opengis.metadata.distribution.Distribution)1 Distributor (org.opengis.metadata.distribution.Distributor)1 Format (org.opengis.metadata.distribution.Format)1