marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject [08/17] git commit: MARMOTTA-525: fix possible NPE when no Accept-Header is provided (default to */*)
Date Wed, 10 Sep 2014 09:38:59 GMT
MARMOTTA-525: fix possible NPE when no Accept-Header is provided (default to */*)


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/f995f4bb
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/f995f4bb
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/f995f4bb

Branch: refs/heads/ldp
Commit: f995f4bb3526c21c1f2297e65ca1ec6cc17ffd25
Parents: dd701b9
Author: Jakob Frank <jakob@apache.org>
Authored: Wed Sep 3 15:08:21 2014 +0200
Committer: Jakob Frank <jakob@apache.org>
Committed: Fri Sep 5 10:22:47 2014 +0200

----------------------------------------------------------------------
 .../marmotta/platform/ldp/webservices/LdpWebService.java     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/f995f4bb/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/webservices/LdpWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/webservices/LdpWebService.java
b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/webservices/LdpWebService.java
index 5a32210..7a8e772 100644
--- a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/webservices/LdpWebService.java
+++ b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/webservices/LdpWebService.java
@@ -104,14 +104,18 @@ public class LdpWebService {
     }
 
     @GET
-    public Response GET(@Context final UriInfo uriInfo, @Context Request r, @HeaderParam(HttpHeaders.ACCEPT)
MediaType type) throws RepositoryException {
+    public Response GET(@Context final UriInfo uriInfo, @Context Request r,
+                        @HeaderParam(HttpHeaders.ACCEPT) @DefaultValue(MediaType.WILDCARD)
MediaType type)
+            throws RepositoryException {
         final String resource = ldpService.getResourceUri(uriInfo);
         log.debug("GET to LDPR <{}>", resource);
         return buildGetResponse(resource, r, type).build();
     }
 
     @HEAD
-    public Response HEAD(@Context final UriInfo uriInfo, @Context Request r, @HeaderParam(HttpHeaders.ACCEPT)
MediaType type)  throws RepositoryException {
+    public Response HEAD(@Context final UriInfo uriInfo, @Context Request r,
+                         @HeaderParam(HttpHeaders.ACCEPT) @DefaultValue(MediaType.WILDCARD)
MediaType type)
+            throws RepositoryException {
         final String resource = ldpService.getResourceUri(uriInfo);
         log.debug("HEAD to LDPR <{}>", resource);
         return buildGetResponse(resource, r, type).entity(null).build();


Mime
View raw message