Strabon

changeset 85:965d0bb83d84

fixed imports and warnings
author Babis Nikolaou <charnik@di.uoa.gr>
date Wed Apr 04 14:14:09 2012 +0300 (2012-04-04)
parents 5c698cb0a3d5
children 64d3889773a9
files endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java
line diff
     1.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Sun Apr 01 22:15:34 2012 +0300
     1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Wed Apr 04 14:14:09 2012 +0300
     1.3 @@ -6,7 +6,6 @@
     1.4  import java.io.IOException;
     1.5  import java.io.PrintWriter;
     1.6  import java.math.BigInteger;
     1.7 -import java.net.InetAddress;
     1.8  import java.security.SecureRandom;
     1.9  import java.util.Date;
    1.10  import java.util.Iterator;
    1.11 @@ -18,11 +17,6 @@
    1.12  import javax.servlet.http.HttpServletRequest;
    1.13  import javax.servlet.http.HttpServletResponse;
    1.14  
    1.15 -import org.apache.commons.httpclient.HttpClient;
    1.16 -import org.apache.commons.httpclient.HttpException;
    1.17 -import org.apache.commons.httpclient.HttpMethod;
    1.18 -import org.apache.commons.httpclient.NameValuePair;
    1.19 -import org.apache.commons.httpclient.methods.GetMethod;
    1.20  import org.apache.commons.io.FileUtils;
    1.21  import org.openrdf.query.MalformedQueryException;
    1.22  import org.openrdf.query.QueryEvaluationException;
    1.23 @@ -58,28 +52,6 @@
    1.24  				this.errorMessage = null;				
    1.25  			}
    1.26  			
    1.27 -			public String getTinyURL(String fullURL){
    1.28 -				String tinyUrl = null;
    1.29 -				
    1.30 -				try {
    1.31 -					HttpClient httpclient = new HttpClient();
    1.32 -					HttpMethod method = new GetMethod("http://tinyurl.com/api-create.php"); 
    1.33 -					method.setQueryString(new NameValuePair[]{new NameValuePair("url",fullURL)});
    1.34 -					httpclient.executeMethod(method);
    1.35 -					tinyUrl = method.getResponseBodyAsString();
    1.36 -					method.releaseConnection();
    1.37 -					
    1.38 -				} catch (HttpException e) {
    1.39 -					// TODO Auto-generated catch block
    1.40 -					e.printStackTrace();
    1.41 -				} catch (IOException e) {
    1.42 -					// TODO Auto-generated catch block
    1.43 -					e.printStackTrace();
    1.44 -				}
    1.45 -				
    1.46 -				return tinyUrl;
    1.47 -			}
    1.48 -			
    1.49  			public String getSPARQLQuery() {
    1.50  				return SPARQLQuery;
    1.51  			}
    1.52 @@ -246,7 +218,7 @@
    1.53      	     
    1.54   			 response.setContentType("application/vnd.google-earth.kml+xml; charset=UTF-8");
    1.55   			 response.setDateHeader("Expires", 0);
    1.56 - 			 InetAddress thisIp =InetAddress.getLocalHost();
    1.57 + 			 //InetAddress thisIp =InetAddress.getLocalHost();
    1.58   			 response.setHeader("Location", request.getScheme() + "://" +  request.getServerName() +":" + request.getServerPort() +"/tmp/" + temp + ".kml");
    1.59   			 response.setStatus(301);
    1.60               
     2.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java	Sun Apr 01 22:15:34 2012 +0300
     2.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java	Wed Apr 04 14:14:09 2012 +0300
     2.3 @@ -12,7 +12,6 @@
     2.4  import org.openrdf.repository.RepositoryException;
     2.5  import org.openrdf.repository.sail.SailRepositoryConnection;
     2.6  import org.openrdf.rio.RDFFormat;
     2.7 -import org.openrdf.rio.RDFParseException;
     2.8  
     2.9  import eu.earthobservatory.runtime.postgis.Strabon;
    2.10