Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleFilesystemServerProvider.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleFilesystemServerProvider.java	(revision 44241)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleFilesystemServerProvider.java	(revision 44242)
@@ -1,65 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.gvsig.fmap.dal.feature.spi.simpleprovider;
-
-import java.io.File;
-import org.gvsig.fmap.dal.DataServerExplorer;
-import org.gvsig.fmap.dal.DataStoreParameters;
-import org.gvsig.fmap.dal.exception.DataException;
-import org.gvsig.fmap.dal.resource.spi.ResourceConsumer;
-import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider;
-import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider;
-import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices;
-
-/**
- *
- * @author jjdelcerro
- */
-public class BaseSimpleFilesystemServerProvider 
-        extends AbstractFilesystemServerExplorerProvider 
-        implements FilesystemServerExplorerProvider, ResourceConsumer 
-    {
-    
-    private FilesystemServerExplorerProviderServices serverExplorer;
-    private final SimpleReaderFactory readerFactory;
-
-    public BaseSimpleFilesystemServerProvider(SimpleReaderFactory readerFactory) {
-        this.readerFactory = readerFactory;
-    }
-
-    @Override
-    public String getDataStoreProviderName() {
-        return this.readerFactory.getName();
-    }
-
-    @Override
-    public int getMode() {
-        return DataServerExplorer.MODE_FEATURE | DataServerExplorer.MODE_GEOMETRY;
-    }
-
-    @Override
-    public boolean accept(File file) {
-        return this.readerFactory.accept(file);
-    }
-
-    @Override
-    public DataStoreParameters getParameters(File file) throws DataException {
-        BaseSimpleStoreParameters params = new BaseSimpleStoreParameters(this.readerFactory);
-        params.setFile(file);
-        return params;
-    }
-
-    @Override
-    public void initialize(FilesystemServerExplorerProviderServices serverExplorer) {
-        this.serverExplorer = serverExplorer;
-    }
-
-    @Override
-    public String getDescription() {
-        return this.readerFactory.getDescription();
-    }
-    
-}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleStoreProvider.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleStoreProvider.java	(revision 44241)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleStoreProvider.java	(revision 44242)
@@ -1,735 +0,0 @@
-/**
- * gvSIG. Desktop Geographic Information System.
- *
- * Copyright (C) 2007-2013 gvSIG Association.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * For any additional information, do not hesitate to contact us
- * at info AT gvsig.com, or visit our website www.gvsig.com.
- */
-package org.gvsig.fmap.dal.feature.spi.simpleprovider;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import org.apache.commons.lang3.StringUtils;
-import org.cresques.cts.IProjection;
-import org.gvsig.fmap.dal.DALLocator;
-import org.gvsig.fmap.dal.DataManager;
-import org.gvsig.fmap.dal.DataServerExplorer;
-import org.gvsig.fmap.dal.DataStore;
-import org.gvsig.fmap.dal.DataStoreNotification;
-import org.gvsig.fmap.dal.DataTypes;
-import org.gvsig.fmap.dal.FileHelper;
-import org.gvsig.fmap.dal.exception.DataException;
-import org.gvsig.fmap.dal.exception.InitializeException;
-import org.gvsig.fmap.dal.exception.OpenException;
-import org.gvsig.fmap.dal.exception.ReadException;
-import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
-import org.gvsig.fmap.dal.feature.EditableFeature;
-import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor;
-import org.gvsig.fmap.dal.feature.EditableFeatureType;
-import org.gvsig.fmap.dal.feature.Feature;
-import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
-import org.gvsig.fmap.dal.feature.FeatureAttributeEmulator;
-import org.gvsig.fmap.dal.feature.FeatureStore;
-import org.gvsig.fmap.dal.feature.FeatureType;
-import org.gvsig.fmap.dal.feature.exception.PerformEditingException;
-import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
-import org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices;
-import org.gvsig.fmap.dal.feature.spi.memory.AbstractMemoryStoreProvider;
-import org.gvsig.fmap.dal.resource.file.FileResource;
-import org.gvsig.fmap.dal.resource.spi.ResourceConsumer;
-import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
-import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
-import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
-import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
-import org.gvsig.fmap.geom.Geometry;
-import org.gvsig.fmap.geom.GeometryLocator;
-import org.gvsig.fmap.geom.GeometryManager;
-import org.gvsig.fmap.geom.aggregate.MultiPoint;
-import org.gvsig.fmap.geom.primitive.Envelope;
-import org.gvsig.fmap.geom.primitive.Point;
-import org.gvsig.fmap.geom.type.GeometryType;
-import org.gvsig.tools.ToolsLocator;
-import org.gvsig.tools.dataTypes.CoercionException;
-import org.gvsig.tools.dataTypes.DataType;
-import org.gvsig.tools.dataTypes.DataTypesManager;
-import org.gvsig.tools.dataTypes.DataTypesManager.Coercion;
-import org.gvsig.tools.dataTypes.DataTypesManager.CoercionWithLocale;
-import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException;
-import org.gvsig.tools.exception.BaseException;
-import org.gvsig.tools.task.SimpleTaskStatus;
-import org.gvsig.tools.task.TaskStatusManager;
-import org.gvsig.tools.visitor.VisitCanceledException;
-import org.gvsig.tools.visitor.Visitor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BaseSimpleStoreProvider extends AbstractMemoryStoreProvider implements
-        ResourceConsumer {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(BaseSimpleStoreProvider.class);
-
-
-    private final ResourceProvider resource;
-
-    private long counterNewsOIDs = 0;
-    private Envelope envelope;
-    private boolean need_calculate_envelope = false;
-    private final SimpleTaskStatus taskStatus;
-    private String name = "";
-    private final SimpleReaderFactory readerFactory;
-
-    @SuppressWarnings("OverridableMethodCallInConstructor")
-    public BaseSimpleStoreProvider(
-            SimpleReaderFactory readerFactory,
-            BaseSimpleStoreParameters parameters,
-            DataStoreProviderServices storeServices
-        ) throws InitializeException {
-        super(
-                parameters,
-                storeServices,
-                FileHelper.newMetadataContainer(readerFactory.getName())
-        );
-        this.readerFactory = readerFactory;
-        TaskStatusManager manager = ToolsLocator.getTaskStatusManager();
-        this.taskStatus = manager.createDefaultSimpleTaskStatus(readerFactory.getName());
-
-        counterNewsOIDs = 0;
-
-        File file = getParameters().getFile();
-        resource = this.createResource(
-                FileResource.NAME,
-                new Object[]{file.getAbsolutePath()}
-        );
-
-        resource.addConsumer(this);
-        initializeFeatureTypes();
-    }
-
-    @Override
-    public BaseSimpleStoreParameters getParameters() {
-        return (BaseSimpleStoreParameters) super.getParameters();
-    }
-
-    @Override
-    public String getProviderName() {
-        return readerFactory.getName();
-    }
-
-    @Override
-    public boolean allowWrite() {
-        return false;
-    }
-
-    private String getFullFileName() {
-        // Usar solo para mostrar mensajes en el logger.
-        String s;
-        try {
-            s = getParameters().getFile().getAbsolutePath();
-        } catch (Exception e2) {
-            s = "(unknow)";
-        }
-        return s;
-    }
-
-    @Override
-    @SuppressWarnings("UseSpecificCatch")
-    public void open() throws OpenException {
-        if ( this.data != null ) {
-            return;
-        }
-        this.data = new ArrayList<>();
-        resource.setData(new HashMap());
-        counterNewsOIDs = 0;
-        try {
-            loadFeatures();
-        } catch (RuntimeException e) {
-            LOGGER.warn("Can't load features from JExcel '" + getFullFileName() + "'.", e);
-            throw e;
-        } catch (Exception e) {
-            LOGGER.warn("Can't load features from JExcel '" + getFullFileName() + "'.", e);
-            throw new RuntimeException(e);
-        }
-    }
-
-    @Override
-    public DataServerExplorer getExplorer() throws ReadException {
-        DataManager manager = DALLocator.getDataManager();
-        FilesystemServerExplorerParameters params;
-        try {
-            params = (FilesystemServerExplorerParameters) manager
-                    .createServerExplorerParameters(FilesystemServerExplorer.NAME);
-            params.setRoot(this.getParameters().getFile().getParent());
-            return manager.openServerExplorer(FilesystemServerExplorer.NAME, params);
-        } catch (DataException | ValidateDataParametersException e) {
-            throw new ReadException(this.getProviderName(), e);
-        }
-
-    }
-
-    @Override
-    public void performChanges(Iterator deleteds, Iterator inserteds, Iterator updateds, Iterator originalFeatureTypesUpdated) throws PerformEditingException {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public boolean closeResourceRequested(ResourceProvider resource) {
-        return true;
-    }
-
-    @Override
-    public int getOIDType() {
-        return DataTypes.LONG;
-    }
-
-    @Override
-    public boolean supportsAppendMode() {
-        return false;
-    }
-
-    @Override
-    public void append(FeatureProvider featureProvider) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public void beginAppend() {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public void endAppend() {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public Object createNewOID() {
-        return counterNewsOIDs++;
-    }
-
-    protected void initializeFeatureTypes() throws InitializeException {
-        try {
-            this.open();
-        } catch (OpenException e) {
-            throw new InitializeException(this.getProviderName(), e);
-        }
-    }
-
-    @Override
-    public Envelope getEnvelope() throws DataException {
-        this.open();
-        if ( this.envelope != null ) {
-            return this.envelope;
-        }
-        if ( !this.need_calculate_envelope ) {
-            return null;
-        }
-        FeatureStore fs = this.getFeatureStore();
-        FeatureType ft = fs.getDefaultFeatureType();
-        FeatureAttributeDescriptor fad = ft.getAttributeDescriptor(ft.getDefaultGeometryAttributeIndex());
-
-        try {
-            this.envelope = GeometryLocator.getGeometryManager().createEnvelope(fad.getGeomType().getSubType());
-            fs.accept(new Visitor() {
-                @Override
-                public void visit(Object obj) throws VisitCanceledException, BaseException {
-                    Feature f = (Feature) obj;
-                    Geometry geom = f.getDefaultGeometry();
-                    if ( geom != null ) {
-                        envelope.add(geom.getEnvelope());
-                    }
-                }
-            });
-        } catch (BaseException e) {
-            LOGGER.warn("Can't calculate the envelope of JExcel file '" + this.getFullName() + "'.", e);
-            this.envelope = null;
-        }
-
-        this.need_calculate_envelope = false;
-        return this.envelope;
-    }
-
-    @Override
-    public Object getDynValue(String name) throws DynFieldNotFoundException {
-        if ( DataStore.METADATA_ENVELOPE.equalsIgnoreCase(name) ) {
-            try {
-                return this.getEnvelope();
-            } catch (DataException e) {
-                return null;
-            }
-        } else {
-            if ( DataStore.METADATA_CRS.equalsIgnoreCase(name) ) {
-                IProjection pro = this.getParameters().getCRS();
-                if ( pro != null ) {
-                    return pro;
-                }
-            }
-        }
-        return super.getDynValue(name);
-    }
-
-    @Override
-    public void resourceChanged(ResourceProvider resource) {
-        this.getStoreServices().notifyChange(
-                DataStoreNotification.RESOURCE_CHANGED,
-                resource);
-    }
-
-    @Override
-    public Object getSourceId() {
-        return this.getParameters().getFile();
-    }
-
-    @Override
-    public String getName() {
-        return this.name;
-    }
-
-    @Override
-    public String getFullName() {
-        return this.getParameters().getFile().getAbsolutePath();
-    }
-
-    @Override
-    public ResourceProvider getResource() {
-        return resource;
-    }
-
-    private class FieldTypeParser {
-
-        public String name = null;
-        public int type = DataTypes.STRING;
-        public int size = 0;
-        public boolean allowNulls = true;
-
-        private String typename = "string";
-
-        FieldTypeParser() {
-        }
-
-        private int getType(String value) {
-            DataTypesManager dataTypesManager = ToolsLocator.getDataTypesManager();
-            return dataTypesManager.getType(typename);
-        }
-
-        // El formato seria:
-        //   name[:typename[:size[:notnull|null]]]
-        //   name[__typename[__size[__notnull|null]]]
-        //
-        @SuppressWarnings("UseSpecificCatch")
-        public boolean parse(String value) {
-            String theTypename = null;
-            String[] ss = null;
-            if ( value.contains(":") ) {
-                ss = value.split(":");
-            } else if ( value.contains("__") ) {
-                ss = value.split("__");
-            }
-            if ( ss == null ) {
-                this.name = value;
-                return true;
-            }
-            switch (ss.length) {
-            case 4:
-                if ( ss[3].length() > 0 ) {
-                    if ( "notnull".equalsIgnoreCase(ss[3]) ) {
-                        this.allowNulls = false;
-                    } else {
-                        this.allowNulls = true;
-                    }
-                }
-            case 3:
-                if ( ss[2].length() > 0 ) {
-                    try {
-                        this.size = Integer.parseInt(ss[2]);
-                    } catch (Exception ex) {
-                        LOGGER.warn("Ignore incorrect field size for field " + value + " in JExcel header of '" + getFullFileName() + "'.", ex);
-                    }
-                }
-            case 2:
-                if ( ss[1].length() > 0 ) {
-                    this.typename = ss[1];
-                    this.type = this.getType(this.typename);
-                    if ( this.type == DataTypes.INVALID ) {
-                        this.type = DataTypes.STRING;
-                        LOGGER.info("Type '" + theTypename + "' not valid for attribute '" + value + "' in JExcel file '" + getFullFileName() + "'.");
-                    }
-                }
-            case 1:
-                this.name = ss[0];
-                break;
-            }
-
-            if ( this.type != DataTypes.STRING ) {
-                this.size = 0;
-            }
-            return true;
-        }
-
-    }
-
-    @SuppressWarnings("UseSpecificCatch")
-    private EditableFeatureType getFeatureType(List<String> headers, int automaticTypes[]) {
-        EditableFeatureType fType = getStoreServices().createFeatureType(this.getName());
-        fType.setHasOID(true);
-        DataTypesManager dataTypesManager = ToolsLocator.getDataTypesManager();
-
-        FieldTypeParser[] fieldTypes = new FieldTypeParser[headers.size()];
-        //
-        // Calculamos cuales pueden ser los tipos de datos
-        //
-        for ( int i = 0; i < fieldTypes.length; i++ ) {
-            fieldTypes[i] = new FieldTypeParser();
-        }
-
-        // Asuminos los tipos pasados por parametro, que se supone
-        // son los detectados automaticamente.
-        if ( automaticTypes != null ) {
-            for ( int i = 0; i < fieldTypes.length && i < automaticTypes.length; i++ ) {
-                fieldTypes[i].type = automaticTypes[i];
-            }
-        }
-        // Luego probamos con lo que diga las cabezeras del CVS, sobreescribiendo
-        // los tipos anteriores en caso de definirse en la cabezara.
-        for ( int i = 0; i < fieldTypes.length; i++ ) {
-            if ( !fieldTypes[i].parse(headers.get(i)) ) {
-                continue;
-            }
-
-        }
-
-        // Y por ultimo hacemos caso a lo que se haya especificado en los parametros
-        // de apertura del reader, teniendo esto prioridad sobre todo.
-        int[] param_types = this.getParameters().getFieldTypes();
-        if ( param_types != null ) {
-            for ( int i = 0; i < fieldTypes.length && i < param_types.length; i++ ) {
-                fieldTypes[i].type = param_types[i];
-            }
-        }
-
-        int[] param_sizes = this.getParameters().getFieldSizes();
-        if ( param_sizes != null ) {
-            for ( int i = 0; i < param_sizes.length; i++ ) {
-                if ( param_sizes[i] > 0 ) {
-                    fieldTypes[i].size = param_sizes[i];
-                }
-            }
-        }
-        //
-        // Una vez ya sabemos los tipos de datos rellenamos el feature-type
-        //
-        for (FieldTypeParser fieldType : fieldTypes) {
-            EditableFeatureAttributeDescriptor fad = fType.add(fieldType.name, fieldType.type);
-            fad.setSize(fieldType.size);
-            fad.setAllowNull(fieldType.allowNulls);
-            if (fieldType.type == DataTypes.GEOMETRY && fType.getDefaultGeometryAttributeName() == null) {
-                fType.setDefaultGeometryAttributeName(fieldType.name);
-            }
-        }
-        String[] pointDimensionNames = this.getParameters().getPointDimensionNames();
-        if ( pointDimensionNames != null ) {
-//            ToPointEvaluaror evaluator = new ToPointEvaluaror(pointDimensionNames);
-            PointAttributeEmulator emulator = new PointAttributeEmulator(pointDimensionNames);
-            EditableFeatureAttributeDescriptor attr = fType.add("the_geom", DataTypes.GEOMETRY, emulator);
-            GeometryManager geommgr = GeometryLocator.getGeometryManager();
-            GeometryType gt;
-            try {
-                if ( emulator.fieldNames != null && emulator.fieldNames.length <= 2 ) {
-                	gt = geommgr.getGeometryType(Geometry.TYPES.GEOMETRY, Geometry.SUBTYPES.GEOM2D);
-                } else {
-                	gt = geommgr.getGeometryType(Geometry.TYPES.GEOMETRY, Geometry.SUBTYPES.GEOM3D);
-                }
-                attr.setGeometryType(gt);
-            } catch (Exception e) {
-                LOGGER.warn("Can't set geometry type for the calculated field in JExcel file '" + getFullFileName() + "'.", e);
-            }
-        }
-        return fType;
-    }
-
-    static class PointAttributeEmulator implements FeatureAttributeEmulator {
-
-        private static final Logger LOGGER = LoggerFactory.getLogger(PointAttributeEmulator.class);
-
-        private static final int XNAME = 0;
-        private static final int YNAME = 1;
-        private static final int ZNAME = 2;
-
-        private final GeometryManager geommgr;
-        private final String[] fieldNames;
-        private final Coercion toDouble;
-        private final DataType dataType;
-        private int errorcount = 0;
-
-        public PointAttributeEmulator(String[] pointDimensionNames) {
-            if ( pointDimensionNames.length > 2 ) {
-                this.fieldNames = new String[3];
-                this.fieldNames[ZNAME] = pointDimensionNames[2];
-            } else {
-                this.fieldNames = new String[2];
-            }
-            this.fieldNames[XNAME] = pointDimensionNames[0];
-            this.fieldNames[YNAME] = pointDimensionNames[1];
-            this.geommgr = GeometryLocator.getGeometryManager();
-            DataTypesManager datatypeManager = ToolsLocator.getDataTypesManager();
-
-            this.toDouble = datatypeManager.getCoercion(DataTypes.DOUBLE);
-            this.dataType = datatypeManager.get(DataTypes.GEOMETRY);
-        }
-
-        @Override
-        @SuppressWarnings("UseSpecificCatch")
-        public Object get(Feature feature) {
-            try {
-                Object valueX = feature.get(this.fieldNames[XNAME]);
-                valueX = toDouble.coerce(valueX);
-                if ( valueX == null ) {
-                    return null;
-                }
-                Object valueY = feature.get(this.fieldNames[YNAME]);
-                valueY = toDouble.coerce(valueY);
-                if ( valueY == null ) {
-                    return null;
-                }
-                Object valueZ = null;
-                if ( this.fieldNames.length > 2 ) {
-                    valueZ = toDouble.coerce(feature.get(this.fieldNames[ZNAME]));
-                    if ( valueZ == null ) {
-                        return null;
-                    }
-                }
-
-                double x = ((Double) valueX);
-                double y = ((Double) valueY);
-                Point point;
-                if ( this.fieldNames.length > 2 ) {
-                    point = geommgr.createPoint(x, y, Geometry.SUBTYPES.GEOM3D);
-                    double z = ((Double) valueZ);
-                    point.setCoordinateAt(2, z);
-                } else {
-                    point = geommgr.createPoint(x, y, Geometry.SUBTYPES.GEOM2D);
-                }
-                return point;
-            } catch (Exception ex) {
-                if ( ++errorcount < 5 ) {
-                    LOGGER.warn("[" + errorcount + "] Can't create point in ODS provider."+
-                            "XNAME='" + this.fieldNames[XNAME] + 
-                            "', YNAME='" + this.fieldNames[YNAME] + 
-                            "', ZNAME='" + ((this.fieldNames.length > 2)? this.fieldNames[ZNAME]: "(2D)") +
-                            "' feature=" + feature.toString(), ex);
-                }
-                return null;
-            }
-        }
-
-        @Override
-        public void set(EditableFeature feature, Object value) {
-            if ( value == null ) {
-                return;
-            }
-            Point point;
-            if ( value instanceof MultiPoint ) {
-                point = (Point) ((MultiPoint) value).getPrimitiveAt(0);
-            } else {
-                point = (Point) value;
-            }
-            feature.set(this.fieldNames[XNAME], point.getX());
-            feature.set(this.fieldNames[YNAME], point.getY());
-            if ( this.fieldNames.length > 2 ) {
-                feature.set(this.fieldNames[ZNAME], point.getCoordinateAt(2));
-            }
-        }
-
-        @Override
-        public boolean allowSetting() {
-            return true;
-        }
-
-        @Override
-        public String[] getRequiredFieldNames() {
-            return this.fieldNames;
-        }
-
-    }
-
-
-    @SuppressWarnings("UseSpecificCatch")
-    private void loadFeatures() throws IOException, DataException,
-            CoercionException, CloneNotSupportedException {
-        SimpleReader reader = null;
-
-        try {
-            List<String> headers;
-            FeatureStoreProviderServices store = this.getStoreServices();
-
-            boolean ignore_errors = getParameters().getIgnoreErrors();
-
-            reader = this.readerFactory.createReader(this.getParameters());
-            this.name = reader.getName();
-            
-            headers = getParameters().getFieldNames();
-            if ( headers == null ) {
-                headers = reader.getFieldNames();
-            }
-
-            // Initialize the feature types
-            EditableFeatureType edftype = this.getFeatureType(headers, automaticDetectionOfTypes(reader));
-            FeatureType ftype = edftype.getNotEditableCopy();
-            List<FeatureType> ftypes = new ArrayList<>();
-            ftypes.add(ftype);
-            store.setFeatureTypes(ftypes, ftype);
-
-            Coercion coercion[] = new Coercion[ftype.size()];
-            int sizes[] = new int[ftype.size()];
-            for ( int i = 0; i < ftype.size(); i++ ) {
-                sizes[i] = -1;
-                FeatureAttributeDescriptor ad = ftype.getAttributeDescriptor(i);
-                coercion[i] = ad.getDataType().getCoercion();
-                if ( ad.getDataType().getType() == DataTypes.STRING ) {
-                    if ( ad.getSize() == 0 ) {
-                        // Es un string y no tiene un size asignado.
-                        // Lo ponemos a cero para calcularlo.
-                        sizes[i] = 0;
-                    }
-                }
-            }
-            if ( ftype.getDefaultGeometryAttributeName() != null ) {
-                this.need_calculate_envelope = true;
-            }
-
-            Locale locale = getParameters().getLocale();
-            taskStatus.message("_loading");
-            int count = 0;
-
-            int count_errors = 0;
-            
-            reader.rewind();
-            List<Object> row = reader.read();
-
-            Object rawvalue;
-            while ( row != null ) {
-                taskStatus.setCurValue(++count);
-                FeatureProvider feature = this.createFeatureProvider(ftype);
-                for ( int i = 0; i < row.size(); i++ ) {
-                    rawvalue = row.get(i);
-                    if( rawvalue instanceof String && StringUtils.isBlank((String)rawvalue) ) {
-                        rawvalue = null;
-                    }
-                    try {
-                        Object value;
-                        if ( locale != null && coercion[i] instanceof CoercionWithLocale ) {
-                            value = ((CoercionWithLocale) (coercion[i])).coerce(rawvalue, locale);
-                        } else {
-                            value = coercion[i].coerce(rawvalue);
-                        }
-                        feature.set(i, value);
-                        if ( sizes[i] >= 0 && value != null ) {
-                            int x = ((String) value).length();
-                            if ( sizes[i] < x ) {
-                                sizes[i] = x;
-                            }
-                        }
-                    } catch (RuntimeException ex) {
-                        if ( !ignore_errors ) {
-                            throw ex;
-                        }
-                        if ( count_errors++ < 10 ) {
-                            LOGGER.warn("Can't load value of attribute " + i + " in row " + count + ".", ex);
-                        }
-                        if ( count_errors == 10 ) {
-                            LOGGER.info("Too many errors, suppress messages.");
-                        }
-                    }
-                }
-                this.addFeatureProvider(feature);
-                row = reader.read();
-            }
-            for ( int i = 0; i < ftype.size(); i++ ) {
-                if ( sizes[i] > 0 ) {
-                    EditableFeatureAttributeDescriptor efad = ((EditableFeatureAttributeDescriptor) edftype.getAttributeDescriptor(i));
-                    efad.setSize(sizes[i]);
-                }
-            }
-            // Volvemos a asignar al store el featuretype, ya que puede
-            // haber cambiado.
-            ftype = edftype.getNotEditableCopy();
-            ftypes = new ArrayList<>();
-            ftypes.add(ftype);
-            store.setFeatureTypes(ftypes, ftype);
-
-            taskStatus.terminate();
-        } catch (Exception ex) {
-            LOGGER.warn("Can't load features from '"+this.readerFactory.getName()+"' file '" + getFullFileName() + "'.", ex);
-        } finally {
-            if ( reader != null ) {
-                try {
-                    reader.close();
-                } catch (Exception ex) {
-                    // Do nothing
-                }
-            }
-
-        }
-    }
-    
-    private int[] automaticDetectionOfTypes(SimpleReader reader) throws IOException {
-        boolean automatic_types_detection = getParameters().getAutomaticTypesDetection();
-        if ( !automatic_types_detection ) {
-            return null;
-        }
-        int[] types = null;
-        try {
-            reader.rewind();
-            List<String> fieldNames = reader.getFieldNames();
-            if ( fieldNames == null ) {
-                fieldNames = getParameters().getFieldNames();
-            }
-
-            AutomaticDetectionOfTypes x = new AutomaticDetectionOfTypes(
-                    this.getFullFileName()
-            );
-            types = x.detect(
-                    fieldNames.size(), 
-                    reader, 
-                    false, 
-                    getParameters().getLocale()
-            );
-        } catch (Exception ex) {
-            throw new RuntimeException("Problems reading file '" + getFullFileName() + "'.", ex);
-        }
-        return types;
-    }
-
-    @Override
-    public boolean hasDynValue(String name) {
-        if ( DataStore.METADATA_ENVELOPE.equalsIgnoreCase(name) ) {
-            return true;
-        } else if ( DataStore.METADATA_CRS.equalsIgnoreCase(name) ) {
-            return true;
-        }
-        return super.hasDynValue(name);
-    }
-
-    
-}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleReader.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleReader.java	(revision 44241)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleReader.java	(revision 44242)
@@ -1,32 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.gvsig.fmap.dal.feature.spi.simpleprovider;
-
-import java.io.File;
-import java.util.List;
-import org.gvsig.fmap.dal.feature.spi.simpleprovider.AutomaticDetectionOfTypes.Rows;
-
-/**
- *
- * @author jjdelcerro
- */
-public interface SimpleReader extends Rows {
-
-    public SimpleReaderFactory getFactory();
-    
-    public File getFile();
-    
-    public List<String> getFieldNames();
-
-    public List<Object> read();
-    
-    public void rewind();
-    
-    public void close();
-
-    public String getName();
-    
-}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleFilesystemServerProviderFactory.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleFilesystemServerProviderFactory.java	(revision 44241)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleFilesystemServerProviderFactory.java	(revision 44242)
@@ -1,62 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.gvsig.fmap.dal.feature.spi.simpleprovider;
-
-import java.io.File;
-import org.gvsig.fmap.dal.DataServerExplorer;
-import org.gvsig.fmap.dal.exception.InitializeException;
-import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider;
-import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderFactory;
-
-/**
- *
- * @author jjdelcerro
- */
-public class BaseSimpleFilesystemServerProviderFactory
-        implements FilesystemServerExplorerProviderFactory {
-
-    private final SimpleReaderFactory readerFactory;
-
-    public BaseSimpleFilesystemServerProviderFactory(SimpleReaderFactory readerFactory) {
-        this.readerFactory = readerFactory;
-    }
-
-    @Override
-    public FilesystemServerExplorerProvider createProvider() throws InitializeException {
-        return new BaseSimpleFilesystemServerProvider(this.readerFactory);
-    }
-
-    @Override
-    public boolean accept(File pathname) {
-        return this.readerFactory.accept(pathname);
-    }
-
-    @Override
-    public String getName() {
-        return this.readerFactory.getName();
-    }
-
-    @Override
-    public String getDescription() {
-        return this.readerFactory.getDescription();
-    }
-
-    @Override
-    public int allowCreate() {
-        return NO;
-    }
-
-    @Override
-    public int getMode() {
-        return DataServerExplorer.MODE_FEATURE | DataServerExplorer.MODE_GEOMETRY;
-    }
-
-    @Override
-    public boolean isMode(int mode) {
-        return this.getMode()==mode;
-    }
-
-}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleStoreProviderFactory.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleStoreProviderFactory.java	(revision 44241)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleStoreProviderFactory.java	(revision 44242)
@@ -1,100 +0,0 @@
-/**
- * gvSIG. Desktop Geographic Information System.
- *
- * Copyright (C) 2007-2013 gvSIG Association.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * For any additional information, do not hesitate to contact us
- * at info AT gvsig.com, or visit our website www.gvsig.com.
- */
-package org.gvsig.fmap.dal.feature.spi.simpleprovider;
-
-import org.gvsig.fmap.dal.DataParameters;
-import org.gvsig.fmap.dal.DataStoreProvider;
-import org.gvsig.fmap.dal.exception.InitializeException;
-import org.gvsig.fmap.dal.feature.spi.AbstractFeatureStoreProviderFactory;
-import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
-import org.gvsig.tools.dynobject.DynObject;
-
-public class BaseSimpleStoreProviderFactory 
-        extends AbstractFeatureStoreProviderFactory 
-    {
-
-    private final SimpleReaderFactory readerFactory;
-    
-    protected BaseSimpleStoreProviderFactory(SimpleReaderFactory readerFactory) {
-        super(readerFactory.getName(), readerFactory.getDescription());
-        this.readerFactory = readerFactory;
-    }
-
-    @Override
-    public DynObject createParameters() {
-        return new BaseSimpleStoreParameters(this.readerFactory);
-    }
-
-    @Override
-    public DataStoreProvider createProvider(
-            DataParameters parameters, 
-            DataStoreProviderServices providerServices) throws InitializeException {
-        return new BaseSimpleStoreProvider(
-                this.readerFactory,
-                (BaseSimpleStoreParameters) parameters,
-                providerServices
-        );
-    }
-
-    @Override
-    public int allowCreate() {
-        return NO;
-    }
-
-    @Override
-    public int allowWrite() {
-        return NO;
-    }
-
-    @Override
-    public int allowRead() {
-        return YES;
-    }
-
-    @Override
-    public int hasRasterSupport() {
-        return NO;
-    }
-
-    @Override
-    public int hasTabularSupport() {
-        return YES;
-    }
-
-    @Override
-    public int hasVectorialSupport() {
-        return YES;
-    }
-
-    @Override
-    public int allowMultipleGeometryTypes() {
-        return YES;
-    }
-
-    @Override
-    public int allowEditableFeatureType() {
-        return NO;
-    }
-
-}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleReaderFactory.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleReaderFactory.java	(revision 44241)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleReaderFactory.java	(revision 44242)
@@ -1,35 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.gvsig.fmap.dal.feature.spi.simpleprovider;
-
-import java.io.FileFilter;
-import java.net.URL;
-import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory;
-import org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters;
-import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderFactory;
-
-/**
- *
- * @author jjdelcerro
- */
-public interface SimpleReaderFactory extends FileFilter {
-    
-    public String getName();
-    
-    public String getDescription();
-    
-    public String[] getExtensions();
-    
-    public SimpleReader createReader(OpenFeatureStoreParameters params);
-    
-    public FeatureStoreProviderFactory createStoreProviderFactory();
-    
-    public FilesystemServerExplorerProviderFactory createFilesystemServerProviderFactory();
-    
-    public void selfRegister(URL parameters_xml, URL metadata_xml);
-    
-    public void selfRegister(Class loader);
-}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleStoreParameters.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleStoreParameters.java	(revision 44241)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/BaseSimpleStoreParameters.java	(revision 44242)
@@ -1,255 +0,0 @@
-/**
- * gvSIG. Desktop Geographic Information System.
- *
- * Copyright (C) 2007-2013 gvSIG Association.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * For any additional information, do not hesitate to contact us
- * at info AT gvsig.com, or visit our website www.gvsig.com.
- */
-package org.gvsig.fmap.dal.feature.spi.simpleprovider;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-import org.apache.commons.lang3.StringUtils;
-import org.cresques.cts.IProjection;
-import org.gvsig.fmap.dal.FileHelper;
-import org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters;
-import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
-import org.gvsig.fmap.dal.spi.AbstractDataParameters;
-import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
-import org.gvsig.tools.ToolsLocator;
-import org.gvsig.tools.dataTypes.DataTypesManager;
-import org.gvsig.tools.dynobject.DelegatedDynObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BaseSimpleStoreParameters extends AbstractDataParameters implements
-        OpenFeatureStoreParameters, FilesystemStoreParameters {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(BaseSimpleStoreParameters.class);
-
-
-    private static final String FILE = "file";
-    private static final String IGNOREERRORS = "ignoreErrors";
-    private static final String CRS = "CRS";
-    private static final String FIELDTYPES = "fieldtypes";
-    private static final String FIELDNAMES = "fieldnames";
-    private static final String LOCALE = "locale";
-    private static final String POINT = "pointFields";
-    private static final String AUTOMATICTYPESDETECTION = "automaticTypesDetection";
-
-    private final DelegatedDynObject parameters;
-    private final SimpleReaderFactory readerFactory;
-    
-    public BaseSimpleStoreParameters(SimpleReaderFactory readerFactory) {
-        super();
-        this.readerFactory = readerFactory;
-        this.parameters = (DelegatedDynObject) FileHelper.newParameters(readerFactory.getName());
-        this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, readerFactory.getName());
-    }
-
-    @Override
-    public String getDataStoreName() {
-        return (String) this.getDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME);
-    }
-
-    @Override
-    public String getDescription() {
-        return this.getDynClass().getDescription();
-    }
-
-    @Override
-    protected DelegatedDynObject getDelegatedDynObject() {
-        return parameters;
-    }
-
-    @Override
-    public boolean isValid() {
-        if ( this.getPathName() == null ) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public File getFile() {
-        return (File) this.getDynValue(FILE);
-    }
-
-    @Override
-    public void setFile(File file) {
-        this.setDynValue(FILE, file);
-    }
-
-    public IProjection getCRS() {
-        return (IProjection) this.parameters.getDynValue(CRS);
-    }
-
-    public String getPathName() {
-        File f = (File) this.parameters.getDynValue(FILE);
-        if ( f == null ) {
-            return null;
-        }
-        return f.getPath();
-    }
-
-    @SuppressWarnings("UseSpecificCatch")
-    public Locale getLocale() {
-        try {
-            String s = (String) this.parameters.getDynValue(LOCALE);
-            if ( s.trim().length() == 0 ) {
-                return null;
-            }
-            if ( "DEFAULT".equalsIgnoreCase(s.trim()) ) {
-                return Locale.getDefault();
-            }
-            Locale locale;
-            // locale = Locale.forLanguageTag(s); // Since java 1.7
-            String[] ss = s.split("-");
-            switch (ss.length) {
-            case 1:
-                locale = new Locale(ss[0]);
-                break;
-            case 2:
-                locale = new Locale(ss[0], ss[1]);
-                break;
-            case 3:
-            default:
-                locale = new Locale(ss[0], ss[1], ss[2]);
-                break;
-            }
-            return locale;
-        } catch (Exception ex) {
-            LOGGER.warn("Can't get locale from ODS parameters.", ex);
-            return null;
-        }
-    }
-
-    public String[] getPointDimensionNames() {
-        String s = (String) this.parameters.getDynValue(POINT);
-        if ( StringUtils.isEmpty(s) ) {
-            return null;
-        }
-        String sep = this.getDelimiter(s);
-        if ( sep == null ) {
-            return new String[] { s };
-        }
-        return s.split(sep);
-    }
-
-    public boolean getIgnoreErrors() {
-        Boolean b = (Boolean) this.parameters.getDynValue(IGNOREERRORS);
-        if ( b == null ) {
-            return false;
-        }
-        return b;
-    }
-
-    private String getDelimiter(String line) {
-        String sep = null;
-        // Cuiaddo con los ":", los he puesto al final a proposito
-        // ya que podian estar en la cadena para separar el size
-        // de cada tipo.
-        String seps = ",;-|@#/+$%&!:";
-        for ( int i = 0; i < seps.length(); i++ ) {
-            sep = seps.substring(i, 1);
-            if ( line.contains(seps.substring(i, 1)) ) {
-                break;
-            }
-            sep = null;
-        }
-        return sep;
-    }
-
-    public List<String> getFieldNames() {
-        String s = (String) this.parameters.getDynValue(FIELDNAMES);
-        if ( StringUtils.isEmpty(s) ) {
-            return null;
-        }
-        String sep = this.getDelimiter(s);
-        if ( sep == null ) {
-            return null;
-        }
-        String fieldNames[] = s.split("[" + sep + "]");
-        for (int i = 0; i < fieldNames.length; i++) {
-            fieldNames[i] = fieldNames[i].trim();
-        }
-        return Arrays.asList(fieldNames);
-    }
-    
-    public int[] getFieldTypes() {
-        String s = (String) this.parameters.getDynValue(FIELDTYPES);
-        if ( StringUtils.isEmpty(s) ) {
-            return null;
-        }
-        String sep = this.getDelimiter(s);
-        if ( sep == null ) {
-            return null;
-        }
-        DataTypesManager dataTypeManager = ToolsLocator.getDataTypesManager();
-        String fieldTypeNames[] = s.split("[" + sep + "]");
-        int fieldTypes[] = new int[fieldTypeNames.length];
-        for ( int i = 0; i < fieldTypeNames.length; i++ ) {
-            s = fieldTypeNames[i].trim();
-            if ( s.contains(":") ) {
-                s = s.split(":")[0];
-            }
-            fieldTypes[i] = dataTypeManager.getType(s);
-        }
-        return fieldTypes;
-    }
-
-    @SuppressWarnings("UseSpecificCatch")
-    public int[] getFieldSizes() {
-        String s = (String) this.parameters.getDynValue(FIELDTYPES);
-        if ( StringUtils.isEmpty(s) ) {
-            return null;
-        }
-        String sep = this.getDelimiter(s);
-        if ( sep == null ) {
-            return null;
-        }
-        String fieldTypeNames[] = s.split("[" + sep + "]");
-        int fieldSizes[] = new int[fieldTypeNames.length];
-        for ( int i = 0; i < fieldTypeNames.length; i++ ) {
-            String fieldtype = fieldTypeNames[i].trim();
-            if ( fieldtype.contains(":") ) {
-                try {
-                    s = fieldtype.split(":")[1];
-                    fieldSizes[i] = Integer.parseInt(s);
-                } catch (Exception ex) {
-                    LOGGER.warn("Can't get size of field " + i + " (" + fieldtype + ").", ex);
-                }
-            } else {
-                fieldSizes[i] = 0;
-            }
-        }
-        return fieldSizes;
-    }
-
-    public boolean getAutomaticTypesDetection() {
-        Boolean b = (Boolean) this.parameters.getDynValue(AUTOMATICTYPESDETECTION);
-        if ( b == null ) {
-            return false;
-        }
-        return b;
-    }
-
-}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/AbstractSimpleReaderFactory.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/AbstractSimpleReaderFactory.java	(revision 44241)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/AbstractSimpleReaderFactory.java	(revision 44242)
@@ -1,159 +0,0 @@
-package org.gvsig.fmap.dal.feature.spi.simpleprovider;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import org.apache.commons.io.FilenameUtils;
-import org.gvsig.fmap.dal.DALFileLocator;
-import org.gvsig.fmap.dal.DALLocator;
-import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory;
-import org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters;
-import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderFactory;
-import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
-import org.gvsig.metadata.MetadataLocator;
-import org.gvsig.metadata.MetadataManager;
-import org.gvsig.tools.ToolsLocator;
-import org.gvsig.tools.dynobject.DynStruct;
-import org.gvsig.tools.persistence.PersistenceManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- *
- * @author jjdelcerro
- */
-public abstract class AbstractSimpleReaderFactory implements SimpleReaderFactory {
-
-    protected Logger LOGGER = LoggerFactory.getLogger(AbstractSimpleReaderFactory.class);
-
-    private final String name;
-    private final String description;
-    private final String[] extensions;
-
-    protected AbstractSimpleReaderFactory(
-            String name,
-            String description,
-            String[] extensions
-    ) {
-        this.name = name;
-        this.description = description;
-        this.extensions = extensions;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getDescription() {
-        return description;
-    }
-
-    @Override
-    public String[] getExtensions() {
-        return extensions;
-    }
-
-    @Override
-    public boolean accept(File pathname) {
-        return FilenameUtils.isExtension(pathname.getName(), this.getExtensions());
-    }
-
-    @Override
-    public FeatureStoreProviderFactory createStoreProviderFactory() {
-        return new BaseSimpleStoreProviderFactory(this);
-    }
-
-    @Override
-    public FilesystemServerExplorerProviderFactory createFilesystemServerProviderFactory() {
-        return new BaseSimpleFilesystemServerProviderFactory(this);
-    }
-
-    private InputStream openStream(URL url) {
-        try {
-            return url.openStream();
-        } catch (IOException ex) {
-            return null;
-        }
-    }
-
-    @Override
-    public void selfRegister(Class loader) {
-        this.selfRegister(
-                loader.getResource(this.getName() + "Parameters.xml"),
-                loader.getResource(this.getName() + "Metadata.xml")
-        );    
-    }
-    
-    @SuppressWarnings("UseSpecificCatch")
-    @Override
-    public void selfRegister(URL parameters_xml, URL metadata_xml) {
-        DynStruct definition;
-        PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager();
-
-        definition = persistenceManager.getDefinition(this.getName());
-        if (definition == null) {
-            InputStream stream = this.openStream(parameters_xml);
-            if (stream == null) {
-                throw new RuntimeException("Can't access parameters definition in resource '" + parameters_xml.toString() + "'.");
-            }
-            persistenceManager.updateDefinition(
-                    BaseSimpleStoreParameters.class,
-                    this.getName(),
-                    stream,
-                    BaseSimpleStoreParameters.class.getClassLoader(),
-                    null,
-                    null
-            );
-        }
-
-        if( metadata_xml!=null ) {
-            MetadataManager metadataManager = MetadataLocator.getMetadataManager();
-            try {
-                definition = metadataManager.getDefinition(this.getName());
-                if (definition == null) {
-                    InputStream stream = this.openStream(metadata_xml);
-                    metadataManager.addDefinition(
-                            this.getName(),
-                            stream,
-                            BaseSimpleStoreParameters.class.getClassLoader()
-                    );
-                }
-            } catch (Exception e) {
-                LOGGER.warn(
-                        "Can't access metadata definition in resource '" + metadata_xml.toString() + "'.",
-                        e
-                );
-            }
-        }
-
-        DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator
-                .getDataManager();
-
-        if (!dataman.getStoreProviders().contains(this.getName())) {
-            dataman.registerStoreProviderFactory(
-                    new BaseSimpleStoreProviderFactory(this)
-            );
-        }
-
-        try {
-            DALFileLocator.getFilesystemServerExplorerManager()
-                    .registerProviderFactory(
-                            new BaseSimpleFilesystemServerProviderFactory(this)
-                    );
-        } catch (Exception e) {
-            LOGGER.warn(
-                "Can't register filesystem server provider factory ("+this.getName()+").",
-                e
-            );
-
-        }
-
-    }
-
-    @Override
-    public abstract SimpleReader createReader(OpenFeatureStoreParameters params);
-
-}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderFilesystemServerProviderFactory.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderFilesystemServerProviderFactory.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderFilesystemServerProviderFactory.java	(revision 44242)
@@ -0,0 +1,62 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.gvsig.fmap.dal.feature.spi.simpleprovider;
+
+import java.io.File;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderFactory;
+
+/**
+ *
+ * @author jjdelcerro
+ */
+public class SimpleSequentialReaderFilesystemServerProviderFactory
+        implements FilesystemServerExplorerProviderFactory {
+
+    private final SimpleSequentialReaderFactory readerFactory;
+
+    public SimpleSequentialReaderFilesystemServerProviderFactory(SimpleSequentialReaderFactory readerFactory) {
+        this.readerFactory = readerFactory;
+    }
+
+    @Override
+    public FilesystemServerExplorerProvider createProvider() throws InitializeException {
+        return new SimpleSequentialReaderFilesystemServerProvider(this.readerFactory);
+    }
+
+    @Override
+    public boolean accept(File pathname) {
+        return this.readerFactory.accept(pathname);
+    }
+
+    @Override
+    public String getName() {
+        return this.readerFactory.getName();
+    }
+
+    @Override
+    public String getDescription() {
+        return this.readerFactory.getDescription();
+    }
+
+    @Override
+    public int allowCreate() {
+        return NO;
+    }
+
+    @Override
+    public int getMode() {
+        return DataServerExplorer.MODE_FEATURE | DataServerExplorer.MODE_GEOMETRY;
+    }
+
+    @Override
+    public boolean isMode(int mode) {
+        return this.getMode()==mode;
+    }
+
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReader.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReader.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReader.java	(revision 44242)
@@ -0,0 +1,32 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.gvsig.fmap.dal.feature.spi.simpleprovider;
+
+import java.io.File;
+import java.util.List;
+import org.gvsig.fmap.dal.feature.spi.simpleprovider.AutomaticDetectionOfTypes.Rows;
+
+/**
+ *
+ * @author jjdelcerro
+ */
+public interface SimpleSequentialReader extends Rows {
+
+    public SimpleSequentialReaderFactory getFactory();
+    
+    public File getFile();
+    
+    public List<String> getFieldNames();
+
+    public List<Object> read();
+    
+    public void rewind();
+    
+    public void close();
+
+    public String getName();
+    
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreProviderFactory.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreProviderFactory.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreProviderFactory.java	(revision 44242)
@@ -0,0 +1,104 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.fmap.dal.feature.spi.simpleprovider;
+
+import org.gvsig.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.DataStoreProvider;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.feature.spi.AbstractFeatureStoreProviderFactory;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.tools.dynobject.DynObject;
+
+public class SimpleSequentialReaderStoreProviderFactory 
+        extends AbstractFeatureStoreProviderFactory 
+    {
+
+    private final SimpleSequentialReaderFactory readerFactory;
+    
+    protected SimpleSequentialReaderStoreProviderFactory(SimpleSequentialReaderFactory readerFactory) {
+        super(readerFactory.getName(), readerFactory.getDescription());
+        this.readerFactory = readerFactory;
+    }
+    
+    public SimpleSequentialReaderFactory getReaderFactory() {
+        return this.readerFactory;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        return new SimpleSequentialReaderStoreParameters(this.readerFactory);
+    }
+
+    @Override
+    public DataStoreProvider createProvider(
+            DataParameters parameters, 
+            DataStoreProviderServices providerServices) throws InitializeException {
+        return new SimpleSequentialReaderStoreProvider(
+                this.readerFactory,
+                (SimpleSequentialReaderStoreParameters) parameters,
+                providerServices
+        );
+    }
+
+    @Override
+    public int allowCreate() {
+        return NO;
+    }
+
+    @Override
+    public int allowWrite() {
+        return NO;
+    }
+
+    @Override
+    public int allowRead() {
+        return YES;
+    }
+
+    @Override
+    public int hasRasterSupport() {
+        return NO;
+    }
+
+    @Override
+    public int hasTabularSupport() {
+        return YES;
+    }
+
+    @Override
+    public int hasVectorialSupport() {
+        return YES;
+    }
+
+    @Override
+    public int allowMultipleGeometryTypes() {
+        return YES;
+    }
+
+    @Override
+    public int allowEditableFeatureType() {
+        return NO;
+    }
+
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreParameters.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreParameters.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreParameters.java	(revision 44242)
@@ -0,0 +1,287 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.fmap.dal.feature.spi.simpleprovider;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+import org.apache.commons.lang3.StringUtils;
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataStoreProviderFactory;
+import org.gvsig.fmap.dal.FileHelper;
+import org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.dal.spi.AbstractDataParameters;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dataTypes.DataTypesManager;
+import org.gvsig.tools.dynobject.DelegatedDynObject;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SimpleSequentialReaderStoreParameters extends AbstractDataParameters implements
+        OpenFeatureStoreParameters, FilesystemStoreParameters {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SimpleSequentialReaderStoreParameters.class);
+
+
+    private static final String FILE = "file";
+    private static final String IGNOREERRORS = "ignoreErrors";
+    private static final String CRS = "CRS";
+    private static final String FIELDTYPES = "fieldtypes";
+    private static final String FIELDNAMES = "fieldnames";
+    private static final String LOCALE = "locale";
+    private static final String POINT = "pointFields";
+    private static final String AUTOMATICTYPESDETECTION = "automaticTypesDetection";
+
+    private DelegatedDynObject parameters;
+    private SimpleSequentialReaderFactory readerFactory;
+
+    public SimpleSequentialReaderStoreParameters() {
+        
+    }
+    
+    public SimpleSequentialReaderStoreParameters(SimpleSequentialReaderFactory readerFactory) {
+        super();
+        this.readerFactory = readerFactory;
+        this.parameters = (DelegatedDynObject) FileHelper.newParameters(readerFactory.getName());
+        this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, readerFactory.getName());
+    }
+
+    @Override
+    public String getDataStoreName() {
+        return (String) this.getDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME);
+    }
+
+    @Override
+    public void loadFromState(PersistentState state) throws PersistenceException {
+        String providerName = (String) state.get(DataStoreProviderServices.PROVIDER_PARAMTER_NAME);
+        
+        DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
+        SimpleSequentialReaderStoreProviderFactory provider = 
+                (SimpleSequentialReaderStoreProviderFactory)  dataman.getStoreProviderFactory(
+                        providerName
+        );
+        this.readerFactory = provider.getReaderFactory();
+        this.parameters = (DelegatedDynObject) FileHelper.newParameters(readerFactory.getName());
+        
+        super.loadFromState(state);
+    }
+    
+    @Override
+    public String getDescription() {
+        return this.getDynClass().getDescription();
+    }
+
+    @Override
+    protected DelegatedDynObject getDelegatedDynObject() {
+        return parameters;
+    }
+
+    @Override
+    public void setDynValue(String name, Object value) {
+        super.setDynValue(name, value);
+        if( this.readerFactory!=null && StringUtils.equalsIgnoreCase(name, FILE) ) {
+            this.readerFactory.fetchDefaultParameters(this);
+        }
+    }
+
+    @Override
+    public boolean isValid() {
+        if ( this.getPathName() == null ) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public File getFile() {
+        return (File) this.getDynValue(FILE);
+    }
+
+    @Override
+    public void setFile(File file) {
+        this.setDynValue(FILE, file);
+    }
+
+    public IProjection getCRS() {
+        return (IProjection) this.parameters.getDynValue(CRS);
+    }
+
+    public String getPathName() {
+        File f = (File) this.parameters.getDynValue(FILE);
+        if ( f == null ) {
+            return null;
+        }
+        return f.getPath();
+    }
+
+    @SuppressWarnings("UseSpecificCatch")
+    public Locale getLocale() {
+        try {
+            String s = (String) this.parameters.getDynValue(LOCALE);
+            if ( s.trim().length() == 0 ) {
+                return null;
+            }
+            if ( "DEFAULT".equalsIgnoreCase(s.trim()) ) {
+                return Locale.getDefault();
+            }
+            Locale locale;
+            // locale = Locale.forLanguageTag(s); // Since java 1.7
+            String[] ss = s.split("-");
+            switch (ss.length) {
+            case 1:
+                locale = new Locale(ss[0]);
+                break;
+            case 2:
+                locale = new Locale(ss[0], ss[1]);
+                break;
+            case 3:
+            default:
+                locale = new Locale(ss[0], ss[1], ss[2]);
+                break;
+            }
+            return locale;
+        } catch (Exception ex) {
+            LOGGER.warn("Can't get locale from ODS parameters.", ex);
+            return null;
+        }
+    }
+
+    public String[] getPointDimensionNames() {
+        String s = (String) this.parameters.getDynValue(POINT);
+        if ( StringUtils.isEmpty(s) ) {
+            return null;
+        }
+        String sep = this.getDelimiter(s);
+        if ( sep == null ) {
+            return new String[] { s };
+        }
+        return s.split(sep);
+    }
+
+    public boolean getIgnoreErrors() {
+        Boolean b = (Boolean) this.parameters.getDynValue(IGNOREERRORS);
+        if ( b == null ) {
+            return false;
+        }
+        return b;
+    }
+
+    private String getDelimiter(String line) {
+        String sep = null;
+        // Cuiaddo con los ":", los he puesto al final a proposito
+        // ya que podian estar en la cadena para separar el size
+        // de cada tipo.
+        String seps = ",;-|@#/+$%&!:";
+        for ( int i = 0; i < seps.length(); i++ ) {
+            sep = seps.substring(i, 1);
+            if ( line.contains(seps.substring(i, 1)) ) {
+                break;
+            }
+            sep = null;
+        }
+        return sep;
+    }
+
+    public List<String> getFieldNames() {
+        String s = (String) this.parameters.getDynValue(FIELDNAMES);
+        if ( StringUtils.isEmpty(s) ) {
+            return null;
+        }
+        String sep = this.getDelimiter(s);
+        if ( sep == null ) {
+            return null;
+        }
+        String fieldNames[] = s.split("[" + sep + "]");
+        for (int i = 0; i < fieldNames.length; i++) {
+            fieldNames[i] = fieldNames[i].trim();
+        }
+        return Arrays.asList(fieldNames);
+    }
+    
+    public int[] getFieldTypes() {
+        String s = (String) this.parameters.getDynValue(FIELDTYPES);
+        if ( StringUtils.isEmpty(s) ) {
+            return null;
+        }
+        String sep = this.getDelimiter(s);
+        if ( sep == null ) {
+            return null;
+        }
+        DataTypesManager dataTypeManager = ToolsLocator.getDataTypesManager();
+        String fieldTypeNames[] = s.split("[" + sep + "]");
+        int fieldTypes[] = new int[fieldTypeNames.length];
+        for ( int i = 0; i < fieldTypeNames.length; i++ ) {
+            s = fieldTypeNames[i].trim();
+            if ( s.contains(":") ) {
+                s = s.split(":")[0];
+            }
+            fieldTypes[i] = dataTypeManager.getType(s);
+        }
+        return fieldTypes;
+    }
+
+    @SuppressWarnings("UseSpecificCatch")
+    public int[] getFieldSizes() {
+        String s = (String) this.parameters.getDynValue(FIELDTYPES);
+        if ( StringUtils.isEmpty(s) ) {
+            return null;
+        }
+        String sep = this.getDelimiter(s);
+        if ( sep == null ) {
+            return null;
+        }
+        String fieldTypeNames[] = s.split("[" + sep + "]");
+        int fieldSizes[] = new int[fieldTypeNames.length];
+        for ( int i = 0; i < fieldTypeNames.length; i++ ) {
+            String fieldtype = fieldTypeNames[i].trim();
+            if ( fieldtype.contains(":") ) {
+                try {
+                    s = fieldtype.split(":")[1];
+                    fieldSizes[i] = Integer.parseInt(s);
+                } catch (Exception ex) {
+                    LOGGER.warn("Can't get size of field " + i + " (" + fieldtype + ").", ex);
+                }
+            } else {
+                fieldSizes[i] = 0;
+            }
+        }
+        return fieldSizes;
+    }
+
+    public boolean getAutomaticTypesDetection() {
+        Boolean b = (Boolean) this.parameters.getDynValue(AUTOMATICTYPESDETECTION);
+        if ( b == null ) {
+            return false;
+        }
+        return b;
+    }
+
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderFilesystemServerProvider.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderFilesystemServerProvider.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderFilesystemServerProvider.java	(revision 44242)
@@ -0,0 +1,65 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.gvsig.fmap.dal.feature.spi.simpleprovider;
+
+import java.io.File;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.resource.spi.ResourceConsumer;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices;
+
+/**
+ *
+ * @author jjdelcerro
+ */
+public class SimpleSequentialReaderFilesystemServerProvider 
+        extends AbstractFilesystemServerExplorerProvider 
+        implements FilesystemServerExplorerProvider, ResourceConsumer 
+    {
+    
+    private FilesystemServerExplorerProviderServices serverExplorer;
+    private final SimpleSequentialReaderFactory readerFactory;
+
+    public SimpleSequentialReaderFilesystemServerProvider(SimpleSequentialReaderFactory readerFactory) {
+        this.readerFactory = readerFactory;
+    }
+
+    @Override
+    public String getDataStoreProviderName() {
+        return this.readerFactory.getName();
+    }
+
+    @Override
+    public int getMode() {
+        return DataServerExplorer.MODE_FEATURE | DataServerExplorer.MODE_GEOMETRY;
+    }
+
+    @Override
+    public boolean accept(File file) {
+        return this.readerFactory.accept(file);
+    }
+
+    @Override
+    public DataStoreParameters getParameters(File file) throws DataException {
+        SimpleSequentialReaderStoreParameters params = new SimpleSequentialReaderStoreParameters(this.readerFactory);
+        params.setFile(file);
+        return params;
+    }
+
+    @Override
+    public void initialize(FilesystemServerExplorerProviderServices serverExplorer) {
+        this.serverExplorer = serverExplorer;
+    }
+
+    @Override
+    public String getDescription() {
+        return this.readerFactory.getDescription();
+    }
+    
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderFactory.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderFactory.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderFactory.java	(revision 44242)
@@ -0,0 +1,38 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.gvsig.fmap.dal.feature.spi.simpleprovider;
+
+import java.io.FileFilter;
+import java.net.URL;
+import org.gvsig.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory;
+import org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderFactory;
+
+/**
+ *
+ * @author jjdelcerro
+ */
+public interface SimpleSequentialReaderFactory extends FileFilter {
+    
+    public String getName();
+    
+    public String getDescription();
+    
+    public String[] getExtensions();
+    
+    public SimpleSequentialReader createReader(OpenFeatureStoreParameters params);
+    
+    public FeatureStoreProviderFactory createStoreProviderFactory();
+    
+    public FilesystemServerExplorerProviderFactory createFilesystemServerProviderFactory();
+    
+    public void selfRegister(URL parameters_xml, URL metadata_xml);
+    
+    public void selfRegister(Class loader);
+
+    public void fetchDefaultParameters(DataParameters parameters);
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreProvider.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreProvider.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreProvider.java	(revision 44242)
@@ -0,0 +1,766 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.fmap.dal.feature.spi.simpleprovider;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.commons.lang3.StringUtils;
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.DataStoreNotification;
+import org.gvsig.fmap.dal.DataTypes;
+import org.gvsig.fmap.dal.FileHelper;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.OpenException;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor;
+import org.gvsig.fmap.dal.feature.EditableFeatureType;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
+import org.gvsig.fmap.dal.feature.FeatureAttributeEmulator;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.dal.feature.exception.PerformEditingException;
+import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
+import org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices;
+import org.gvsig.fmap.dal.feature.spi.memory.AbstractMemoryStoreProvider;
+import org.gvsig.fmap.dal.resource.file.FileResource;
+import org.gvsig.fmap.dal.resource.spi.ResourceConsumer;
+import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.GeometryUtils;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dataTypes.CoercionException;
+import org.gvsig.tools.dataTypes.DataTypesManager;
+import org.gvsig.tools.dataTypes.DataTypesManager.Coercion;
+import org.gvsig.tools.dataTypes.DataTypesManager.CoercionWithLocale;
+import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.task.SimpleTaskStatus;
+import org.gvsig.tools.task.TaskStatusManager;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("UseSpecificCatch")
+public class SimpleSequentialReaderStoreProvider extends AbstractMemoryStoreProvider implements
+        ResourceConsumer {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SimpleSequentialReaderStoreProvider.class);
+
+
+    private final ResourceProvider resource;
+
+    private long counterNewsOIDs = 0;
+    private Envelope envelope;
+    private boolean need_calculate_envelope = false;
+    private final SimpleTaskStatus taskStatus;
+    private String name = "";
+    private final SimpleSequentialReaderFactory readerFactory;
+
+    public SimpleSequentialReaderStoreProvider(
+            SimpleSequentialReaderFactory readerFactory,
+            SimpleSequentialReaderStoreParameters parameters,
+            DataStoreProviderServices storeServices
+        ) throws InitializeException {
+        super(
+                parameters,
+                storeServices,
+                FileHelper.newMetadataContainer(readerFactory.getName())
+        );
+        this.readerFactory = readerFactory;
+        TaskStatusManager manager = ToolsLocator.getTaskStatusManager();
+        this.taskStatus = manager.createDefaultSimpleTaskStatus(readerFactory.getName());
+
+        counterNewsOIDs = 0;
+
+        File file = getParameters().getFile();
+        resource = this.createResource(
+                FileResource.NAME,
+                new Object[]{file.getAbsolutePath()}
+        );
+
+        resource.addConsumer(this);
+        initializeFeatureTypes();
+    }
+
+    @Override
+    public SimpleSequentialReaderStoreParameters getParameters() {
+        return (SimpleSequentialReaderStoreParameters) super.getParameters();
+    }
+
+    @Override
+    public String getProviderName() {
+        if( this.readerFactory==null ) {
+            return "unknown";
+        }
+        return this.readerFactory.getName();
+    }
+
+    @Override
+    public boolean allowWrite() {
+        return false;
+    }
+
+    private String getFullFileName() {
+        // Usar solo para mostrar mensajes en el logger.
+        String s;
+        try {
+            s = getParameters().getFile().getAbsolutePath();
+        } catch (Exception e2) {
+            s = "(unknow)";
+        }
+        return s;
+    }
+
+    @Override
+    public void open() throws OpenException {
+        if ( this.data != null ) {
+            return;
+        }
+        this.data = new ArrayList<>();
+        resource.setData(new HashMap());
+        counterNewsOIDs = 0;
+        try {
+            loadFeatures();
+        } catch (RuntimeException e) {
+            LOGGER.warn("Can't load features from '"+getProviderName()+"' file '" + getFullFileName() + "'.", e);
+            throw e;
+        } catch (Exception e) {
+            LOGGER.warn("Can't load features from '"+getProviderName()+"' file '" + getFullFileName() + "'.", e);
+            throw new RuntimeException(e);
+        }
+    }
+
+    @Override
+    public DataServerExplorer getExplorer() throws ReadException {
+        DataManager manager = DALLocator.getDataManager();
+        FilesystemServerExplorerParameters params;
+        try {
+            params = (FilesystemServerExplorerParameters) manager
+                    .createServerExplorerParameters(FilesystemServerExplorer.NAME);
+            params.setRoot(this.getParameters().getFile().getParent());
+            return manager.openServerExplorer(FilesystemServerExplorer.NAME, params);
+        } catch (DataException | ValidateDataParametersException e) {
+            throw new ReadException(this.getProviderName(), e);
+        }
+
+    }
+
+    @Override
+    public void performChanges(Iterator deleteds, Iterator inserteds, Iterator updateds, Iterator originalFeatureTypesUpdated) throws PerformEditingException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean closeResourceRequested(ResourceProvider resource) {
+        return true;
+    }
+
+    @Override
+    public int getOIDType() {
+        return DataTypes.LONG;
+    }
+
+    @Override
+    public boolean supportsAppendMode() {
+        return false;
+    }
+
+    @Override
+    public void append(FeatureProvider featureProvider) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void beginAppend() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void endAppend() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Object createNewOID() {
+        return counterNewsOIDs++;
+    }
+
+    protected void initializeFeatureTypes() throws InitializeException {
+        try {
+            this.open();
+        } catch (OpenException e) {
+            throw new InitializeException(this.getProviderName(), e);
+        }
+    }
+
+    @Override
+    public Envelope getEnvelope() throws DataException {
+        this.open();
+        if ( this.envelope != null ) {
+            return this.envelope;
+        }
+        if ( !this.need_calculate_envelope ) {
+            return null;
+        }
+        FeatureStore fs = this.getFeatureStore();
+        FeatureType ft = fs.getDefaultFeatureType();
+        FeatureAttributeDescriptor fad = ft.getAttributeDescriptor(ft.getDefaultGeometryAttributeIndex());
+
+        try {
+            this.envelope = GeometryLocator.getGeometryManager().createEnvelope(fad.getGeomType().getSubType());
+            fs.accept(new Visitor() {
+                @Override
+                public void visit(Object obj) throws VisitCanceledException, BaseException {
+                    Feature f = (Feature) obj;
+                    Geometry geom = f.getDefaultGeometry();
+                    if ( geom != null ) {
+                        envelope.add(geom.getEnvelope());
+                    }
+                }
+            });
+        } catch (BaseException e) {
+            LOGGER.warn("Can't calculate the envelope of '"+getProviderName()+"' file '" + this.getFullName() + "'.", e);
+            this.envelope = null;
+        }
+
+        this.need_calculate_envelope = false;
+        return this.envelope;
+    }
+
+    @Override
+    public Object getDynValue(String name) throws DynFieldNotFoundException {
+        if ( DataStore.METADATA_ENVELOPE.equalsIgnoreCase(name) ) {
+            try {
+                return this.getEnvelope();
+            } catch (DataException e) {
+                return null;
+            }
+        } else {
+            if ( DataStore.METADATA_CRS.equalsIgnoreCase(name) ) {
+                IProjection pro = this.getParameters().getCRS();
+                if ( pro != null ) {
+                    return pro;
+                }
+                FeatureType type;
+                try {
+                    type = this.getStoreServices().getDefaultFeatureType();
+                    pro = type.getDefaultSRS();
+                    if( pro!=null ) {
+                        return pro;
+                    }
+                } catch (DataException ex) {
+                }
+            }
+        }
+        return super.getDynValue(name);
+    }
+
+    @Override
+    public void resourceChanged(ResourceProvider resource) {
+        this.getStoreServices().notifyChange(
+                DataStoreNotification.RESOURCE_CHANGED,
+                resource);
+    }
+
+    @Override
+    public Object getSourceId() {
+        return this.getParameters().getFile();
+    }
+
+    @Override
+    public String getName() {
+        return this.name;
+    }
+
+    @Override
+    public String getFullName() {
+        return this.getParameters().getFile().getAbsolutePath();
+    }
+
+    @Override
+    public ResourceProvider getResource() {
+        return resource;
+    }
+
+    private class FieldTypeParser {
+
+        public String name = null;
+        public int type = DataTypes.STRING;
+        public int size = 0;
+        public boolean allowNulls = true;
+        public int geomType = Geometry.TYPES.GEOMETRY;
+        public int geomSubtype = Geometry.SUBTYPES.GEOM2D;
+
+        private String typename = "string";
+
+        FieldTypeParser() {
+        }
+
+        private int getType(String value) {
+            DataTypesManager dataTypesManager = ToolsLocator.getDataTypesManager();
+            return dataTypesManager.getType(typename);
+        }
+
+        @SuppressWarnings("UseSpecificCatch")
+        public boolean parse(String value) {
+            String[] args;
+            if ( value.contains(":") ) {
+                args = value.split(":");
+            } else if ( value.contains("/") ) {
+                args = value.split("/");
+            } else if ( value.contains("__") ) {
+                args = value.split("__");
+            } else {
+                this.name = value;
+                return true;
+            }
+            
+            int n = 0;
+            this.name = args[n++];
+            if( n >= args.length ) {
+                return true;
+            }
+            this.typename = args[n++];
+            this.type = this.getType(this.typename);
+            if ( this.type == DataTypes.INVALID ) {
+                this.geomType = GeometryUtils.getGeometryType(this.typename);
+                if( this.geomType==Geometry.TYPES.UNKNOWN )  {
+                    this.type = DataTypes.STRING;
+                    LOGGER.info("Type '" + this.typename + "' not valid for attribute '" + value + "' in '"+getProviderName()+"' file '" + getFullFileName() + "'.");
+                } else {
+                    this.typename = "GEOMETRY";
+                    this.type = DataTypes.GEOMETRY;
+                }
+            }
+            switch(this.type) {
+                case DataTypes.STRING:
+                    this.size = 50;
+                    break;
+                case DataTypes.INT:
+                    this.size = 10;
+                    break;
+                case DataTypes.LONG:
+                    this.size = 20;
+                    break;
+                case DataTypes.FLOAT:
+                    this.size = 10;
+                    break;
+                case DataTypes.DOUBLE:
+                    this.size = 20;
+                    break;
+                default:
+                    this.size = 0;
+            }
+            while (n < args.length) {
+                String option = args[n++].toLowerCase();
+                switch (option) {
+                    case "size":
+                        try {
+                            this.size = Integer.parseInt(args[n++]);
+                        } catch (Exception ex) {
+                            LOGGER.warn("Ignore incorrect field size for field " + value + " in '"+getProviderName()+"' file '" + getFullFileName() + "'.", ex);
+                        }
+                        break;
+                    case "geomtype":
+                        this.geomType = GeometryUtils.getGeometryType(args[n++]);
+                        break;
+                    case "geomsubtype":
+                        this.geomSubtype = GeometryUtils.getGeometrySubtype(args[n++]);
+                        break;
+                    case "allownulls":
+                        this.allowNulls = true;
+                        break;
+                    case "notallownulls":
+                        this.allowNulls = false;
+                        break;
+                    default:
+                        LOGGER.warn("Illegal argumente '"+option+"' in '"+getProviderName()+"' file '" + getFullFileName() + "'.");
+                }
+            }
+            return true;
+        }
+
+    }
+
+    private EditableFeatureType getFeatureType(List<String> headers, int automaticTypes[]) {
+        EditableFeatureType fType = getStoreServices().createFeatureType(this.getName());
+        fType.setHasOID(true);
+//        DataTypesManager dataTypesManager = ToolsLocator.getDataTypesManager();
+
+        FieldTypeParser[] fieldTypes = new FieldTypeParser[headers.size()];
+        //
+        // Calculamos cuales pueden ser los tipos de datos
+        //
+        for ( int i = 0; i < fieldTypes.length; i++ ) {
+            fieldTypes[i] = new FieldTypeParser();
+        }
+
+        // Asuminos los tipos pasados por parametro, que se supone
+        // son los detectados automaticamente.
+        if ( automaticTypes != null ) {
+            for ( int i = 0; i < fieldTypes.length && i < automaticTypes.length; i++ ) {
+                fieldTypes[i].type = automaticTypes[i];
+            }
+        }
+        // Luego probamos con lo que diga las cabezeras, sobreescribiendo
+        // los tipos anteriores en caso de definirse en la cabezara.
+        for ( int i = 0; i < fieldTypes.length; i++ ) {
+            fieldTypes[i].parse(headers.get(i));
+        }
+
+        // Y por ultimo hacemos caso a lo que se haya especificado en los parametros
+        // de apertura del reader, teniendo esto prioridad sobre todo.
+        int[] param_types = this.getParameters().getFieldTypes();
+        if ( param_types != null ) {
+            for ( int i = 0; i < fieldTypes.length && i < param_types.length; i++ ) {
+                fieldTypes[i].type = param_types[i];
+            }
+        }
+
+        int[] param_sizes = this.getParameters().getFieldSizes();
+        if ( param_sizes != null ) {
+            for ( int i = 0; i < param_sizes.length; i++ ) {
+                if ( param_sizes[i] > 0 ) {
+                    fieldTypes[i].size = param_sizes[i];
+                }
+            }
+        }
+        //
+        // Una vez ya sabemos los tipos de datos rellenamos el feature-type
+        //
+        for (FieldTypeParser fieldType : fieldTypes) {
+            EditableFeatureAttributeDescriptor fad = fType.add(fieldType.name, fieldType.type);
+            fad.setSize(fieldType.size);
+            fad.setAllowNull(fieldType.allowNulls);
+            if (fieldType.type == DataTypes.GEOMETRY ) {
+                fad.setGeometryType(fieldType.geomType, fieldType.geomSubtype);
+                if( fType.getDefaultGeometryAttributeName() == null ) {
+                    fType.setDefaultGeometryAttributeName(fieldType.name);
+                }
+            }
+        }
+        String[] pointDimensionNames = this.getParameters().getPointDimensionNames();
+        if ( pointDimensionNames != null ) {
+            PointAttributeEmulator emulator = new PointAttributeEmulator(pointDimensionNames);
+            EditableFeatureAttributeDescriptor attr = fType.add("the_geom", DataTypes.GEOMETRY, emulator);
+            GeometryManager geommgr = GeometryLocator.getGeometryManager();
+            GeometryType gt;
+            try {
+                if ( emulator.fieldNames != null && emulator.fieldNames.length <= 2 ) {
+                	gt = geommgr.getGeometryType(Geometry.TYPES.GEOMETRY, Geometry.SUBTYPES.GEOM2D);
+                } else {
+                	gt = geommgr.getGeometryType(Geometry.TYPES.GEOMETRY, Geometry.SUBTYPES.GEOM3D);
+                }
+                attr.setGeometryType(gt);
+            } catch (Exception e) {
+                LOGGER.warn("Can't set geometry type for the calculated field in '"+getProviderName()+"' file '" + getFullFileName() + "'.", e);
+            }
+        }
+        return fType;
+    }
+
+    class PointAttributeEmulator implements FeatureAttributeEmulator {
+
+        private static final int XNAME = 0;
+        private static final int YNAME = 1;
+        private static final int ZNAME = 2;
+
+        private final GeometryManager geommgr;
+        private final String[] fieldNames;
+        private final Coercion toDouble;
+        private int errorcount = 0;
+
+        public PointAttributeEmulator(String[] pointDimensionNames) {
+            if ( pointDimensionNames.length > 2 ) {
+                this.fieldNames = new String[3];
+                this.fieldNames[ZNAME] = pointDimensionNames[2];
+            } else {
+                this.fieldNames = new String[2];
+            }
+            this.fieldNames[XNAME] = pointDimensionNames[0];
+            this.fieldNames[YNAME] = pointDimensionNames[1];
+            this.geommgr = GeometryLocator.getGeometryManager();
+            DataTypesManager datatypeManager = ToolsLocator.getDataTypesManager();
+
+            this.toDouble = datatypeManager.getCoercion(DataTypes.DOUBLE);
+        }
+
+        @Override
+        @SuppressWarnings("UseSpecificCatch")
+        public Object get(Feature feature) {
+            try {
+                Object valueX = feature.get(this.fieldNames[XNAME]);
+                valueX = toDouble.coerce(valueX);
+                if ( valueX == null ) {
+                    return null;
+                }
+                Object valueY = feature.get(this.fieldNames[YNAME]);
+                valueY = toDouble.coerce(valueY);
+                if ( valueY == null ) {
+                    return null;
+                }
+                Object valueZ = null;
+                if ( this.fieldNames.length > 2 ) {
+                    valueZ = toDouble.coerce(feature.get(this.fieldNames[ZNAME]));
+                    if ( valueZ == null ) {
+                        return null;
+                    }
+                }
+
+                double x = ((Double) valueX);
+                double y = ((Double) valueY);
+                Point point;
+                if ( this.fieldNames.length > 2 ) {
+                    point = geommgr.createPoint(x, y, Geometry.SUBTYPES.GEOM3D);
+                    double z = ((Double) valueZ);
+                    point.setCoordinateAt(2, z);
+                } else {
+                    point = geommgr.createPoint(x, y, Geometry.SUBTYPES.GEOM2D);
+                }
+                return point;
+            } catch (Exception ex) {
+                if ( ++errorcount < 5 ) {
+                    LOGGER.warn("[" + errorcount + "] Can't create point from '"+getProviderName()+"' file."+
+                            "XNAME='" + this.fieldNames[XNAME] + 
+                            "', YNAME='" + this.fieldNames[YNAME] + 
+                            "', ZNAME='" + ((this.fieldNames.length > 2)? this.fieldNames[ZNAME]: "(2D)") +
+                            "' feature=" + feature.toString(), ex);
+                }
+                return null;
+            }
+        }
+
+        @Override
+        public void set(EditableFeature feature, Object value) {
+            if ( value == null ) {
+                return;
+            }
+            Point point;
+            if ( value instanceof MultiPoint ) {
+                point = (Point) ((MultiPoint) value).getPrimitiveAt(0);
+            } else {
+                point = (Point) value;
+            }
+            feature.set(this.fieldNames[XNAME], point.getX());
+            feature.set(this.fieldNames[YNAME], point.getY());
+            if ( this.fieldNames.length > 2 ) {
+                feature.set(this.fieldNames[ZNAME], point.getCoordinateAt(2));
+            }
+        }
+
+        @Override
+        public boolean allowSetting() {
+            return true;
+        }
+
+        @Override
+        public String[] getRequiredFieldNames() {
+            return this.fieldNames;
+        }
+
+    }
+
+
+    private void loadFeatures() throws IOException, DataException,
+            CoercionException, CloneNotSupportedException {
+        SimpleSequentialReader reader = null;
+
+        try {
+            List<String> headers;
+            FeatureStoreProviderServices store = this.getStoreServices();
+
+            boolean ignore_errors = getParameters().getIgnoreErrors();
+
+            reader = this.readerFactory.createReader(this.getParameters());
+            this.name = reader.getName();
+            
+            headers = getParameters().getFieldNames();
+            if ( headers == null ) {
+                headers = reader.getFieldNames();
+            }
+
+            // Initialize the feature types
+            EditableFeatureType edftype = this.getFeatureType(headers, automaticDetectionOfTypes(reader));
+            FeatureType ftype = edftype.getNotEditableCopy();
+            List<FeatureType> ftypes = new ArrayList<>();
+            ftypes.add(ftype);
+            store.setFeatureTypes(ftypes, ftype);
+
+            Coercion coercion[] = new Coercion[ftype.size()];
+            int sizes[] = new int[ftype.size()];
+            for ( int i = 0; i < ftype.size(); i++ ) {
+                sizes[i] = -1;
+                FeatureAttributeDescriptor ad = ftype.getAttributeDescriptor(i);
+                coercion[i] = ad.getDataType().getCoercion();
+                if ( ad.getDataType().getType() == DataTypes.STRING ) {
+                    if ( ad.getSize() == 0 ) {
+                        // Es un string y no tiene un size asignado.
+                        // Lo ponemos a cero para calcularlo.
+                        sizes[i] = 0;
+                    }
+                }
+            }
+            if ( ftype.getDefaultGeometryAttributeName() != null ) {
+                this.need_calculate_envelope = true;
+            }
+
+            Locale locale = getParameters().getLocale();
+            taskStatus.message("_loading");
+            int count = 0;
+
+            int count_errors = 0;
+            
+            reader.rewind();
+            List<Object> row = reader.read();
+
+            Object rawvalue;
+            while ( row != null ) {
+                taskStatus.setCurValue(++count);
+                FeatureProvider feature = this.createFeatureProvider(ftype);
+                for ( int i = 0; i < row.size(); i++ ) {
+                    rawvalue = row.get(i);
+                    if( rawvalue instanceof String && StringUtils.isBlank((String)rawvalue) ) {
+                        rawvalue = null;
+                    }
+                    try {
+                        Object value;
+                        if ( locale != null && coercion[i] instanceof CoercionWithLocale ) {
+                            value = ((CoercionWithLocale) (coercion[i])).coerce(rawvalue, locale);
+                        } else {
+                            value = coercion[i].coerce(rawvalue);
+                        }
+                        feature.set(i, value);
+                        if ( sizes[i] >= 0 && value != null ) {
+                            int x = ((String) value).length();
+                            if ( sizes[i] < x ) {
+                                sizes[i] = x;
+                            }
+                        }
+                    } catch (RuntimeException ex) {
+                        if ( !ignore_errors ) {
+                            throw ex;
+                        }
+                        if ( count_errors++ < 10 ) {
+                            LOGGER.warn("Can't load value of attribute " + i + " in row " + count + ".", ex);
+                        }
+                        if ( count_errors == 10 ) {
+                            LOGGER.info("Too many errors, suppress messages.");
+                        }
+                    }
+                }
+                this.addFeatureProvider(feature);
+                row = reader.read();
+            }
+            for ( int i = 0; i < ftype.size(); i++ ) {
+                if ( sizes[i] > 0 ) {
+                    EditableFeatureAttributeDescriptor efad = ((EditableFeatureAttributeDescriptor) edftype.getAttributeDescriptor(i));
+                    efad.setSize(sizes[i]);
+                }
+            }
+            // Volvemos a asignar al store el featuretype, ya que puede
+            // haber cambiado.
+            ftype = edftype.getNotEditableCopy();
+            ftypes = new ArrayList<>();
+            ftypes.add(ftype);
+            store.setFeatureTypes(ftypes, ftype);
+
+            taskStatus.terminate();
+        } catch (Exception ex) {
+            LOGGER.warn("Can't load features from '"+getProviderName()+"' file '" + getFullFileName() + "'.", ex);
+        } finally {
+            if ( reader != null ) {
+                try {
+                    reader.close();
+                } catch (Exception ex) {
+                    // Do nothing
+                }
+            }
+
+        }
+    }
+    
+    private int[] automaticDetectionOfTypes(SimpleSequentialReader reader) throws IOException {
+        boolean automatic_types_detection = getParameters().getAutomaticTypesDetection();
+        if ( !automatic_types_detection ) {
+            return null;
+        }
+        int[] types = null;
+        try {
+            reader.rewind();
+            List<String> fieldNames = reader.getFieldNames();
+            if ( fieldNames == null ) {
+                fieldNames = getParameters().getFieldNames();
+            }
+
+            AutomaticDetectionOfTypes x = new AutomaticDetectionOfTypes(
+                    this.getFullFileName()
+            );
+            types = x.detect(
+                    fieldNames.size(), 
+                    reader, 
+                    false, 
+                    getParameters().getLocale()
+            );
+        } catch (Exception ex) {
+            throw new RuntimeException("Problems reading '"+getProviderName()+"' file '" + getFullFileName() + "'.", ex);
+        }
+        return types;
+    }
+
+    @Override
+    public boolean hasDynValue(String name) {
+        if ( DataStore.METADATA_ENVELOPE.equalsIgnoreCase(name) ) {
+            return true;
+        } else if ( DataStore.METADATA_CRS.equalsIgnoreCase(name) ) {
+            return true;
+        }
+        return super.hasDynValue(name);
+    }
+
+    
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/AbstractSimpleSequentialReaderFactory.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/AbstractSimpleSequentialReaderFactory.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/AbstractSimpleSequentialReaderFactory.java	(revision 44242)
@@ -0,0 +1,169 @@
+package org.gvsig.fmap.dal.feature.spi.simpleprovider;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import org.apache.commons.io.FilenameUtils;
+import org.gvsig.fmap.dal.DALFileLocator;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory;
+import org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderFactory;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.metadata.MetadataLocator;
+import org.gvsig.metadata.MetadataManager;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author jjdelcerro
+ */
+public abstract class AbstractSimpleSequentialReaderFactory implements SimpleSequentialReaderFactory {
+
+    protected Logger LOGGER = LoggerFactory.getLogger(AbstractSimpleSequentialReaderFactory.class);
+
+    private final String name;
+    private final String description;
+    private final String[] extensions;
+
+    protected AbstractSimpleSequentialReaderFactory(
+            String name,
+            String description,
+            String[] extensions
+    ) {
+        this.name = name;
+        this.description = description;
+        this.extensions = extensions;
+    }
+
+    protected Logger logger() {
+        return LOGGER;
+    }
+    
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String getDescription() {
+        return description;
+    }
+
+    @Override
+    public String[] getExtensions() {
+        return extensions;
+    }
+
+    @Override
+    public boolean accept(File pathname) {
+        return FilenameUtils.isExtension(pathname.getName(), this.getExtensions());
+    }
+
+    @Override
+    public FeatureStoreProviderFactory createStoreProviderFactory() {
+        return new SimpleSequentialReaderStoreProviderFactory(this);
+    }
+
+    @Override
+    public FilesystemServerExplorerProviderFactory createFilesystemServerProviderFactory() {
+        return new SimpleSequentialReaderFilesystemServerProviderFactory(this);
+    }
+
+    private InputStream openStream(URL url) {
+        try {
+            return url.openStream();
+        } catch (IOException ex) {
+            return null;
+        }
+    }
+
+    @Override
+    public void selfRegister(Class loader) {
+        this.selfRegister(
+                loader.getResource(this.getName() + "Parameters.xml"),
+                loader.getResource(this.getName() + "Metadata.xml")
+        );    
+    }
+    
+    @SuppressWarnings("UseSpecificCatch")
+    @Override
+    public void selfRegister(URL parameters_xml, URL metadata_xml) {
+        DynStruct definition;
+        PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager();
+
+        definition = persistenceManager.getDefinition(this.getName());
+        if (definition == null) {
+            InputStream stream = this.openStream(parameters_xml);
+            if (stream == null) {
+                throw new RuntimeException("Can't access parameters definition in resource '" + parameters_xml.toString() + "'.");
+            }
+            persistenceManager.updateDefinition(
+                    SimpleSequentialReaderStoreParameters.class,
+                    this.getName(),
+                    stream,
+                    SimpleSequentialReaderStoreParameters.class.getClassLoader(),
+                    null,
+                    null
+            );
+        }
+
+        if( metadata_xml!=null ) {
+            MetadataManager metadataManager = MetadataLocator.getMetadataManager();
+            try {
+                definition = metadataManager.getDefinition(this.getName());
+                if (definition == null) {
+                    InputStream stream = this.openStream(metadata_xml);
+                    metadataManager.addDefinition(
+                            this.getName(),
+                            stream,
+                            SimpleSequentialReaderStoreParameters.class.getClassLoader()
+                    );
+                }
+            } catch (Exception e) {
+                LOGGER.warn(
+                        "Can't access metadata definition in resource '" + metadata_xml.toString() + "'.",
+                        e
+                );
+            }
+        }
+
+        DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator
+                .getDataManager();
+
+        if (!dataman.getStoreProviders().contains(this.getName())) {
+            dataman.registerStoreProviderFactory(
+                    new SimpleSequentialReaderStoreProviderFactory(this)
+            );
+        }
+
+        try {
+            DALFileLocator.getFilesystemServerExplorerManager()
+                    .registerProviderFactory(
+                            new SimpleSequentialReaderFilesystemServerProviderFactory(this)
+                    );
+        } catch (Exception e) {
+            LOGGER.warn(
+                "Can't register filesystem server provider factory ("+this.getName()+").",
+                e
+            );
+
+        }
+
+    }
+    
+    @Override
+    public void fetchDefaultParameters(DataParameters parameters) {
+        // Default do nothing
+    }
+    
+    @Override
+    public abstract SimpleSequentialReader createReader(OpenFeatureStoreParameters params);
+
+}
