Revision 45929 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.csv/src/main/java/org/gvsig/fmap/dal/store/csv/CSVUtils.java
CSVUtils.java | ||
---|---|---|
50 | 50 |
import org.gvsig.fmap.geom.GeometryManager; |
51 | 51 |
import org.gvsig.fmap.geom.type.GeometryType; |
52 | 52 |
import org.gvsig.tools.dynobject.Tags; |
53 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
53 | 54 |
import org.slf4j.Logger; |
54 | 55 |
import org.slf4j.LoggerFactory; |
55 | 56 |
|
... | ... | |
84 | 85 |
return isr; |
85 | 86 |
} |
86 | 87 |
|
87 |
public static boolean loadFeatureType(CSVStoreParameters parameters, EditableFeatureType featureType, boolean detectTypes) throws IOException { |
|
88 |
public static boolean loadFeatureType(CSVStoreParameters parameters, EditableFeatureType featureType, boolean detectTypes, SimpleTaskStatus status) throws IOException {
|
|
88 | 89 |
InputStreamReader in = null; |
89 | 90 |
SimpleReader reader = null; |
90 | 91 |
try { |
... | ... | |
124 | 125 |
|
125 | 126 |
AutomaticDetectionOfTypes.DetectedValue[] detectedTypes = null; |
126 | 127 |
if( detectTypes ) { |
127 |
detectedTypes = automaticDetectionOfTypes(parameters, headers); |
|
128 |
detectedTypes = automaticDetectionOfTypes(parameters, headers, status);
|
|
128 | 129 |
} |
129 | 130 |
if( StringUtils.isBlank(headers[headers.length-1]) && |
130 | 131 |
(detectedTypes==null || detectedTypes[headers.length-1].isBlank()) ) { |
... | ... | |
186 | 187 |
return headers; |
187 | 188 |
} |
188 | 189 |
|
189 |
private static AutomaticDetectionOfTypes.DetectedValue[] automaticDetectionOfTypes(CSVStoreParameters parameters, String[] headers) throws IOException { |
|
190 |
private static AutomaticDetectionOfTypes.DetectedValue[] automaticDetectionOfTypes(CSVStoreParameters parameters, String[] headers, SimpleTaskStatus status) throws IOException {
|
|
190 | 191 |
String fullFileName = parameters.getFile()==null? "NULL":parameters.getFile().getAbsolutePath(); |
191 | 192 |
boolean automatic_types_detection = CSVStoreParameters.getAutomaticTypesDetection(parameters); |
192 | 193 |
if (!automatic_types_detection) { |
... | ... | |
207 | 208 |
headers.length, |
208 | 209 |
reader, |
209 | 210 |
CSVStoreParameters.isFirstLineHeader(parameters), |
210 |
CSVStoreParameters.getLocale(parameters) |
|
211 |
CSVStoreParameters.getLocale(parameters), |
|
212 |
status |
|
211 | 213 |
); |
212 | 214 |
} catch (Exception ex) { |
213 | 215 |
int lineno = 0; |
Also available in: Unified diff