All Downloads are FREE. Search and download functionalities are using the official Maven repository.

be.ugent.rml.target.DirectHttpRequestTarget Maven / Gradle / Ivy

Go to download

The RMLMapper executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources.

The newest version!
package be.ugent.rml.target;

import be.ugent.rml.store.Quad;

import java.io.IOException;
import java.util.List;
import java.util.Map;


public class DirectHttpRequestTarget extends HttpRequestTarget {

    public DirectHttpRequestTarget(Map httpRequestInfo, String serializationFormat, List metadata) throws IOException {
        super(httpRequestInfo, serializationFormat, metadata);
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof DirectHttpRequestTarget) {
            DirectHttpRequestTarget target  = (DirectHttpRequestTarget) o;
            return this.httpRequestInfo.get("absoluteURI").equals(target.getHttpRequestInfo().get("absoluteURI"));
        } else {
            return false;
        }
    }

    @Override
    public String toString() {
        return "http request for " + this.httpRequestInfo.get("absoluteURI").toString();
    }

    @Override
    public void close() {
        super.close();
        try {
            HttpRequestTargetHelper helper = new HttpRequestTargetHelper();
            helper.executeHttpRequest(httpRequestInfo);
        } catch (Exception e) {
            logger.error("Failed to close http request target for {}: {}",
                    this.httpRequestInfo.get("absoluteURI"), e.getMessage());
        }
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy