*/
@Override
public void deleteFile(String name) throws IOException {
ensureOpen();
FileDAO fileDAO = new FileDAO();
FileSegmentDAO fileSegmentDAO = new FileSegmentDAO();
File file = fileDAO.findByDirectoryAndName(getDirectory(), name);
if (file != null) {
List<FileSegment> segments = fileSegmentDAO.listByFile(file);
for (FileSegment segment : segments) {
fileSegmentDAO.delete(segment);
}
fileDAO.delete(file);
LOG.fine("Deleted search index file " + name + " from directory " + getDirectory().getName());
} else {
throw new FileNotFoundException();
}
}