jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1416666 - in /jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki: http/DatasetGraphAccessorHTTP.java http/UpdateRemote.java migrate/WebIO.java
Date Mon, 03 Dec 2012 21:15:08 GMT
Author: andy
Date: Mon Dec  3 21:15:06 2012
New Revision: 1416666

URL: http://svn.apache.org/viewvc?rev=1416666&view=rev
Log:
DefaultHttpClient -> SystemDefaultHttpClient

Modified:
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/http/DatasetGraphAccessorHTTP.java
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/http/UpdateRemote.java
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/migrate/WebIO.java

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/http/DatasetGraphAccessorHTTP.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/http/DatasetGraphAccessorHTTP.java?rev=1416666&r1=1416665&r2=1416666&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/http/DatasetGraphAccessorHTTP.java
(original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/http/DatasetGraphAccessorHTTP.java
Mon Dec  3 21:15:06 2012
@@ -30,12 +30,11 @@ import org.apache.http.HttpVersion ;
 import org.apache.http.client.HttpClient ;
 import org.apache.http.client.methods.* ;
 import org.apache.http.entity.InputStreamEntity ;
-import org.apache.http.impl.client.DefaultHttpClient ;
+import org.apache.http.impl.client.SystemDefaultHttpClient ;
 import org.apache.http.params.BasicHttpParams ;
 import org.apache.http.params.HttpConnectionParams ;
 import org.apache.http.params.HttpParams ;
 import org.apache.http.params.HttpProtocolParams ;
-import org.apache.http.protocol.HTTP ;
 import org.apache.jena.atlas.io.IO ;
 import org.apache.jena.atlas.lib.IRILib ;
 import org.apache.jena.atlas.lib.Sink ;
@@ -176,7 +175,7 @@ public class DatasetGraphAccessorHTTP im
         HttpParams httpParams$ = new BasicHttpParams() ;
         // See DefaultHttpClient.createHttpParams
         HttpProtocolParams.setVersion(httpParams$,               HttpVersion.HTTP_1_1);
-        HttpProtocolParams.setContentCharset(httpParams$,        HTTP.DEFAULT_CONTENT_CHARSET);
+        HttpProtocolParams.setContentCharset(httpParams$,        WebContent.charsetUTF8);
         HttpProtocolParams.setUseExpectContinue(httpParams$,     true);
         HttpConnectionParams.setTcpNoDelay(httpParams$,          true);
         HttpConnectionParams.setSocketBufferSize(httpParams$,    32*1024);
@@ -194,7 +193,7 @@ public class DatasetGraphAccessorHTTP im
 
     private Graph exec(String targetStr, Graph graphToSend, HttpUriRequest httpRequest, boolean
processBody)
     {
-        HttpClient httpclient = new DefaultHttpClient(httpParams) ;
+        HttpClient httpclient = new SystemDefaultHttpClient(httpParams) ;
         
         if ( graphToSend != null )
         {
@@ -207,7 +206,7 @@ public class DatasetGraphAccessorHTTP im
             ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()) ;
             InputStreamEntity reqEntity = new InputStreamEntity(in, bytes.length) ;
             reqEntity.setContentType(WebContent.contentTypeRDFXML) ;
-            reqEntity.setContentEncoding(HTTP.UTF_8) ;
+            reqEntity.setContentEncoding(WebContent.charsetUTF8) ;
             HttpEntity entity = reqEntity ;
             ((HttpEntityEnclosingRequestBase)httpRequest).setEntity(entity) ;
         }

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/http/UpdateRemote.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/http/UpdateRemote.java?rev=1416666&r1=1416665&r2=1416666&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/http/UpdateRemote.java (original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/http/UpdateRemote.java Mon
Dec  3 21:15:06 2012
@@ -48,36 +48,5 @@ public class UpdateRemote
     {
         UpdateProcessor proc = UpdateExecutionFactory.createRemote(request, serviceURL) ;
         proc.execute() ;
-
-//        HttpPost httpPost = new HttpPost(serviceURL) ;
-//        ByteArrayOutputStream b_out = new ByteArrayOutputStream() ;
-//        IndentedWriter out = new IndentedWriter(b_out) ; 
-//        UpdateWriter.output(request, out) ;
-//        out.flush() ;
-//        byte[] bytes = b_out.toByteArray() ;
-//        AbstractHttpEntity reqEntity = new ByteArrayEntity(bytes) ;
-//        reqEntity.setContentType(WebContent.contentTypeSPARQLUpdate) ;
-//        reqEntity.setContentEncoding(HTTP.UTF_8) ;
-//        httpPost.setEntity(reqEntity) ;
-//        HttpClient httpclient = new DefaultHttpClient() ;
-//
-//        try
-//        {
-//            HttpResponse response = httpclient.execute(httpPost) ;
-//            int responseCode = response.getStatusLine().getStatusCode() ;
-//            String responseMessage = response.getStatusLine().getReasonPhrase() ;
-//            
-//            if ( responseCode == HttpSC.NO_CONTENT_204 )
-//                return ;
-//            if ( responseCode == HttpSC.OK_200 )
-//                // But what was the content?
-//                // TODO read body 
-//                return ; 
-//            throw new UpdateException(responseCode+" "+responseMessage) ;
-//        } catch (IOException ex)
-//        {
-//            throw new UpdateException(ex) ;
-//        }
-            
     }
 }

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/migrate/WebIO.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/migrate/WebIO.java?rev=1416666&r1=1416665&r2=1416666&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/migrate/WebIO.java (original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/migrate/WebIO.java Mon Dec
 3 21:15:06 2012
@@ -26,7 +26,7 @@ import org.apache.http.HttpResponse ;
 import org.apache.http.client.HttpClient ;
 import org.apache.http.client.methods.HttpGet ;
 import org.apache.http.client.methods.HttpUriRequest ;
-import org.apache.http.impl.client.DefaultHttpClient ;
+import org.apache.http.impl.client.SystemDefaultHttpClient ;
 import org.apache.jena.atlas.io.IO ;
 import org.apache.jena.fuseki.FusekiRequestException ;
 
@@ -36,7 +36,7 @@ public class WebIO
     public static String exec_get(String url)
     {
         HttpUriRequest httpGet = new HttpGet(url) ;
-        HttpClient httpclient = new DefaultHttpClient() ;
+        HttpClient httpclient = new SystemDefaultHttpClient() ;
         try {
             HttpResponse response = httpclient.execute(httpGet) ;
             int responseCode = response.getStatusLine().getStatusCode() ;



Mime
View raw message