marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wik...@apache.org
Subject git commit: MARMOTTA-247: fixed protocol hardcoded check
Date Wed, 04 Sep 2013 08:17:22 GMT
Updated Branches:
  refs/heads/develop 6b35f4053 -> 733020216


MARMOTTA-247: fixed protocol hardcoded check


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

Branch: refs/heads/develop
Commit: 733020216dd1c71fdca1c75ff7abc429f2bdb388
Parents: 6b35f40
Author: Sergio Fernández <wikier@apache.org>
Authored: Wed Sep 4 10:17:03 2013 +0200
Committer: Sergio Fernández <wikier@apache.org>
Committed: Wed Sep 4 10:17:03 2013 +0200

----------------------------------------------------------------------
 .../platform/core/webservices/resource/MetaWebService.java        | 3 ++-
 .../platform/core/webservices/resource/ResourceWebService.java    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/73302021/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 54e2c9a..27785c6 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
@@ -43,6 +43,7 @@ import javax.ws.rs.core.StreamingOutput;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.collections.CollectionUtils;
 import org.apache.marmotta.commons.http.ETagGenerator;
+import org.apache.marmotta.commons.http.UriUtil;
 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;
@@ -254,7 +255,7 @@ public class MetaWebService {
                 conn.begin();
                 
                 Resource r = null;
-            	if (resource.startsWith("http://")) {
+            	if (UriUtil.validate(resource)) {
                     r = ResourceUtils.getUriResource(conn, resource);
             	} else {
             		r = ResourceUtils.getAnonResource(conn, resource);

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/73302021/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 d3de5a1..facd716 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
@@ -47,6 +47,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.http.ContentType;
 import org.apache.marmotta.commons.http.ETagGenerator;
 import org.apache.marmotta.commons.http.LMFHttpUtils;
+import org.apache.marmotta.commons.http.UriUtil;
 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;
@@ -366,7 +367,7 @@ public class ResourceWebService {
             try {
                 conn.begin();
                 Resource r;
-            	if (resource.startsWith("http://")) {
+            	if (UriUtil.validate(resource)) {
                     try {
                     	r = ResourceUtils.getUriResource(conn, resource);
                     } catch (Exception e) {


Mime
View raw message