Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/impl/DefaultMapContextManager.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/impl/DefaultMapContextManager.java	(revision 44160)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/impl/DefaultMapContextManager.java	(revision 44161)
@@ -29,6 +29,7 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
@@ -38,11 +39,13 @@
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 
 import org.cresques.cts.IProjection;
 import org.gvsig.fmap.crs.CRSFactory;
 import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataServerExplorer.DataResource;
 import org.gvsig.fmap.dal.DataStore;
 import org.gvsig.fmap.dal.DataStoreParameters;
 import org.gvsig.fmap.dal.exception.DataException;
@@ -582,18 +585,18 @@
     public ILegend getLegend(DataStore dataStore) {
         ILegend legend = null;
 
-        File file = getResourcePath(dataStore, SymbolManager.LEGEND_FILE_EXTENSION.substring(1));
+        DataResource resource = getResource(dataStore, SymbolManager.LEGEND_FILE_EXTENSION.substring(1));
         try {
-            if ((file != null) && (file.exists())) {
+            if ((resource != null) && (resource.exists())) {
                 PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager();
-                FileInputStream is = new FileInputStream(file);
+                InputStream is = resource.asInputStream();
                 legend = (ILegend) persistenceManager.getObject(is);
                 is.close();
             }
-        } catch (FileNotFoundException e) {
-            logger.error("Legend not found", e);
-        } catch (IOException e) {
-            logger.error("Error reading the legend", e);
+        } 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
@@ -632,18 +635,18 @@
     public ILabelingStrategy getLabelingStrategy(DataStore dataStore) {
         ILabelingStrategy labelingStrategy = null;
 
-        File file = getResourcePath(dataStore, SymbolManager.LABELINGSTRATEGY_FILE_EXTENSION.substring(1));
+        DataResource resource = getResource(dataStore, SymbolManager.LABELINGSTRATEGY_FILE_EXTENSION.substring(1));
         try {
-            if ((file != null) && (file.exists())) {
+            if ((resource != null) && (resource.exists())) {
                 PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager();
-                FileInputStream is = new FileInputStream(file);
+                InputStream is = resource.asInputStream();
                 labelingStrategy = (ILabelingStrategy) persistenceManager.getObject(is);
                 is.close();
             }
-        } catch (FileNotFoundException e) {
-            logger.error("Label strategy not found", e);
-        } catch (IOException e) {
-            logger.error("Error reading the labeling strategy", e);
+        } 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
@@ -685,19 +688,17 @@
         }
     }
 
-    private File getResourcePath(DataStore dataStore, String resource) {
-        //Loading the file from a store based on file
+    
+    private DataResource getResource(DataStore dataStore, String resource) {
         DataServerExplorer explorer = null;
         try {
             explorer = dataStore.getExplorer();
             if (explorer == null) {
                 return null;
             }
-            return explorer.getResourcePath(dataStore, resource);
+            return explorer.getResource(dataStore, resource);
         } catch (Exception e) {
-            logger.warn(
-                    "Can't locate a specific legend provided by the explorer "
-                    + explorer, e);
+            logger.warn("Can't locate resource '"+resource+"' for '"+dataStore.getName()+"'.",e);
             return null;
         } finally {
             DisposeUtils.disposeQuietly(explorer);
