upload.setTotalSize(calculateFileSizes(files)); long totalSize= 0;
if (file.canRead()) { if (file.isDirectory()) { if (recurseDirs) { filesCount= 0; long start= System.currentTimeMillis(); boolean result= findRecursive(current, file, path); messageln( "storing " + filesCount + " files took " + ((System.currentTimeMillis() - start) / 1000) + "sec."); return result; } else files= file.listFiles(new XMLFilenameFilter()); } else { files= new File[1]; files[0]= file; } } else files= DirectoryScanner.scanDir(fileName);  long start; long start0= System.currentTimeMillis(); long bytes= 0;
	protected final boolean parse(File[] files, UploadDialog upload)		throws XMLDBException {		XMLResource document;		String xml;		if (!upload.isVisible())			upload.setVisible(true);		if (current instanceof Observable) {			((Observable) current).addObserver(upload.getObserver());		}		upload.setTotalSize(calculateFileSizes(files));		long totalSize= 0;		for (int i= 0; i < files.length; i++) {			if (files[i].canRead()) {				if (files[i].isDirectory()) {					totalSize=						findRecursive(							current,							files[i],							path,							upload,							totalSize);				} else {					upload.reset();					upload.setCurrentDir(						files[i].getParentFile().getAbsolutePath());					upload.setCurrent(files[i].getName());					upload.setCurrentSize(files[i].length());					try {						document=							(XMLResource) current.createResource(								files[i].getName(),								"XMLResource");						document.setContent(files[i]);						current.storeResource(document);						totalSize += files[i].length();						upload.setStoredSize(totalSize);					} catch (XMLDBException e) {						upload.showMessage(							"could not parse file "								+ files[i].getAbsolutePath()								+ ": "								+ e.getMessage());					}				}			}		}		if(current instanceof Observable)			((Observable)current).deleteObservers();		upload.setVisible(false);		return true;	}