Revision 42811 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.shp/src/main/java/org/gvsig/fmap/dal/store/shp/SHPStoreProvider.java
SHPStoreProvider.java | ||
---|---|---|
274 | 274 |
} |
275 | 275 |
|
276 | 276 |
public String getProviderName() { |
277 |
return NAME; |
|
277 |
return NAME;
|
|
278 | 278 |
} |
279 | 279 |
|
280 | 280 |
public boolean allowWrite() { |
... | ... | |
338 | 338 |
if( this.getShpParameters().getLoadCorruptGeometriesAsNull() ) { |
339 | 339 |
geom = null; |
340 | 340 |
} else { |
341 |
throw new ReadException(getProviderName(), e);
|
|
341 |
throw new ReadGeometryException(getName(), featureProvider.getOID(), e);
|
|
342 | 342 |
} |
343 | 343 |
} |
344 | 344 |
featureProvider.set(i, geom); |
... | ... | |
350 | 350 |
} |
351 | 351 |
|
352 | 352 |
} |
353 |
|
|
354 |
public class ReadGeometryException extends ReadException { |
|
353 | 355 |
|
356 |
private final static String MESSAGE_FORMAT = "There was errors loading a geometry from '%(store)'.\nCheck 'Load corrupt geometries as null' in the shape's properties of the add layer dialog to skip corrupt geometries."; |
|
357 |
private final static String MESSAGE_KEY = "_ReadGeometryException"; |
|
358 |
private static final long serialVersionUID = 2626155328734197112L; |
|
359 |
|
|
360 |
public ReadGeometryException(String store, Object oid, Throwable cause) { |
|
361 |
super(MESSAGE_FORMAT, cause, MESSAGE_KEY, serialVersionUID); |
|
362 |
setValue("store", store); |
|
363 |
setValue("storeParameters",getParameters()); |
|
364 |
} |
|
365 |
} |
|
366 |
|
|
354 | 367 |
private boolean hasDBFAttributes(FeatureType featureType, boolean hasGeometry) { |
355 | 368 |
FeatureAttributeDescriptor[] attributes = featureType.getAttributeDescriptors(); |
356 | 369 |
// If there aren't any attributes, nor has any DBF attributes |
Also available in: Unified diff