Strabon

changeset 1271:20f097eecaaa temporals

made HTTPClient.getConnectionURL public in order for a client of SPARQLEndpoint to have access to the URL connection to the endpoint.
author Babis Nikolaou <charnik@di.uoa.gr>
date Tue Oct 15 17:24:37 2013 +0300 (2013-10-15)
parents 5e650277cbdf
children 6dad7863e24d
files endpoint-client/src/main/java/eu/earthobservatory/org/StrabonEndpoint/client/HTTPClient.java endpoint-client/src/main/java/eu/earthobservatory/org/StrabonEndpoint/client/SPARQLEndpoint.java
line diff
     1.1 --- a/endpoint-client/src/main/java/eu/earthobservatory/org/StrabonEndpoint/client/HTTPClient.java	Mon Aug 19 14:24:43 2013 +0300
     1.2 +++ b/endpoint-client/src/main/java/eu/earthobservatory/org/StrabonEndpoint/client/HTTPClient.java	Tue Oct 15 17:24:37 2013 +0300
     1.3 @@ -106,7 +106,7 @@
     1.4  	 * 
     1.5  	 * @return
     1.6  	 */
     1.7 -	protected String getConnectionURL() {
     1.8 +	public String getConnectionURL() {
     1.9  		return "http://" + host + ":" + port + "/" + endpointName; 
    1.10  	}
    1.11  }
     2.1 --- a/endpoint-client/src/main/java/eu/earthobservatory/org/StrabonEndpoint/client/SPARQLEndpoint.java	Mon Aug 19 14:24:43 2013 +0300
     2.2 +++ b/endpoint-client/src/main/java/eu/earthobservatory/org/StrabonEndpoint/client/SPARQLEndpoint.java	Tue Oct 15 17:24:37 2013 +0300
     2.3 @@ -18,15 +18,11 @@
     2.4  import java.util.ArrayList;
     2.5  import java.util.List;
     2.6  
     2.7 -import org.apache.commons.httpclient.params.HostParams;
     2.8 -import org.apache.commons.httpclient.params.HttpMethodParams;
     2.9 -import org.apache.commons.httpclient.params.HttpParams;
    2.10  import org.apache.http.HttpEntity;
    2.11  import org.apache.http.HttpResponse;
    2.12  import org.apache.http.NameValuePair;
    2.13  import org.apache.http.client.entity.UrlEncodedFormEntity;
    2.14  import org.apache.http.client.methods.HttpPost;
    2.15 -import org.apache.http.entity.StringEntity;
    2.16  import org.apache.http.message.BasicNameValuePair;
    2.17  import org.apache.xerces.impl.dv.util.Base64;
    2.18  import org.openrdf.query.resultio.TupleQueryResultFormat;
    2.19 @@ -40,10 +36,10 @@
    2.20   * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    2.21   * @author Kallirroi Dogani <kallirroi@di.uoa.gr.
    2.22   */
    2.23 -public class SPARQLEndpoint extends HTTPClient{
    2.24 +public class SPARQLEndpoint extends HTTPClient {
    2.25  
    2.26  	public SPARQLEndpoint(String host, int port) {
    2.27 -		super(host, port);
    2.28 +		this(host, port, "");
    2.29  	}
    2.30  	
    2.31  	public SPARQLEndpoint(String host, int port, String endpointName) {
    2.32 @@ -361,7 +357,6 @@
    2.33  		throw new UnsupportedOperationException();
    2.34  	}
    2.35  	
    2.36 -	
    2.37  	public static void main(String args[]) {
    2.38  		if (args.length < 4) {
    2.39  			System.err.println("Usage: eu.earthobservatory.org.StrabonEndpoint.client.SPARQLEndpoint <HOST> <PORT> <APPNAME> [<FORMAT>]");