TypeUtil.setFieldValue(o, columnFD.getName(), thisRow[columnIndex]); osw.store(o);
String rowValue = thisRow[columnIndex].trim(); if (rowValue.length() > 0) { TypeUtil.setFieldValue(o, columnFD.getName(), rowValue); osw.store(o); }
    void executeInternal(ObjectStoreWriter osw, DelimitedFileConfiguration dfc)        throws BuildException {        setClassName(dfc.getConfigClassDescriptor().getName());        setKeyFieldName(dfc.keyFieldDescriptor.getName());        File currentFile = null;        try {            osw.beginTransaction();                        Map idMap = getIdMap(osw.getObjectStore());                        Iterator fileSetIter = getFileSets().iterator();                        while (fileSetIter.hasNext()) {                FileSet fileSet = (FileSet) fileSetIter.next();                                DirectoryScanner ds = fileSet.getDirectoryScanner(getProject());                String[] files = ds.getIncludedFiles();                for (int i = 0; i < files.length; i++) {                    currentFile = new File(ds.getBasedir(), files[i]);                    System.err .println("Processing file: " + currentFile.getName());                                        Iterator tsvIter =                        TextFileUtil.parseTabDelimitedReader(new FileReader(currentFile));                                        while (tsvIter.hasNext()) {                        String[] thisRow = (String[]) tsvIter.next();                        String keyColumnValue = thisRow[dfc.getKeyColumnNumber()];                        Integer objectId = (Integer) idMap.get(keyColumnValue);                        if (objectId == null) {                            LOG.warn("cannot find object for ID: " + keyColumnValue                                     + " read from " + currentFile);                            continue;                        }                        InterMineObject o =                             osw.getObjectStore().getObjectById(objectId);                                                for (int columnIndex = 0; columnIndex < thisRow.length; columnIndex++) {                            FieldDescriptor columnFD =                                (FieldDescriptor) dfc.getColumnFieldDescriptors().get(columnIndex);                                                        if (columnFD == null) {                                // ignore - no configuration for this column                            } else {                                TypeUtil.setFieldValue(o, columnFD.getName(), thisRow[columnIndex]);                                osw.store(o);                            }                        }                    }                }            }            osw.commitTransaction();        } catch (NoSuchElementException e) {            throw new BuildException("no fasta sequences in: " + currentFile, e);        } catch (FileNotFoundException e) {            throw new BuildException("problem reading file - file not found: " + currentFile, e);        } catch (IOException e) {            throw new BuildException("error while reading from: " + currentFile, e);        } catch (ObjectStoreException e) {            throw new BuildException("error fetching object from ObjectStore: ", e);        }    }