private void createDBFFile(File dbfFile,boolean destroy) throws DBFException, IOException {
  if (destroy == true) {
    if (dbfFile.exists()) {
      try {
        dbfFile.delete();
      }
 catch (      Exception e) {
      }
    }
  }
  try (RandomAccessFile raf=new RandomAccessFile(dbfFile,"rw")){
    if (dbfFile.length() == 0) {
      writeHeader(raf);
    }
 else {
      readHeader();
    }
  }
 catch (  FileNotFoundException e) {
    throw new DBFException("Specified file is not found. " + e.getMessage());
  }
}

private void createDBFFile ( File dbfFile , boolean destroy ) throws DBFException , IOException { if ( destroy == true ) { if ( dbfFile . exists ( ) ) { try { dbfFile . delete ( ) ; } catch ( Exception e ) { } } } try ( RandomAccessFile raf = new RandomAccessFile ( dbfFile , "rw" ) ) { if ( dbfFile . length ( ) == 0 ) { writeHeader ( raf ) ; } else { readHeader ( ) ; } } catch ( FileNotFoundException e ) { throw new DBFException ( "Specified file is not found. " + e . getMessage ( ) ) ; } }
verifies the existence of or creates a valid dbf file on disk which can then have fields and records added or removed .
