}
File file = new File(col.getDirectory(), col.getCollectionName()
+ DbCollection.QNAMES_FILE_SUFFIX);
if(file.exists()) {
if(!file.delete()) {
throw new DbException("Could not delete symbol file: " + file.getAbsolutePath());
}
}
if(file.canWrite()) {
throw new IllegalStateException("Does not have write permission for "
+ file.getAbsolutePath());
}
try {
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
oos.writeObject(this);
oos.flush();
oos.close();
} catch (FileNotFoundException fe) {
throw new DbException(fe);
} catch (IOException ioe) {
throw new DbException(ioe);
}
}