sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1376669 - in /sqoop/branches/sqoop2: client/src/main/java/org/apache/sqoop/client/request/Request.java server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java
Date Thu, 23 Aug 2012 20:03:11 GMT
Author: blee
Date: Thu Aug 23 20:03:11 2012
New Revision: 1376669

URL: http://svn.apache.org/viewvc?rev=1376669&view=rev
Log:
SQOOP-581: Send locale back to sqoop server to retrieve locale aware data

Modified:
    sqoop/branches/sqoop2/client/src/main/java/org/apache/sqoop/client/request/Request.java
    sqoop/branches/sqoop2/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java

Modified: sqoop/branches/sqoop2/client/src/main/java/org/apache/sqoop/client/request/Request.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/client/src/main/java/org/apache/sqoop/client/request/Request.java?rev=1376669&r1=1376668&r2=1376669&view=diff
==============================================================================
--- sqoop/branches/sqoop2/client/src/main/java/org/apache/sqoop/client/request/Request.java
(original)
+++ sqoop/branches/sqoop2/client/src/main/java/org/apache/sqoop/client/request/Request.java
Thu Aug 23 20:03:11 2012
@@ -23,12 +23,18 @@ import com.sun.jersey.api.client.Client;
 import com.sun.jersey.api.client.WebResource;
 import com.sun.jersey.api.client.WebResource.Builder;
 
+import java.util.Locale;
+
 public class Request
 {
   public String get(String url) {
     Client client = Client.create();
     WebResource resource = client.resource(url);
-    Builder builder = resource.accept(MediaType.APPLICATION_JSON_TYPE);
+    Builder builder = resource
+      // Sqoop is using JSON for data transfers
+      .accept(MediaType.APPLICATION_JSON_TYPE)
+      // Transfer client locale to return client specific data
+      .acceptLanguage(Locale.getDefault());
     return builder.get(String.class);
   }
-}
\ No newline at end of file
+}

Modified: sqoop/branches/sqoop2/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java?rev=1376669&r1=1376668&r2=1376669&view=diff
==============================================================================
--- sqoop/branches/sqoop2/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java
(original)
+++ sqoop/branches/sqoop2/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java
Thu Aug 23 20:03:11 2012
@@ -32,9 +32,6 @@ public class ConnectorRequestHandler imp
   private static final Logger LOG =
       Logger.getLogger(ConnectorRequestHandler.class);
 
-  /** The API version supported by this server */
-  public static final String PROTOCOL_V1 = "1";
-
   public ConnectorRequestHandler() {
     LOG.info("ConnectorRequestHandler initialized");
   }



Mime
View raw message