jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1498078 - in /jena/trunk/jena-arq/src/main/java: com/hp/hpl/jena/sparql/engine/http/ com/hp/hpl/jena/sparql/modify/ org/apache/jena/atlas/web/
Date Sun, 30 Jun 2013 10:22:16 GMT
Author: andy
Date: Sun Jun 30 10:22:15 2013
New Revision: 1498078

URL: http://svn.apache.org/r1498078
Log:
Rename ContentType.parse a .create
Move struct class that is output of parsing a media type string intio MediaType.

Removed:
    jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/ParsedMediaType.java
Modified:
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateProcessRemote.java
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateProcessRemoteForm.java
    jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/ContentType.java
    jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/MediaType.java
    jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/TypedInputStream.java

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java?rev=1498078&r1=1498077&r2=1498078&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java (original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java Sun
Jun 30 10:22:15 2013
@@ -344,8 +344,7 @@ public class HttpQuery extends Params {
                 client = new DecompressingHttpClient(client);
             }
 
-            TypedInputStream stream = HttpOp.execHttpPostForm(serviceURL, contentTypeResult,
this, client, context,
-                    this.authenticator);
+            TypedInputStream stream = HttpOp.execHttpPostForm(serviceURL, this, contentTypeResult,
client, context, authenticator);
             if (stream == null)
                 throw new QueryExceptionHTTP(404);
             return execCommon(stream);

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateProcessRemote.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateProcessRemote.java?rev=1498078&r1=1498077&r2=1498078&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateProcessRemote.java
(original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateProcessRemote.java
Sun Jun 30 10:22:15 2013
@@ -60,7 +60,7 @@ public class UpdateProcessRemote extends
         
         // Execution
         String reqStr = this.getUpdateRequest().toString() ;
-        HttpOp.execHttpPost(endpoint, WebContent.contentTypeSPARQLUpdate, reqStr, null, null,
getHttpContext(), getAuthenticator()) ;
+        HttpOp.execHttpPost(endpoint, WebContent.contentTypeSPARQLUpdate, reqStr, null, null,
null, getHttpContext(), getAuthenticator()) ;
     }
 }
 

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateProcessRemoteForm.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateProcessRemoteForm.java?rev=1498078&r1=1498077&r2=1498078&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateProcessRemoteForm.java
(original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateProcessRemoteForm.java
Sun Jun 30 10:22:15 2013
@@ -18,16 +18,12 @@
 
 package com.hp.hpl.jena.sparql.modify;
 
-import java.util.HashMap ;
-import java.util.Map ;
-
 import org.apache.jena.riot.web.HttpOp ;
-import org.apache.jena.riot.web.HttpResponseHandler ;
 import org.apache.jena.riot.web.HttpResponseLib ;
 
 import com.hp.hpl.jena.sparql.ARQException ;
-import com.hp.hpl.jena.sparql.engine.http.HttpParams;
-import com.hp.hpl.jena.sparql.engine.http.Params;
+import com.hp.hpl.jena.sparql.engine.http.HttpParams ;
+import com.hp.hpl.jena.sparql.engine.http.Params ;
 import com.hp.hpl.jena.sparql.util.Context ;
 import com.hp.hpl.jena.update.UpdateProcessor ;
 import com.hp.hpl.jena.update.UpdateRequest ;
@@ -63,9 +59,7 @@ public class UpdateProcessRemoteForm ext
         String reqStr = this.getUpdateRequest().toString() ;
         Params ps = new Params(this.getParams());
         ps.addParam(HttpParams.pUpdate, reqStr);
-        Map<String, HttpResponseHandler> handlers = new HashMap<String, HttpResponseHandler>()
;
-        handlers.put("*", HttpResponseLib.nullResponse) ;
-        HttpOp.execHttpPostForm(this.getEndpoint(), ps, handlers, getHttpContext(), getAuthenticator())
;
+        HttpOp.execHttpPostForm(this.getEndpoint(), ps, null, HttpResponseLib.nullResponse,
null, getHttpContext(), getAuthenticator()) ;
     }
 }
 

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/ContentType.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/ContentType.java?rev=1498078&r1=1498077&r2=1498078&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/ContentType.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/ContentType.java Sun Jun 30
10:22:15 2013
@@ -18,13 +18,17 @@
 
 package org.apache.jena.atlas.web;
 
-/** A restricted MediaType */
+/** A restricted view of MediaType */
 public class ContentType
 {
     private MediaType mediaType ;
     private static final String charsetParamName              = "charset" ;
     
-    public static ContentType parse(String string)
+    /**  @deprecated use {@linkplain #create(String)} */
+    @Deprecated
+    public static ContentType parse(String string)  { return create(string) ; }
+    
+    public static ContentType create(String string)
     {
         ContentType ct = new ContentType(MediaType.create(string)) ;
         return ct ;
@@ -32,7 +36,7 @@ public class ContentType
     
     public static ContentType create(String ctString, String charset)
     {
-        ParsedMediaType x = MediaType.parse(ctString) ;
+        MediaType.ParsedMediaType x = MediaType.parse(ctString) ;
         x.params.put(charsetParamName, charset) ;
         return new ContentType(new MediaType(x)) ;
     }

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/MediaType.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/MediaType.java?rev=1498078&r1=1498077&r2=1498078&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/MediaType.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/MediaType.java Sun Jun 30
10:22:15 2013
@@ -203,4 +203,14 @@ public class MediaType
 //    public void setSubType(String subType)  { this.subType = subType ; strContentType =
null ; }
     public String getType()                 { return type ; }
 //    public void setType(String type)        { this.type = type ; strContentType = null
; }
+    
+    /** The outcome of parsing 
+     * @see MediaType#parse 
+     */
+    /*package*/ static class ParsedMediaType
+    {
+        public String type ;
+        public String subType ;
+        public Map<String, String> params = new LinkedHashMap<String, String>()
;
+    }
 }

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/TypedInputStream.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/TypedInputStream.java?rev=1498078&r1=1498077&r2=1498078&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/TypedInputStream.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/atlas/web/TypedInputStream.java Sun
Jun 30 10:22:15 2013
@@ -32,6 +32,9 @@ public class TypedInputStream extends Fi
     public TypedInputStream(InputStream in)
     { this(in, (ContentType)null, null) ; }
     
+    public TypedInputStream(InputStream in, String contentType)
+    { this(in, ContentType.create(contentType), null) ; }
+
     public TypedInputStream(InputStream in, String mediaType, String charset)
     { this(in, mediaType, charset, null) ; }
     



Mime
View raw message