[teiid-commits] teiid SVN: r2262 - branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Jun 18 19:14:29 EDT 2010


Author: shawkins
Date: 2010-06-18 19:14:29 -0400 (Fri, 18 Jun 2010)
New Revision: 2262

Modified:
   branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
Log:
TEIID-1126: Removing the VDB name prefix when calculating the entries map inside the VDB; and only keeping the relative path names.

Modified: branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
===================================================================
--- branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java	2010-06-18 23:08:44 UTC (rev 2261)
+++ branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java	2010-06-18 23:14:29 UTC (rev 2262)
@@ -194,7 +194,12 @@
 		LinkedHashMap<String, Resource> visibilityMap = new LinkedHashMap<String, Resource>();
 		for(VirtualFile f: root.getChildrenRecursively()) {
 			if (f.isLeaf()) {
-				visibilityMap.put("/" + f.getPathName(), new Resource(f, isFileVisible(f.getPathName(), vdb))); //$NON-NLS-1$
+				// remove the leading vdb name from the entry
+				String path = f.getPathName().substring(root.getPathName().length());
+				if (!path.startsWith("/")) { //$NON-NLS-1$
+					path = "/" + path; //$NON-NLS-1$
+				}
+				visibilityMap.put(path, new Resource(f, isFileVisible(f.getPathName(), vdb))); 
 			}
 		}
 		this.vdbEntries = visibilityMap;



More information about the teiid-commits mailing list