throw new EXistException("Collection " + collectionName + " not found");
throw new EXistException("Collection " + collectionName + " not found"); if (!replace) { DocumentImpl old = collection.getDocument(docName); if (old != null) throw new PermissionDeniedException( "Old document exists and overwrite is not allowed"); }
	public boolean parseLocal(		User user,		String localFile,		String docName,		boolean replace)		throws EXistException, PermissionDeniedException, SAXException, TriggerException {		File file = new File(localFile);		if (!file.canRead())			throw new EXistException("unable to read file " + localFile);		DBBroker broker = null;		DocumentImpl doc = null;		try {			broker = brokerPool.get(user);			int p = docName.lastIndexOf('/');			if (p < 0 || p == docName.length() - 1)				throw new EXistException("Illegal document path");			String collectionName = docName.substring(0, p);			docName = docName.substring(p + 1);			Collection collection = broker.getCollection(collectionName);			if (collection == null)				throw new EXistException("Collection " + collectionName + " not found");			String uri = file.toURI().toASCIIString();			collection.addDocument(broker, docName, new InputSource(uri));		} finally {			brokerPool.release(broker);		}		file.delete();		return doc != null;	}