public void dropIndex(String collectionName) throws PermissionDeniedException {
public void dropIndex(Collection collection) throws PermissionDeniedException {
	public void dropIndex(String collectionName) throws PermissionDeniedException {	    if (readOnly)			throw new PermissionDeniedException(DATABASE_IS_READ_ONLY);		try {			if (!collectionName.startsWith(ROOT_COLLECTION))				collectionName = ROOT_COLLECTION + collectionName;			Collection collection = getCollection(collectionName);			if (collection == null) {				LOG.debug("collection " + collectionName + " not found!");				return;			}			if (!collection.getPermissions().validate(user, Permission.WRITE))				throw new PermissionDeniedException("not allowed to remove collection");			((NativeTextEngine) textEngine).dropIndex(collection);			LOG.debug("removing elements ...");			short collectionId = collection.getId();			// remove elements index			Value ref = new ElementValue(collectionId);			IndexQuery query = new IndexQuery(IndexQuery.TRUNC_RIGHT, ref);			Lock lock = elementsDb.getLock();			try {				lock.acquire(Lock.WRITE_LOCK);				elementsDb.removeAll(query);			} catch (LockException e) {				LOG.error("could not acquire lock on elements index", e);			} finally {				lock.release();			}						for (Iterator i = collection.iterator(); i.hasNext();) {				final DocumentImpl doc = (DocumentImpl) i.next();				LOG.debug("dropping index for document " + doc.getFileName());				new DOMTransaction(this, domDb, Lock.WRITE_LOCK) {					public Object start() {						try {							Value ref = new NodeRef(doc.getDocId());							IndexQuery query =								new IndexQuery(IndexQuery.TRUNC_RIGHT, ref);							domDb.remove(query, null);							domDb.flush();						} catch (BTreeException e) {							LOG.warn("btree error while removing document", e);						} catch (DBException e) {							LOG.warn("db error while removing document", e);						} catch (IOException e) {							LOG.warn("io error while removing document", e);						} catch (TerminatedException e) {                            LOG.warn("method terminated", e);                        }						return null;					}				}				.run();			}		} catch (IOException ioe) {			LOG.warn(ioe);		} catch (BTreeException bte) {			LOG.warn(bte);		}	}