Comments and code clean up.
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/web/ContentType.java b/jena-arq/src/main/java/org/apache/jena/atlas/web/ContentType.java
index e62da46..b0be69c 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/web/ContentType.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/web/ContentType.java
@@ -41,7 +41,16 @@
mediaType = m ;
}
- public String getContentType() {
+ /** @deprecated Use {@link #getContentTypeStr} */
+ @Deprecated
+ public String getContentType() { return getContentTypeStr(); }
+
+ /**
+ * Get the type/subtype as a string.
+ * @see #toHeaderString toHeaderString for use in HTTP headers.
+ */
+
+ public String getContentTypeStr() {
return mediaType.getContentType() ;
}
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/web/HttpException.java b/jena-arq/src/main/java/org/apache/jena/atlas/web/HttpException.java
index 1ce157c..cf2a942 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/web/HttpException.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/web/HttpException.java
@@ -18,6 +18,8 @@
package org.apache.jena.atlas.web;
+import org.apache.jena.web.HttpSC;
+
/**
* Class of HTTP Exceptions from Atlas code
*
@@ -28,12 +30,17 @@
private String response;
public HttpException(int statusCode, String statusLine, String response) {
- super(statusCode + " - " + statusLine);
+ super(exMessage(statusCode, statusLine));
this.statusCode = statusCode;
this.statusLine = statusLine ;
this.response = response;
}
+ private static String exMessage(int statusCode, String statusLine) {
+ if ( statusLine == null )
+ statusLine = HttpSC.getMessage(statusCode);
+ return statusCode+" - "+HttpSC.getMessage(statusCode);
+ }
public HttpException(String message) {
super(message);
@@ -66,7 +73,7 @@
}
/**
- * Gets the response code, may be null if unknown
+ * Gets the status line text, may be null if unknown. HTTP/2 does not have status line text.
* @return Status line
*/
public String getStatusLine() {
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/web/TypedInputStream.java b/jena-arq/src/main/java/org/apache/jena/atlas/web/TypedInputStream.java
index 1b1eca4..20f3b85 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/web/TypedInputStream.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/web/TypedInputStream.java
@@ -34,10 +34,6 @@
private boolean isClosed = false ;
public static TypedInputStream wrap(InputStream in) {
- //Sometimes this is used to intentional loose the content type (in tests).
-// if ( in instanceof TypedInputStream ) {
-// return (TypedInputStream)in;
-// }
return new TypedInputStream(in);
}
@@ -47,11 +43,11 @@
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) ; }
-
- public TypedInputStream(InputStream in, String mediaType, String charset, String baseURI)
- { this(in, ContentType.create(mediaType, charset), baseURI) ; }
+// public TypedInputStream(InputStream in, String mediaType, String charset)
+// { this(in, mediaType, charset, null) ; }
+//
+// public TypedInputStream(InputStream in, String mediaType, String charset, String baseURI)
+// { this(in, ContentType.create(mediaType, charset), baseURI) ; }
public TypedInputStream(InputStream in, ContentType ct)
{ this(in, ct, null) ; }
@@ -63,7 +59,7 @@
this.baseURI = baseURI ;
}
- public String getContentType() { return mediaType == null ? null : mediaType.getContentType() ; }
+ public String getContentType() { return mediaType == null ? null : mediaType.getContentTypeStr() ; }
public String getCharset() { return mediaType == null ? null : mediaType.getCharset() ; }
public ContentType getMediaType() { return mediaType ; }
public String getBaseURI() { return baseURI ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/query/DatasetAccessor.java b/jena-arq/src/main/java/org/apache/jena/query/DatasetAccessor.java
index 23c1d31..82329b3 100644
--- a/jena-arq/src/main/java/org/apache/jena/query/DatasetAccessor.java
+++ b/jena-arq/src/main/java/org/apache/jena/query/DatasetAccessor.java
@@ -28,7 +28,9 @@
* {@code DatasetAccessor}s to local and remote (over HTTP) data.
*
* @see DatasetAccessorFactory
+ * @deprecated Use {@code RDFConnection}.
*/
+@Deprecated
public interface DatasetAccessor
{
/** Get the default model of a Dataset */
diff --git a/jena-arq/src/main/java/org/apache/jena/query/DatasetAccessorFactory.java b/jena-arq/src/main/java/org/apache/jena/query/DatasetAccessorFactory.java
index c954019..d728d75 100644
--- a/jena-arq/src/main/java/org/apache/jena/query/DatasetAccessorFactory.java
+++ b/jena-arq/src/main/java/org/apache/jena/query/DatasetAccessorFactory.java
@@ -28,7 +28,9 @@
/**
* Factory which produces dataset accessors
*
+ * @deprecated Use {@code RDFConnectionFactory}.
*/
+@Deprecated
public class DatasetAccessorFactory
{
/**
@@ -36,6 +38,7 @@
* @param serviceURI Service URI
* @return Accessor
*/
+
public static DatasetAccessor createHTTP(String serviceURI)
{
return adapt(new DatasetGraphAccessorHTTP(serviceURI)) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java b/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java
index d3f5c08..295158a 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/RDFLanguages.java
@@ -262,7 +262,7 @@
for (String altName : lang.getAltNames() )
mapLabelToLang.put(canonicalKey(altName), lang) ;
- mapContentTypeToLang.put(canonicalKey(lang.getContentType().getContentType()), lang) ;
+ mapContentTypeToLang.put(canonicalKey(lang.getContentType().getContentTypeStr()), lang) ;
for ( String ct : lang.getAltContentTypes() )
mapContentTypeToLang.put(canonicalKey(ct), lang) ;
for ( String ext : lang.getFileExtensions() )
@@ -285,9 +285,9 @@
return ;
// Content type.
- if ( mapContentTypeToLang.containsKey(lang.getContentType().getContentType()))
+ if ( mapContentTypeToLang.containsKey(lang.getContentType().getContentTypeStr()))
{
- String k = lang.getContentType().getContentType() ;
+ String k = lang.getContentType().getContentTypeStr() ;
error("Language overlap: " +lang+" and "+mapContentTypeToLang.get(k)+" on content type "+k) ;
}
for (String altName : lang.getAltNames() )
@@ -311,7 +311,7 @@
throw new IllegalArgumentException("null for language") ;
checkRegistration(lang) ;
mapLabelToLang.remove(canonicalKey(lang.getLabel())) ;
- mapContentTypeToLang.remove(canonicalKey(lang.getContentType().getContentType())) ;
+ mapContentTypeToLang.remove(canonicalKey(lang.getContentType().getContentTypeStr())) ;
for ( String ct : lang.getAltContentTypes() )
mapContentTypeToLang.remove(canonicalKey(ct)) ;
@@ -354,7 +354,7 @@
{
if ( ct == null )
return null ;
- String key = canonicalKey(ct.getContentType()) ;
+ String key = canonicalKey(ct.getContentTypeStr()) ;
return mapContentTypeToLang.get(key) ;
}
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java b/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java
index ae5e675..1658c0f 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java
@@ -316,7 +316,7 @@
throw new RiotException("Failed to determine the content type: (URI=" + baseUri + " : stream=" + input.getContentType()+")");
reader = createReader(ct);
if ( reader == null )
- throw new RiotException("No parser registered for content type: " + ct.getContentType());
+ throw new RiotException("No parser registered for content type: " + ct.getContentTypeStr());
}
read(reader, input, null, baseUri, context, ct, destination);
}
@@ -334,7 +334,7 @@
ReaderRIOT readerRiot = createReader(ct);
if ( readerRiot == null )
- throw new RiotException("No parser registered for content type: " + ct.getContentType());
+ throw new RiotException("No parser registered for content type: " + ct.getContentTypeStr());
Reader jr = javaReader;
if ( content != null )
jr = new StringReader(content);
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/RDFWriter.java b/jena-arq/src/main/java/org/apache/jena/riot/RDFWriter.java
index 3998bf8..8946780 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/RDFWriter.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/RDFWriter.java
@@ -140,7 +140,7 @@
throw new RiotException("Lang and RDFformat unset and can't determine syntax from '"+filename+"'");
Lang lang = RDFLanguages.contentTypeToLang(ct);
if ( lang == null )
- throw new RiotException("No syntax registered for '"+ct.getContentType()+"'");
+ throw new RiotException("No syntax registered for '"+ct.getContentTypeStr()+"'");
fmt = RDFWriterRegistry.defaultSerialization(lang);
}
if ( filename.equals("-") ) {
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/WebContent.java b/jena-arq/src/main/java/org/apache/jena/riot/WebContent.java
index 76f043e..8c43849 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/WebContent.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/WebContent.java
@@ -171,22 +171,22 @@
/** Accept header when looking for a graph */
// Catches aplication/xml and application.json
- public static final String defaultGraphAcceptHeader = defaultGraphAccept+",*/*;q=0.5" ;
+ public static final String defaultGraphAcceptHeader = defaultGraphAccept+",*/*;q=0.3" ;
/** Accept header part when looking for a dataset */
private static final String defaultDatasetAccept
- = "application/trig,application/n-quads;q=0.9,text/x-nquads;q=0.8,application/x-trig;q=0.7,application/ld+json;q=0.5" ;
+ = "application/trig,application/n-quads;q=0.9,application/ld+json;q=0.8" ;
/** Accept header when looking for a dataset */
- public static final String defaultDatasetAcceptHeader = defaultDatasetAccept+",*/*;q=0.5" ;
+ public static final String defaultDatasetAcceptHeader = defaultDatasetAccept+",*/*;q=0.3" ;
- // This is defaultGraphAccept+","+defaultDatasetAccept+",*/*;q=0.5" ; but cleaned for duplicate JSON-LD.
+ // This is the essence of defaultGraphAccept+","+defaultDatasetAccept+",*/*;q=0.5" cleaned up (e.g.de-duplicate JSON-LD).
/** Accept header when looking for a graph or dataset */
public static final String defaultRDFAcceptHeader =
"text/turtle,application/n-triples;q=0.9,application/rdf+xml;q=0.7," +
- "application/trig,application/n-quads;q=0.9,text/x-nquads;q=0.8,application/x-trig;q=0.7,application/ld+json;q=0.6," +
+ "application/trig,application/n-quads;q=0.9,application/ld+json;q=0.8," +
"*/*;q=0.5" ;
-
+
/** Return our "canonical" name for a Content Type.
* This should be the standard one, no X-*
*/
@@ -204,7 +204,7 @@
if ( ct1 == null || ct2 == null )
return false ;
- return matchContentType(ct1.getContentType(), ct2.getContentType()) ;
+ return matchContentType(ct1.getContentTypeStr(), ct2.getContentTypeStr()) ;
}
public static boolean matchContentType(String ct1, String ct2) {
@@ -214,11 +214,11 @@
public static boolean isHtmlForm(ContentType ct) {
if ( ct == null )
return false ;
- return contentTypeHTMLForm.equalsIgnoreCase(ct.getContentType()) ;
+ return contentTypeHTMLForm.equalsIgnoreCase(ct.getContentTypeStr()) ;
}
public static boolean isMultiPartForm(ContentType ct) {
- return contentTypeMultipartFormData.equalsIgnoreCase(ct.getContentType()) ;
+ return contentTypeMultipartFormData.equalsIgnoreCase(ct.getContentTypeStr()) ;
}
/**
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/web/HttpNames.java b/jena-arq/src/main/java/org/apache/jena/riot/web/HttpNames.java
index db9b350..d340dd8 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/web/HttpNames.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/web/HttpNames.java
@@ -28,8 +28,9 @@
public static final String hAcceptRanges = "Accept-Ranges" ;
public static final String hAllow = "Allow" ;
+ public static final String hAuthorization = "Authorization";
public static final String hContentEncoding = "Content-Encoding" ;
- public static final String hContentLengh = "Content-Length" ;
+ public static final String hContentLength = "Content-Length" ;
public static final String hContentLocation = "Content-Location" ;
public static final String hContentRange = "Content-Range" ;
public static final String hContentType = "Content-Type" ;
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/web/HttpOp.java b/jena-arq/src/main/java/org/apache/jena/riot/web/HttpOp.java
index 8a06cf5..1f564e4 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/web/HttpOp.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/web/HttpOp.java
@@ -751,8 +751,6 @@
return execHttpPostFormStream(url, params, acceptHeader, null, null);
}
-
-
// @formatter:off
// /**
// * Executes a HTTP POST Form.
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/http/Params.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/http/Params.java
index 78ade96..324eeb8 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/http/Params.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/http/Params.java
@@ -118,6 +118,11 @@
return URLEncodedUtils.format(paramList, StandardCharsets.UTF_8) ;
}
+ @Override
+ public String toString() {
+ return paramList.toString();
+ }
+
private List<String> getMV(String name)
{
return params.get(name) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/web/DatasetAdapter.java b/jena-arq/src/main/java/org/apache/jena/web/DatasetAdapter.java
index d4de224..928160e 100644
--- a/jena-arq/src/main/java/org/apache/jena/web/DatasetAdapter.java
+++ b/jena-arq/src/main/java/org/apache/jena/web/DatasetAdapter.java
@@ -25,7 +25,10 @@
import org.apache.jena.rdf.model.Model ;
import org.apache.jena.rdf.model.ModelFactory ;
-/** Adapter between Dataset/Model level and DatasetGraph/Graph level */
+/** Adapter between Dataset/Model level and DatasetGraph/Graph level.
+ * @deprecated Use {@code RDFConnectionFactory}.
+ */
+@Deprecated
public class DatasetAdapter implements DatasetAccessor
{
private final DatasetGraphAccessor updater ;
diff --git a/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessor.java b/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessor.java
index 74cbf4e..b8732d5 100644
--- a/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessor.java
+++ b/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessor.java
@@ -21,6 +21,8 @@
import org.apache.jena.graph.Graph ;
import org.apache.jena.graph.Node ;
+/** @deprecated This will be replaced by the {@code RDFConnection} style at the Graph/Triple level. */
+@Deprecated
public interface DatasetGraphAccessor
{
public Graph httpGet() ;
diff --git a/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorBasic.java b/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorBasic.java
index 2acf277..78912ac 100644
--- a/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorBasic.java
+++ b/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorBasic.java
@@ -27,7 +27,8 @@
/**
* General implementation of operations for the SPARQL HTTP Update protocol
* over a DatasetGraph.
- */
+/** @deprecated This will be replaced by the {@code RDFConnection} style at the Graph/Triple level. */
+@Deprecated
public class DatasetGraphAccessorBasic implements DatasetGraphAccessor
{
private DatasetGraph dataset ;
diff --git a/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java b/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java
index 24c4f9c..02e17c6 100644
--- a/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java
+++ b/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java
@@ -36,8 +36,9 @@
/**
* A dataset graph accessor that talks to stores that implement the SPARQL 1.1
- * Graph Store Protocol
- */
+ * Graph Store Protocol.
+/** @deprecated This will be replaced by the {@code RDFConnection} style at the Graph/Triple level. */
+@Deprecated
public class DatasetGraphAccessorHTTP implements DatasetGraphAccessor {
// Test for this class are in Fuseki so they can be run with a server.
@@ -46,7 +47,7 @@
private static final RDFFormat defaultSendLang = RDFFormat.RDFXML_PLAIN ;
private final String remote ;
- private HttpClient client ;
+ private HttpClient client ;
private RDFFormat formatPutPost = defaultSendLang ;
@@ -227,7 +228,7 @@
} ;
EntityTemplate entity = new EntityTemplate(producer) ;
- String ct = syntax.getLang().getContentType().getContentType() ;
+ String ct = syntax.getLang().getContentType().getContentTypeStr() ;
entity.setContentType(ct) ;
return entity ;
}
diff --git a/jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java b/jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java
index 9588440..8a3dde9 100644
--- a/jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java
+++ b/jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java
@@ -31,6 +31,7 @@
import org.apache.jena.sparql.sse.SSE ;
import org.junit.Test ;
+@SuppressWarnings("deprecation")
public abstract class AbstractTestDatasetGraphAccessor extends BaseTest
{
protected static final String gn1 = "http://graph/1" ;
diff --git a/jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java b/jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java
index 14295c3..892ed06 100644
--- a/jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java
+++ b/jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java
@@ -23,6 +23,7 @@
import org.apache.jena.sparql.core.DatasetGraph ;
import org.apache.jena.sparql.core.DatasetGraphFactory ;
+@SuppressWarnings("deprecation")
public class TestDatasetGraphAccessorMem extends AbstractTestDatasetGraphAccessor
{
@Override
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/graph/TestDatasetGraphAccessorTDB.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/graph/TestDatasetGraphAccessorTDB.java
index 64596c1..8367758 100644
--- a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/graph/TestDatasetGraphAccessorTDB.java
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/graph/TestDatasetGraphAccessorTDB.java
@@ -27,6 +27,7 @@
import org.junit.After;
import org.junit.Before;
+@SuppressWarnings("deprecation")
public class TestDatasetGraphAccessorTDB extends AbstractTestDatasetGraphAccessor
{
DatasetGraph dsg = TL.createTestDatasetGraphMem();
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/DEF.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/DEF.java
index 67442fd..0af3881 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/DEF.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/DEF.java
@@ -98,16 +98,4 @@
contentTypeXML,
contentTypeTextPlain
);
-
-
- // Names for services in the default configuration
- public static final String ServiceQuery = "query";
- public static final String ServiceQueryAlt = "sparql";
- public static final String ServiceUpdate = "update";
-
- public static final String ServiceDataset = "dataset";
- public static final String ServiceDatasetAlt = "quads";
- public static final String ServiceData = "data";
- public static final String ServiceUpload = "upload";
- public static final String ServiceGeneralQuery = "/sparql";
}
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/auth/Auth.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/auth/Auth.java
index c163e11..5cbf15f 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/auth/Auth.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/auth/Auth.java
@@ -19,6 +19,7 @@
package org.apache.jena.fuseki.auth;
import java.util.Arrays;
+import java.util.Base64;
import java.util.Collection;
import java.util.Objects;
@@ -103,4 +104,20 @@
notAllowed.run();
return false;
}
+
+ /**
+ * Calculate the value of the "Authentication" HTTP header for basic auth. Basic
+ * auth is not secure when used over HTTP (the password can be extracted). Use
+ * with HTTPS is better.
+ * <p>
+ * Unlike digest auth, basic auth can be setup without an extra round trip to the
+ * server, making it easier for scripts where teh body is not replayable.
+ *
+ * @param username
+ * @param password
+ * @return String
+ */
+ private static String basicAuth(String username, String password) {
+ return "Basic " + Base64.getEncoder().encodeToString((username + ":" + password).getBytes());
+ }
}
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionExecLib.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionExecLib.java
index 3de11e4..fc3ff5d 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionExecLib.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionExecLib.java
@@ -127,7 +127,7 @@
else
ServletOps.responseSendError(response, ex.getStatusCode(), ex.getMessage());
} catch (RuntimeIOException ex) {
- FmtLog.warn(action.log, ex, "[%d] Runtime IO Exception (client left?) RC = %d : %s", action.id, HttpSC.INTERNAL_SERVER_ERROR_500, ex.getMessage());
+ FmtLog.warn(action.log, /*ex,*/ "[%d] Runtime IO Exception (client left?) RC = %d : %s", action.id, HttpSC.INTERNAL_SERVER_ERROR_500, ex.getMessage());
ServletOps.responseSendError(response, HttpSC.INTERNAL_SERVER_ERROR_500, ex.getMessage());
} catch (Throwable ex) {
// This should not happen.
@@ -225,12 +225,12 @@
if ( action.responseContentType != null )
FmtLog.info(action.log,"[%d] <= %-20s %s", action.id, HttpNames.hContentType+":", action.responseContentType);
if ( action.responseContentLength != -1 )
- FmtLog.info(action.log,"[%d] <= %-20s %d", action.id, HttpNames.hContentLengh+":", action.responseContentLength);
+ FmtLog.info(action.log,"[%d] <= %-20s %d", action.id, HttpNames.hContentLength+":", action.responseContentLength);
for (Map.Entry<String, String> e : action.headers.entrySet()) {
// Skip already printed.
if ( e.getKey().equalsIgnoreCase(HttpNames.hContentType) && action.responseContentType != null)
continue;
- if ( e.getKey().equalsIgnoreCase(HttpNames.hContentLengh) && action.responseContentLength != -1)
+ if ( e.getKey().equalsIgnoreCase(HttpNames.hContentLength) && action.responseContentLength != -1)
continue;
FmtLog.info(action.log,"[%d] <= %-20s %s", action.id, e.getKey()+":", e.getValue());
}
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionLib.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionLib.java
index c4974c1..a2cefaa 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionLib.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionLib.java
@@ -220,14 +220,14 @@
ContentType ct = ActionLib.getContentType(action);
Lang lang;
- if ( ct == null || ct.getContentType().isEmpty() ) {
+ if ( ct == null || ct.getContentTypeStr().isEmpty() ) {
// head "Content-type:", no value.
lang = RDFLanguages.TURTLE;
} else if ( ct.equals(WebContent.ctHTMLForm)) {
- ServletOps.errorBadRequest("HTML Form data sent to SAHCL valdiation server");
+ ServletOps.errorBadRequest("HTML Form data sent to SHACL valdiation server");
return null;
} else {
- lang = RDFLanguages.contentTypeToLang(ct.getContentType());
+ lang = RDFLanguages.contentTypeToLang(ct.getContentTypeStr());
if ( lang == null ) {
lang = defaultLang;
// ServletOps.errorBadRequest("Unknown content type for triples: " + ct);
@@ -246,7 +246,7 @@
/** Output a graph to the HTTP response */
public static void graphResponse(HttpAction action, Graph graph, Lang lang) {
- action.response.setContentType(lang.getContentType().getContentType());
+ action.response.setContentType(lang.getContentType().getContentTypeStr());
try {
RDFDataMgr.write(action.response.getOutputStream(), graph, lang);
} catch (IOException e) {
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQLQueryProcessor.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQLQueryProcessor.java
index de61d30..bbd2e26 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQLQueryProcessor.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQLQueryProcessor.java
@@ -151,7 +151,7 @@
ContentType ct = FusekiNetLib.getContentType(request);
boolean mustHaveQueryParam = true;
if ( ct != null ) {
- String incoming = ct.getContentType();
+ String incoming = ct.getContentTypeStr();
if ( matchContentType(ctSPARQLQuery, ct) ) {
mustHaveQueryParam = false;
@@ -216,7 +216,7 @@
return;
}
- ServletOps.error(HttpSC.UNSUPPORTED_MEDIA_TYPE_415, "Bad content type: " + ct.getContentType());
+ ServletOps.error(HttpSC.UNSUPPORTED_MEDIA_TYPE_415, "Bad content type: " + ct.getContentTypeStr());
}
protected void executeWithParameter(HttpAction action) {
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java
index 4e5c6e8..50a5e68 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java
@@ -147,7 +147,7 @@
return;
}
- ServletOps.error(HttpSC.UNSUPPORTED_MEDIA_TYPE_415, "Must be "+contentTypeSPARQLUpdate+" or "+contentTypeHTMLForm+" (got "+ct.getContentType()+")");
+ ServletOps.error(HttpSC.UNSUPPORTED_MEDIA_TYPE_415, "Must be "+contentTypeSPARQLUpdate+" or "+contentTypeHTMLForm+" (got "+ct.getContentTypeStr()+")");
}
protected void validate(HttpAction action, Collection<String> params) {
@@ -205,7 +205,7 @@
// If the dsg is transactional, then we can parse and execute the update in a streaming fashion.
// If it isn't, we need to read the entire update request before performing any updates, because
- // we have to attempt to make the request atomic in the face of malformed updates
+ // we have to attempt to make the request atomic in the face of malformed updates.
UpdateRequest req = null;
if (!action.isTransactional()) {
try {
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ServletBase.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ServletBase.java
index e95606b..b050db7 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ServletBase.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ServletBase.java
@@ -88,7 +88,7 @@
public static void setCommonHeadersForOptions(HttpServletResponse httpResponse) {
if ( CORS_ENABLED )
httpResponse.setHeader(HttpNames.hAccessControlAllowHeaders, "X-Requested-With, Content-Type, Authorization");
- httpResponse.setHeader(HttpNames.hContentLengh, "0");
+ httpResponse.setHeader(HttpNames.hContentLength, "0");
setCommonHeaders(httpResponse);
}
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/system/Upload.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/system/Upload.java
index 708b4f9..742ca7d 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/system/Upload.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/system/Upload.java
@@ -68,7 +68,7 @@
// Single graph (or quads) in body.
String base = ActionLib.wholeRequestURL(action.request);
- Lang lang = RDFLanguages.contentTypeToLang(ct.getContentType());
+ Lang lang = RDFLanguages.contentTypeToLang(ct.getContentTypeStr());
if ( lang == null ) {
ServletOps.errorBadRequest("Unknown content type for triples: " + ct);
return null;
@@ -84,12 +84,12 @@
ActionLib.parse(action, countingDest, input, lang, base);
UploadDetails details = new UploadDetails(countingDest.count(), countingDest.countTriples(),countingDest.countQuads());
action.log.info(format("[%d] Body: Content-Length=%d, Content-Type=%s, Charset=%s => %s : %s",
- action.id, len, ct.getContentType(), ct.getCharset(), lang.getName(),
+ action.id, len, ct.getContentTypeStr(), ct.getCharset(), lang.getName(),
details.detailsStr()));
return details;
} catch (RiotParseException ex) {
action.log.info(format("[%d] Body: Content-Length=%d, Content-Type=%s, Charset=%s => %s : %s",
- action.id, len, ct.getContentType(), ct.getCharset(), lang.getName(),
+ action.id, len, ct.getContentTypeStr(), ct.getCharset(), lang.getName(),
ex.getMessage()));
throw ex;
}
@@ -128,7 +128,7 @@
ContentType ct = ContentType.create(contentTypeHeader);
Lang lang = null;
if ( ! matchContentType(ctTextPlain, ct) )
- lang = RDFLanguages.contentTypeToLang(ct.getContentType());
+ lang = RDFLanguages.contentTypeToLang(ct.getContentTypeStr());
if ( lang == null ) {
String name = fileStream.getName();
@@ -156,11 +156,11 @@
ActionLib.parse(action, countingDest2, stream, lang, base);
UploadDetails details1 = new UploadDetails(countingDest2.count(), countingDest2.countTriples(),countingDest2.countQuads());
action.log.info(format("[%d] Filename: %s, Content-Type=%s, Charset=%s => %s : %s",
- action.id, printfilename, ct.getContentType(), ct.getCharset(), lang.getName(),
+ action.id, printfilename, ct.getContentTypeStr(), ct.getCharset(), lang.getName(),
details1.detailsStr()));
} catch (RiotParseException ex) {
action.log.info(format("[%d] Filename: %s, Content-Type=%s, Charset=%s => %s : %s",
- action.id, printfilename, ct.getContentType(), ct.getCharset(), lang.getName(),
+ action.id, printfilename, ct.getContentTypeStr(), ct.getCharset(), lang.getName(),
ex.getMessage()));
throw ex;
}
@@ -237,7 +237,7 @@
String contentTypeHeader = item.getContentType();
ct = ContentType.create(contentTypeHeader);
- lang = RDFLanguages.contentTypeToLang(ct.getContentType());
+ lang = RDFLanguages.contentTypeToLang(ct.getContentTypeStr());
if ( lang == null ) {
lang = RDFLanguages.filenameToLang(name);
@@ -256,7 +256,7 @@
isQuads = RDFLanguages.isQuads(lang);
action.log.info(format("[%d] Upload: Filename: %s, Content-Type=%s, Charset=%s => %s", action.id, name,
- ct.getContentType(), ct.getCharset(), lang.getName()));
+ ct.getContentTypeStr(), ct.getCharset(), lang.getName()));
StreamRDF x = StreamRDFLib.dataset(dsgTmp);
StreamRDFCounting dest = StreamRDFLib.count(x);
diff --git a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/FusekiServer.java b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/FusekiServer.java
index 2f12287..e983e14 100644
--- a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/FusekiServer.java
+++ b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/FusekiServer.java
@@ -575,7 +575,7 @@
/**
* Set the password file. This will be used to build a {@link #securityHandler
* security handler} if one is not supplied. Setting null clears any previous entry.
- * The file should be
+ * The file should be in the format of
* <a href="https://www.eclipse.org/jetty/documentation/current/configuring-security.html#hash-login-service">Eclipse jetty password file</a>.
*/
public Builder passwordFile(String passwordFile) {
diff --git a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestEmbeddedFuseki.java b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestEmbeddedFuseki.java
index 4ad14f0..d2debf8 100644
--- a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestEmbeddedFuseki.java
+++ b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestEmbeddedFuseki.java
@@ -315,7 +315,7 @@
};
EntityTemplate entity = new EntityTemplate(producer);
ContentType ct = syntax.getLang().getContentType();
- entity.setContentType(ct.getContentType());
+ entity.setContentType(ct.getContentTypeStr());
return entity;
}
diff --git a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestFusekiShaclValidation.java b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestFusekiShaclValidation.java
index 9be2573..66fb1ff 100644
--- a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestFusekiShaclValidation.java
+++ b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestFusekiShaclValidation.java
@@ -136,7 +136,7 @@
private static ValidationReport validateReport(String url, String shapesFile) {
Graph shapesGraph = RDFDataMgr.loadGraph(shapesFile);
EntityTemplate entity = new EntityTemplate((out)->RDFDataMgr.write(out, shapesGraph, Lang.TTL));
- String ct = Lang.TTL.getContentType().getContentType();
+ String ct = Lang.TTL.getContentType().getContentTypeStr();
entity.setContentType(ct);
HttpCaptureResponse<Graph> graphResponse = HttpResponseLib.graphHandler();
diff --git a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestMultipleEmbedded.java b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestMultipleEmbedded.java
index ad32f63..68f9ad6 100644
--- a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestMultipleEmbedded.java
+++ b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestMultipleEmbedded.java
@@ -163,7 +163,7 @@
};
EntityTemplate entity = new EntityTemplate(producer);
ContentType ct = syntax.getLang().getContentType();
- entity.setContentType(ct.getContentType());
+ entity.setContentType(ct.getContentTypeStr());
return entity;
}
}
diff --git a/jena-fuseki2/jena-fuseki-webapp/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java b/jena-fuseki2/jena-fuseki-webapp/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java
index 3d5e3b8..22812b7 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java
+++ b/jena-fuseki2/jena-fuseki-webapp/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java
@@ -526,7 +526,7 @@
HttpServletRequest request = action.request;
String base = ActionLib.wholeRequestURL(request);
ContentType ct = FusekiNetLib.getContentType(request);
- Lang lang = RDFLanguages.contentTypeToLang(ct.getContentType());
+ Lang lang = RDFLanguages.contentTypeToLang(ct.getContentTypeStr());
if ( lang == null ) {
ServletOps.errorBadRequest("Unknown content type for triples: " + ct);
return;
diff --git a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestAuth.java b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestAuth.java
index 9faac59..5072594 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestAuth.java
+++ b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestAuth.java
@@ -57,6 +57,7 @@
* This is as much a test of the Jena client libraries handling authentication.
* These tests use Jetty-supplied authentication, not Apache Shiro.
*/
+@SuppressWarnings("deprecation")
public class TestAuth {
// Use different port etc because sometimes the previous testing servers
diff --git a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetAccessorHTTP.java b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetAccessorHTTP.java
index f3641ed..4e7c6be 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetAccessorHTTP.java
+++ b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetAccessorHTTP.java
@@ -38,6 +38,7 @@
import org.apache.jena.web.HttpSC;
import org.junit.Test;
+@SuppressWarnings("deprecation")
public class TestDatasetAccessorHTTP extends AbstractFusekiTest {
// Model level testing.
diff --git a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetGraphAccessorHTTP.java b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetGraphAccessorHTTP.java
index 1dbd25b..cef9879 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetGraphAccessorHTTP.java
+++ b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetGraphAccessorHTTP.java
@@ -26,6 +26,7 @@
import org.junit.Before;
import org.junit.BeforeClass;
+@SuppressWarnings("deprecation")
public class TestDatasetGraphAccessorHTTP extends AbstractTestDatasetGraphAccessor
{
@BeforeClass public static void ctlBeforeClass() { ServerCtl.ctlBeforeClass(); }
diff --git a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetOps.java b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetOps.java
index 2a8ae6d..25a259c 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetOps.java
+++ b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestDatasetOps.java
@@ -46,7 +46,7 @@
protected HttpEntity datasetToHttpEntity(final DatasetGraph dsg) {
final RDFFormat syntax = RDFFormat.NQUADS;
EntityTemplate entity = new EntityTemplate((out) -> RDFDataMgr.write(out, dsg, syntax));
- String ct = syntax.getLang().getContentType().getContentType();
+ String ct = syntax.getLang().getContentType().getContentTypeStr();
entity.setContentType(ct);
return entity;
}
diff --git a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestFileUpload.java b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestFileUpload.java
index 5f35f32..bf5caf3 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestFileUpload.java
+++ b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestFileUpload.java
@@ -36,6 +36,7 @@
* @see TestDatasetAccessorHTTP
* @see TestHttpOp
*/
+@SuppressWarnings("deprecation")
public class TestFileUpload extends AbstractFusekiTest {
@Test
public void upload_gsp_01() {
diff --git a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestQuery.java b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestQuery.java
index 9b63243..199d039 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestQuery.java
+++ b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestQuery.java
@@ -50,6 +50,7 @@
import org.junit.Before;
import org.junit.Test;
+@SuppressWarnings("deprecation")
public class TestQuery extends AbstractFusekiTest {
@Before
diff --git a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
index 7b7a474..27b0eac 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
+++ b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
@@ -35,6 +35,7 @@
import org.junit.Before;
import org.junit.Test;
+@SuppressWarnings("deprecation")
public class TestSPARQLProtocol extends AbstractFusekiTest
{
@Before
diff --git a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/RDFConnectionFuseki.java b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/RDFConnectionFuseki.java
index 81fab04..bc2902b 100644
--- a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/RDFConnectionFuseki.java
+++ b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/RDFConnectionFuseki.java
@@ -54,7 +54,7 @@
/** Fuseki settings */
private static RDFConnectionRemoteBuilder setupForFuseki(RDFConnectionRemoteBuilder builder) {
- String ctRDFThrift = Lang.RDFTHRIFT.getContentType().getContentType();
+ String ctRDFThrift = Lang.RDFTHRIFT.getContentType().getContentTypeStr();
String acceptHeaderSPARQL = String.join(","
, ResultSetLang.SPARQLResultSetThrift.getHeaderString()
, ResultSetLang.SPARQLResultSetJSON.getHeaderString()+";q=0.9"
diff --git a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/RDFConnectionRemote.java b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/RDFConnectionRemote.java
index 1447d1b..2473646 100644
--- a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/RDFConnectionRemote.java
+++ b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/RDFConnectionRemote.java
@@ -420,7 +420,7 @@
// Leave RDF/XML to the XML parse, else it's UTF-8.
String charset = (lang.equals(Lang.RDFXML) ? null : WebContent.charsetUTF8);
// HttpClient Content type.
- ContentType ct = ContentType.create(lang.getContentType().getContentType(), charset);
+ ContentType ct = ContentType.create(lang.getContentType().getContentTypeStr(), charset);
exec(()->{
HttpEntity entity = fileToHttpEntity(file, lang);
@@ -592,7 +592,7 @@
// Leave RDF/XML to the XML parse, else it's UTF-8.
String charset = (lang.equals(Lang.RDFXML) ? null : WebContent.charsetUTF8);
// HttpClient Content type.
- ContentType ct = ContentType.create(lang.getContentType().getContentType(), charset);
+ ContentType ct = ContentType.create(lang.getContentType().getContentTypeStr(), charset);
// Repeatable.
return new FileEntity(new File(filename), ct);
}
@@ -613,7 +613,7 @@
* requires serialising the graph at the point when this function is called.
*/
private HttpEntity graphToHttpEntityWithLength(Graph graph, RDFFormat syntax) {
- String ct = syntax.getLang().getContentType().getContentType();
+ String ct = syntax.getLang().getContentType().toHeaderString();
ByteArrayOutputStream out = new ByteArrayOutputStream(128*1024);
RDFDataMgr.write(out, graph, syntax);
IO.close(out);
@@ -630,7 +630,7 @@
*/
private HttpEntity graphToHttpEntityStream(Graph graph, RDFFormat syntax) {
EntityTemplate entity = new EntityTemplate((out)->RDFDataMgr.write(out, graph, syntax));
- String ct = syntax.getLang().getContentType().getContentType();
+ String ct = syntax.getLang().getContentType().toHeaderString();
entity.setContentType(ct);
return entity;
}
@@ -647,7 +647,7 @@
}
private HttpEntity datasetToHttpEntityWithLength(DatasetGraph dataset, RDFFormat syntax) {
- String ct = syntax.getLang().getContentType().getContentType();
+ String ct = syntax.getLang().getContentType().toHeaderString();
ByteArrayOutputStream out = new ByteArrayOutputStream(128*1024);
RDFDataMgr.write(out, dataset, syntax);
IO.close(out);
@@ -658,7 +658,7 @@
private HttpEntity datasetToHttpEntityStream(DatasetGraph dataset, RDFFormat syntax) {
EntityTemplate entity = new EntityTemplate((out)->RDFDataMgr.write(out, dataset, syntax));
- String ct = syntax.getLang().getContentType().getContentType();
+ String ct = syntax.getLang().getContentType().toHeaderString();
entity.setContentType(ct);
return entity;
}
diff --git a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample1.java b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample1.java
index c86727a..b9ccd15 100644
--- a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample1.java
+++ b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample1.java
@@ -42,4 +42,3 @@
conn.queryResultSet(query, ResultSetFormatter::out);
}
}
-
diff --git a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample2.java b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample2.java
index 4d38e5f..6bc9833 100644
--- a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample2.java
+++ b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample2.java
@@ -64,4 +64,3 @@
}
}
}
-
diff --git a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample3.java b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample3.java
index cb9c8da..5e16e5e 100644
--- a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample3.java
+++ b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample3.java
@@ -39,4 +39,3 @@
}
}
}
-
diff --git a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample4.java b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample4.java
index 261bdf4..46c03b9 100644
--- a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample4.java
+++ b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample4.java
@@ -48,4 +48,3 @@
}
}
}
-
diff --git a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample5.java b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample5.java
index ec2d106..428750a 100644
--- a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample5.java
+++ b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample5.java
@@ -47,4 +47,3 @@
}
}
}
-
diff --git a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample6.java b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample6.java
index 718ceb6..3778edb 100644
--- a/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample6.java
+++ b/jena-rdfconnection/src/main/java/org/apache/jena/rdfconnection/examples/RDFConnectionExample6.java
@@ -40,4 +40,3 @@
}
}
}
-
diff --git a/jena-tdb/src/test/java/org/apache/jena/tdb/graph/TestDatasetGraphAccessorTDB.java b/jena-tdb/src/test/java/org/apache/jena/tdb/graph/TestDatasetGraphAccessorTDB.java
index 1d8d1f8..40f4c5e 100644
--- a/jena-tdb/src/test/java/org/apache/jena/tdb/graph/TestDatasetGraphAccessorTDB.java
+++ b/jena-tdb/src/test/java/org/apache/jena/tdb/graph/TestDatasetGraphAccessorTDB.java
@@ -24,6 +24,7 @@
import org.apache.jena.web.DatasetGraphAccessor ;
import org.apache.jena.web.AbstractTestDatasetGraphAccessor ;
+@SuppressWarnings("deprecation")
public class TestDatasetGraphAccessorTDB extends AbstractTestDatasetGraphAccessor
{
@Override