You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2013/09/02 12:46:10 UTC
git commit: null-safe code detecting rdf format
Updated Branches:
refs/heads/develop 1b697565e -> bbd900e2a
null-safe code detecting rdf format
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/bbd900e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/bbd900e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/bbd900e2
Branch: refs/heads/develop
Commit: bbd900e2ac24353e43566c2494f322912122a1c0
Parents: 1b69756
Author: Sergio Fernández <wi...@apache.org>
Authored: Mon Sep 2 12:45:59 2013 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon Sep 2 12:45:59 2013 +0200
----------------------------------------------------------------------
.../core/services/importer/ImportWatchServiceImpl.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/bbd900e2/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
index a061dc9..76a9590 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
@@ -50,6 +50,7 @@ import org.apache.marmotta.platform.core.api.user.UserService;
import org.apache.marmotta.platform.core.events.SystemStartupEvent;
import org.apache.marmotta.platform.core.exception.io.MarmottaImportException;
import org.openrdf.model.URI;
+import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.Rio;
import org.slf4j.Logger;
@@ -195,9 +196,9 @@ public class ImportWatchServiceImpl implements ImportWatchService {
String fileName = file.getName();
//mimetype detection
- String mimetype = Rio.getParserFormatForFileName(fileName).getDefaultMIMEType();
- if (mimetype != null && importService.getAcceptTypes().contains(mimetype)) {
- format = mimetype;
+ RDFFormat rdfFormat = Rio.getParserFormatForFileName(fileName);
+ if (rdfFormat != null && importService.getAcceptTypes().contains(rdfFormat.getDefaultMIMEType())) {
+ format = rdfFormat.getDefaultMIMEType();
} else {
throw new MarmottaImportException("Suitable RDF parser not found");
}