portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r405550 - /portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/JetspeedRewriterController.java
Date Tue, 09 May 2006 21:58:49 GMT
Author: taylor
Date: Tue May  9 14:58:47 2006
New Revision: 405550

URL: http://svn.apache.org/viewcvs?rev=405550&view=rev
Log:
request for classpath oriented mapping loader

Modified:
    portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/JetspeedRewriterController.java

Modified: portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/JetspeedRewriterController.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/JetspeedRewriterController.java?rev=405550&r1=405549&r2=405550&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/JetspeedRewriterController.java
(original)
+++ portals/jetspeed-2/trunk/components/rewriter/src/java/org/apache/jetspeed/rewriter/JetspeedRewriterController.java
Tue May  9 14:58:47 2006
@@ -196,33 +196,22 @@
      */
     protected void loadMapping() throws RewriterException
     {
-        File map = new File(this.mappingFile);
-        if (map.exists() && map.isFile() && map.canRead())
+        try
         {
-            try
-            {
-                this.mapper = new Mapping();
-                InputSource is = new InputSource(new FileReader(map));
-                is.setSystemId(this.mappingFile);
-                this.mapper.loadMapping(is);
-            }
-            catch (Exception e)
-            {
-                e.printStackTrace();
-                String msg = "RewriterService: Error in castor mapping creation";
-                log.error(msg, e);
-                throw new RewriterException(msg, e);
-            }
+            Reader reader = getReader(this.mappingFile);
+            
+            this.mapper = new Mapping();
+            InputSource is = new InputSource(reader);
+            is.setSystemId(this.mappingFile);
+            this.mapper.loadMapping(is);
         }
-        else
+        catch (Exception e)
         {
-
-            String msg = "RewriterService: Mapping not found or not a file or unreadable:
" + this.mappingFile;
-            System.out.println(msg);
-            log.error(msg);
-            throw new RewriterException(msg);
+            e.printStackTrace();
+            String msg = "RewriterService: Error in castor mapping creation";
+            log.error(msg, e);
+            throw new RewriterException(msg, e);
         }
-
     }
 
     protected Reader getReader(String resource)



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message