/[projects]/dao/FuldDaekningWorker/src/main/java/dk/daoas/fulddaekning/osrm/OSRMHelper.java
ViewVC logotype

Diff of /dao/FuldDaekningWorker/src/main/java/dk/daoas/fulddaekning/osrm/OSRMHelper.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2749 by torben, Thu Oct 8 14:27:54 2015 UTC revision 2750 by torben, Thu Oct 8 18:31:53 2015 UTC
# Line 1  Line 1 
1  package dk.daoas.fulddaekning.osrm;  package dk.daoas.fulddaekning.osrm;
2    
3  import java.io.IOException;  import java.io.IOException;
 import java.util.ArrayList;  
4  import java.util.Collection;  import java.util.Collection;
 import java.util.Iterator;  
 import java.util.List;  
 import java.util.concurrent.Future;  
5  import java.util.logging.Level;  import java.util.logging.Level;
6  import java.util.logging.Logger;  import java.util.logging.Logger;
7    
8    import net.minidev.json.JSONValue;
9    
10  import org.apache.http.HttpEntity;  import org.apache.http.HttpEntity;
 import org.apache.http.HttpHost;  
 import org.apache.http.HttpRequest;  
11  import org.apache.http.HttpResponse;  import org.apache.http.HttpResponse;
12  import org.apache.http.client.ClientProtocolException;  import org.apache.http.client.ClientProtocolException;
13  import org.apache.http.client.ResponseHandler;  import org.apache.http.client.ResponseHandler;
14  import org.apache.http.client.methods.HttpGet;  import org.apache.http.client.methods.HttpGet;
15  import org.apache.http.impl.client.CloseableHttpClient;  import org.apache.http.impl.client.CloseableHttpClient;
16  import org.apache.http.impl.client.HttpClients;  import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.nio.client.CloseableHttpPipeliningClient;  
 import org.apache.http.impl.nio.client.HttpAsyncClients;  
17  import org.apache.http.util.EntityUtils;  import org.apache.http.util.EntityUtils;
18    
19  import com.google.gson.Gson;  import com.google.gson.Gson;
# Line 73  public class OSRMHelper { Line 67  public class OSRMHelper {
67    
68                  try {                  try {
69                          String txtResponse = HttpUtil.getContentString(sb.toString(), 500, "UTF-8");                          String txtResponse = HttpUtil.getContentString(sb.toString(), 500, "UTF-8");
70                          OSRMDistanceTable table = gson.fromJson(txtResponse, OSRMDistanceTable.class);                          //OSRMDistanceTable table = gson.fromJson(txtResponse, OSRMDistanceTable.class);
71                            OSRMDistanceTable table = JSONValue.parse(txtResponse, OSRMDistanceTable.class);
72                          if (table.status != 0) {                          if (table.status != 0) {
73                                  logger.info("OSRM failed with message: " + table.status_message);                                  logger.info("OSRM failed with message: " + table.status_message);
74                                  return null;                                  return null;

Legend:
Removed from v.2749  
changed lines
  Added in v.2750

  ViewVC Help
Powered by ViewVC 1.1.20