Revision 12534 branches/v10/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dbf/DBFDriver.java

View differences:

DBFDriver.java
76 76
                fieldTypes[i] = dbf.getFieldType(i);
77 77
            }
78 78
    		int aux = (int)(Math.random() * 1000);
79
    		fTemp = new File(tempDirectoryPath + "/tmpDbf" + aux + ".dbf");            
79
    		fTemp = new File(tempDirectoryPath + "/tmpDbf" + aux + ".dbf");
80 80
    		dbfWriter.setFile(fTemp);
81 81
        } catch (DriverException e) {
82 82
            throw new IOException(e.getMessage());
......
100 100
        // Field Type (C  or M)
101 101
        char cfieldType = fieldTypes[fieldId];
102 102
    	int fieldType = getFieldType(fieldId);
103
    	
103

  
104 104
    	String strValue;
105 105

  
106 106
        if (cfieldType == 'D') {
......
143 143
    			throw new DriverException(e1);
144 144
    		}
145 145
   			strValue = strValue.trim();
146
   			if (fieldType == Types.BOOLEAN){
147
   				strValue = strValue.toLowerCase();
148
 				strValue = Boolean.toString(strValue.equals("t") || strValue.equals("y"));
149
   			}
150

  
146 151
    		try {
147 152
				return ValueFactory.createValueByType(strValue, fieldType);
148 153
			} catch (ParseException e) {
......
369 374

  
370 375
	public ITableDefinition getTableDefinition() {
371 376
		tableDef = new TableDefinition();
372
		int numFields; 
377
		int numFields;
373 378
		try {
374 379
			numFields = getFieldCount();
375 380
			FieldDescription[] fieldsDescrip = new FieldDescription[numFields];
......
390 395
				// TODO: ?DEFAULTVALUE?
391 396
				// fieldsDescrip[i].setDefaultValue(get)
392 397
			}
393
	
398

  
394 399
			tableDef.setFieldsDesc(fieldsDescrip);
395 400
			return tableDef;
396 401
		} catch (DriverException e) {

Also available in: Unified diff