[Yanel-commits] rev 22054 - public/yanel/trunk/src/core/java/org/wyona/yanel/core

michi at wyona.com michi at wyona.com
Tue Jan 23 14:15:14 CET 2007


Author: michi
Date: 2007-01-23 14:15:12 +0100 (Tue, 23 Jan 2007)
New Revision: 22054

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/ResourceManager.java
Log:
use resource config for fallback

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/ResourceManager.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/ResourceManager.java	2007-01-23 13:14:04 UTC (rev 22053)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/ResourceManager.java	2007-01-23 13:15:12 UTC (rev 22054)
@@ -110,11 +110,15 @@
             if (rc != null) return getResource(request, response, realm, path, rc);
         }
 
-        // Fallback to deprecated RTI
-        log.warn("DEPRECATED: RTI should be replaced by ResourceConfiguration: " + realm + ", " + path);
-        ResourceTypeIdentifier rti = getResourceTypeIdentifier(realm, path);
-        ResourceTypeDefinition rtd = rtRegistry.getResourceTypeDefinition(rti.getUniversalName());
-        return getResource(request, response, realm, path, rtd, rti);
+        if (realm.getRTIRepository().exists(path.getRTIPath())) {
+            // Fallback to deprecated RTI
+            log.warn("DEPRECATED: RTI should be replaced by ResourceConfiguration: " + realm + ", " + path);
+            ResourceTypeIdentifier rti = getResourceTypeIdentifier(realm, path);
+            ResourceTypeDefinition rtd = rtRegistry.getResourceTypeDefinition(rti.getUniversalName());
+            return getResource(request, response, realm, path, rtd, rti);
+        } else {
+            return getResource(request, response, realm, path, new ResourceConfiguration("file", "http://www.wyona.org/yanel/resource/1.0", null));
+        }
     }
 
     /**




More information about the Yanel-commits mailing list