File dir = new File(Configuration.getExistHome(), directory);
    private void storeFiles(DBBroker broker, Txn transaction, Collection test2) throws FileNotFoundException, EXistException, PermissionDeniedException, LockException, TriggerException {        File files[] = dir.listFiles();        assertNotNull("Check directory '"+dir.getAbsolutePath()+"'.",files);                File f;                // store some documents.        for (int j = 0; j < 10; j++) {            for (int i = 0; i < files.length; i++) {                f = files[i];                assertNotNull(f);                if (f.isFile()) {                    XmldbURI uri = test2.getURI().append(j + "_" + f.getName());                    InputStream is = new FileInputStream(f);                    BinaryDocument doc =                         test2.addBinaryResource(transaction, broker, uri, is, MimeType.BINARY_TYPE.getName(),                                 (int) f.length(), new Date(), new Date());                    assertNotNull(doc);                }            }        }    }