XMLResource document;
Resource document;
	private final boolean findRecursive(		Collection collection,		File dir,		String base) {		File temp[]= dir.listFiles();		Collection c;		XMLResource document;		CollectionManagementService mgtService;		String next;		for (int i= 0; i < temp.length; i++) {			next= base + '/' + temp[i].getName();			try {				if (temp[i].isDirectory()) {					messageln(						"entering directory " + temp[i].getAbsolutePath());					c= collection.getChildCollection(temp[i].getName());					if (c == null) {						mgtService=							(								CollectionManagementService) collection									.getService(								"CollectionManagementService",								"1.0");						c= mgtService.createCollection(temp[i].getName());					}					if (c instanceof Observable && verbose) {						ProgressObserver observer= new ProgressObserver();						((Observable) c).addObserver(observer);					}					findRecursive(c, temp[i], next);				} else {					long start1= System.currentTimeMillis();					message(						"storing document "							+ temp[i].getName()							+ " ("							+ i							+ " of "							+ temp.length							+ ") "							+ "...");					document=						(XMLResource) collection.createResource(							temp[i].getName(),							"XMLResource");					document.setContent(temp[i]);					collection.storeResource(document);					++filesCount;					messageln(						" "							+ temp[i].length()							+ " bytes in "							+ (System.currentTimeMillis() - start1)							+ "ms.");				}			} catch (XMLDBException e) {				messageln("could not parse file " + temp[i].getAbsolutePath());			}		}		return true;	}