Index: DefaultMapContextManager.java
===================================================================
--- DefaultMapContextManager.java	(revision 44296)
+++ DefaultMapContextManager.java	(revision 44297)
@@ -73,14 +73,14 @@
 import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
 import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolPreferences;
 import org.gvsig.tools.ToolsLocator;
-import org.gvsig.tools.dispose.DisposeUtils;
 import org.gvsig.tools.dynobject.exception.DynMethodException;
 import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException;
 import org.gvsig.tools.observer.Notification;
 import org.gvsig.tools.observer.ObservableHelper;
 import org.gvsig.tools.observer.Observer;
 import org.gvsig.tools.persistence.PersistenceManager;
-import org.gvsig.tools.util.ResourcesStorage.Resource;
+import org.gvsig.tools.resourcesstorage.ResourcesStorage;
+import org.gvsig.tools.resourcesstorage.ResourcesStorage.Resource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -91,7 +91,7 @@
  */
 public class DefaultMapContextManager implements MapContextManager {
 
-    private static final Logger logger = LoggerFactory
+    private static final Logger LOGGER = LoggerFactory
             .getLogger(DefaultMapContextManager.class);
 
     private Class drawerClazz = DefaultMapContextDrawer.class;
@@ -104,7 +104,7 @@
 
     private String defaultVectorLegend;
 
-    private ObservableHelper observableHelper = new ObservableHelper();
+    private final ObservableHelper observableHelper = new ObservableHelper();
 
     private File colorTableLibraryFolder = null;
 
@@ -256,7 +256,7 @@
             layer.initialize(projection);
             layer.setLegend((IVectorLegend) createLegend(IVectorialUniqueValueLegend.LEGEND_NAME));
         } catch (Exception e) {
-            logger.error("Error initializing the graphics layer", e);
+            LOGGER.error("Error initializing the graphics layer", e);
         }
         return (GraphicLayer) notifyObservers(CREATE_GRAPHICS_LAYER, layer).getValue();
     }
@@ -578,32 +578,34 @@
         return (FLayer) notifyObservers(CREATE_LAYER, layer).getValue();
     }
 
+    @Override
     public ILegend getLegend(DataStore dataStore) {
         ILegend legend = null;
-
-        Resource resource = getResource(dataStore, SymbolManager.LEGEND_FILE_EXTENSION.substring(1));
-        try {
-            if ((resource != null) && (resource.exists())) {
-                PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager();
-                InputStream is = resource.asInputStream();
-                legend = (ILegend) persistenceManager.getObject(is);
-                is.close();
+        ResourcesStorage resourcesStorage = dataStore.getResourcesStorage();
+        if( resourcesStorage!=null ) {
+            Resource resource = resourcesStorage.getResource(SymbolManager.LEGEND_FILE_EXTENSION.substring(1));
+            try {
+                if ((resource != null) && (resource.exists())) {
+                    PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager();
+                    InputStream is = resource.asInputStream();
+                    legend = (ILegend) persistenceManager.getObject(is);
+                    is.close();
+                }
+            } catch (Exception e) {
+                LOGGER.warn("Can't loasd legend", e);
+            } finally {
+                IOUtils.closeQuietly(resource);
             }
-        } catch (Exception e) {
-            logger.warn("Can't loasd legend", e);
-        } finally {
-            IOUtils.closeQuietly(resource);
         }
-
         //If the legend is null, next option is to check if the store has the getLegend method
         if (legend == null) {
             try {
                 legend = (IVectorLegend) dataStore.invokeDynMethod("getLegend", null);
             } catch (DynMethodNotSupportedException e) {
-                logger.debug("This store {} does not provide a legend.",
+                LOGGER.debug("This store {} does not provide a legend.",
                         dataStore.getName());
             } catch (DynMethodException e) {
-                logger.error(
+                LOGGER.error(
                         "Can't load the specific legend provided for the store {}.",
                         dataStore.getName(), e);
             }
@@ -621,31 +623,35 @@
                 int typeShape = featureType.getAttributeDescriptor(indexGeom).getGeometryType();
                 legend = createDefaultVectorLegend(typeShape);
             } catch (DataException e) {
-                logger.error("Error getting the default feature type", e);
+                LOGGER.error("Error getting the default feature type", e);
             }
         }
 
         return legend;
     }
 
+    @Override
     public ILabelingStrategy getLabelingStrategy(DataStore dataStore) {
         ILabelingStrategy labelingStrategy = null;
 
-        Resource resource = getResource(dataStore, SymbolManager.LABELINGSTRATEGY_FILE_EXTENSION.substring(1));
-        try {
-            if ((resource != null) && (resource.exists())) {
-                PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager();
-                InputStream is = resource.asInputStream();
-                labelingStrategy = (ILabelingStrategy) persistenceManager.getObject(is);
-                is.close();
+        ResourcesStorage resourcesStorage = dataStore.getResourcesStorage();
+        if( resourcesStorage!=null ) {
+            Resource resource = resourcesStorage.getResource(SymbolManager.LABELINGSTRATEGY_FILE_EXTENSION.substring(1));
+            try {
+                if ((resource != null) && (resource.exists())) {
+                    PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager();
+                    InputStream is = resource.asInputStream();
+                    labelingStrategy = (ILabelingStrategy) persistenceManager.getObject(is);
+                    is.close();
+                }
+            } catch (Exception e) {
+                LOGGER.warn("Can't load Label strategy", e);
+            } finally {
+                IOUtils.closeQuietly(resource);
             }
-        } catch (Exception e) {
-            logger.warn("Can't load Label strategy", e);
-        } finally {
-            IOUtils.closeQuietly(resource);
         }
 
-        //If the legend is null, next option is to check if the store has the getLegend method
+        //If the legend is null, next option is to check if the store has the getLabeling method
         if (labelingStrategy == null) {
             try {
                 labelingStrategy
@@ -654,7 +660,7 @@
             } catch (DynMethodNotSupportedException e1) {
                 labelingStrategy = null;
             } catch (DynMethodException e1) {
-                logger.error("Can't load the specific lebeling strategy provided for the datastore {}.",
+                LOGGER.error("Can't load the specific labeling strategy provided for the datastore {}.",
                         dataStore.getName(),
                         e1);
             }
@@ -684,33 +690,16 @@
         }
     }
 
-    
-    private Resource getResource(DataStore dataStore, String resource) {
-        DataServerExplorer explorer = null;
-        try {
-            explorer = dataStore.getExplorer();
-            if (explorer == null) {
-                return null;
-            }
-            return explorer.getResource(dataStore, resource);
-        } catch (Exception e) {
-            logger.warn("Can't locate resource '"+resource+"' for '"+dataStore.getName()+"'.",e);
-            return null;
-        } finally {
-            DisposeUtils.disposeQuietly(explorer);
-        }
-    }
-
     private Map iconLayers = new HashMap(); //  (Map<String storeProviderName, String iconName>)
 
     public void registerIconLayer(String storeProviderName, String iconName) {
         if (storeProviderName == null || iconName == null) {
-            logger.info("registerIconLayer, storeProviderName or iconName are null");
+            LOGGER.info("registerIconLayer, storeProviderName or iconName are null");
             return;
         }
         String storeName = storeProviderName.trim().toLowerCase();
         if (storeName.length() == 0 || iconName.trim().length() == 0) {
-            logger.info("registerIconLayer, invalid storeProviderName or iconName");
+            LOGGER.info("registerIconLayer, invalid storeProviderName or iconName");
             return;
         }
         iconLayers.put(storeName, iconName);
