try {
FileFieldDef f; StringBuffer sb = new StringBuffer();   for (int x = 0; x < ffd.size(); x++) { f = (FileFieldDef)ffd.get(x); if (f.isWriteField()) { sb.append(f.getFieldName() + delimiter); } }
   public void writeHeader(String fileName, String host,                                 ArrayList ffd, char decChar) {      try {         FileFieldDef f;         StringBuffer sb = new StringBuffer();         //  loop through each of the fields and write out the field name for         //    each selected field         for (int x = 0; x < ffd.size(); x++) {            f = (FileFieldDef)ffd.get(x);            if (f.isWriteField()) {               sb.append(f.getFieldName() + delimiter);            }         }         fout.write (sb.toString().getBytes());         fout.write ('\n');      }      catch (IOException ioe) {//         printFTPInfo(" error writing header " + ioe.getMessage());      }   }