marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wik...@apache.org
Subject [1/3] git commit: fixed rendering of raw resources that cannot be managed by the cache
Date Thu, 07 Mar 2013 14:04:17 GMT
fixed rendering of raw resources that cannot be managed by the cache


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

Branch: refs/heads/master
Commit: 19aceff8f65396b105f42bb7efe72e250dc3041f
Parents: 5cd35c9
Author: Sergio Fernández <wikier@apache.org>
Authored: Thu Mar 7 15:01:12 2013 +0100
Committer: Sergio Fernández <wikier@apache.org>
Committed: Thu Mar 7 15:01:12 2013 +0100

----------------------------------------------------------------------
 .../webservices/resource/ResourceWebService.java   |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/19aceff8/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
index 4452e31..a770513 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
@@ -346,7 +346,14 @@ public class ResourceWebService {
             RepositoryConnection conn = sesameService.getConnection();
             try {
                 conn.begin();
-                URI resource = ResourceUtils.getUriResource(conn, uri);
+                URI resource;
+                try {
+                	resource = ResourceUtils.getUriResource(conn, uri);
+                } catch (Exception e) {
+                	log.error("Error retrieving the URI <{}>: {}", uri, e.getMessage());
+                	log.debug("So redirecting directly to it...");
+                	return Response.seeOther(new java.net.URI(uri)).build();
+                }
                 if (resource == null) 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");
                 // FIXME String appendix = uuid == null ? "?uri=" + URLEncoder.encode(uri,
"utf-8") :
                 // "/" + uuid;


Mime
View raw message