marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wik...@apache.org
Subject git commit: fixed 404 return meta representation of the resources
Date Tue, 26 Feb 2013 11:29:29 GMT
Updated Branches:
  refs/heads/master 0bbc3dfbc -> 7e4f810ff


fixed 404 return meta representation of the resources


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

Branch: refs/heads/master
Commit: 7e4f810fffa8edf59bc3441f4859177de9e417ba
Parents: 0bbc3df
Author: Sergio Fernández <wikier@apache.org>
Authored: Tue Feb 26 12:28:49 2013 +0100
Committer: Sergio Fernández <wikier@apache.org>
Committed: Tue Feb 26 12:28:49 2013 +0100

----------------------------------------------------------------------
 .../core/webservices/resource/MetaWebService.java  |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/7e4f810f/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
index d76d134..687903a 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
@@ -38,6 +38,9 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 import javax.ws.rs.core.StreamingOutput;
 
+import org.apache.marmotta.commons.collections.CollectionUtils;
+import org.apache.marmotta.commons.http.ETagGenerator;
+import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.content.ContentService;
 import org.apache.marmotta.platform.core.api.io.MarmottaIOService;
@@ -45,9 +48,6 @@ import org.apache.marmotta.platform.core.api.triplestore.ContextService;
 import org.apache.marmotta.platform.core.api.triplestore.SesameService;
 import org.apache.marmotta.platform.core.services.sesame.KiWiSesameUtil;
 import org.apache.marmotta.platform.core.services.sesame.ResourceSubjectMetadata;
-
-import org.apache.marmotta.commons.collections.CollectionUtils;
-import org.apache.marmotta.commons.http.ETagGenerator;
 import org.openrdf.model.Resource;
 import org.openrdf.model.URI;
 import org.openrdf.repository.RepositoryConnection;
@@ -238,6 +238,10 @@ public class MetaWebService {
     private Response getMeta(String uri, String mimetype, String uuid) throws UnsupportedEncodingException
{
         try {
             RepositoryConnection conn = sesameService.getConnection();
+            
+            if (!ResourceUtils.existsResource(conn, uri)) {
+            	return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(),
Response.Status.NOT_FOUND, "the requested resource could not be found in LMF right now, but
may be available again in the future");
+            }
 
             try {
                 conn.begin();


Mime
View raw message