Author: alexdma
Date: Wed Jul  6 09:11:19 2011
New Revision: 1143301

URL: http://svn.apache.org/viewvc?rev=1143301&view=rev
Log:
Use file.separator property for locating the offline RuleStore configuration 
ontology. Helps supporting offline mode for STANBOL-178 in non-Unix systems.

Modified:
    
incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java

Modified: 
incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java?rev=1143301&r1=1143300&r2=1143301&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java
 (original)
+++ 
incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java
 Wed Jul  6 09:11:19 2011
@@ -109,7 +109,7 @@ public class RuleStoreImpl implements Ru
     private RuleParserImpl kReSRuleParser;
 
     private final Logger log = LoggerFactory.getLogger(getClass());
-    
+
     @Reference
     ONManager onManager;
 
@@ -249,7 +249,7 @@ public class RuleStoreImpl implements Ru
                     } catch (OWLOntologyCreationException e) {
                         log.error("Cannot create the ontology " + 
filedir.toString(), e);
                     } catch (Exception e) {
-                        log.error("1 Rule Store: no rule ontology 
available.",e);
+                        log.error("1 Rule Store: no rule ontology available.", 
e);
                     }
                 }
                 // default KReSConf dir does not exist
@@ -262,7 +262,7 @@ public class RuleStoreImpl implements Ru
                     } catch (OWLOntologyCreationException e) {
                         log.error("Cannot create the ontology " + 
inputontology.toString(), e);
                     } catch (Exception e) {
-                        log.error("Rule Store: no rule ontology available.",e);
+                        log.error("Rule Store: no rule ontology available.", 
e);
                     }
                 }
 
@@ -271,7 +271,7 @@ public class RuleStoreImpl implements Ru
 
                     File dirs = new File("./KReSConf");
                     if (!dirs.exists()) dirs.mkdir();
-                    ruleOntologyLocation = "./KReSConf/rmi_config.owl";
+                    ruleOntologyLocation = "." + sep + "KReSConf" + sep + 
"rmi_config.owl";
 
                     FileOutputStream fos;
                     try {
@@ -289,16 +289,15 @@ public class RuleStoreImpl implements Ru
             else {
 
                 IRI pathIri = IRI.create(ruleOntologyLocation);
-                if (!pathIri.isAbsolute())
-                    pathIri = IRI.create(new File(ruleOntologyLocation));
-                
+                if (!pathIri.isAbsolute()) pathIri = IRI.create(new 
File(ruleOntologyLocation));
+
                 try {
                     owlmodel = mgr
                     /* OWLManager.createOWLOntologyManager() 
*/.loadOntology(pathIri);
                 } catch (OWLOntologyCreationException e) {
                     log.error("Cannot load the RMI configuration ontology", e);
                 } catch (Exception e) {
-                    log.error("Rule Store: no rule ontology available.",e);
+                    log.error("Rule Store: no rule ontology available.", e);
                 }
             }
         }


Reply via email to