@Test public void testCreateFile() throws Exception { BaleenCollectionReader bcr = getCollectionReader(FolderReader.PARAM_FOLDERS, new String[] {inputDir.getPath()}); assertFalse(bcr.doHasNext()); File f = new File(inputDir, TEXT1_FILE); f.createNewFile(); Thread.sleep(TIMEOUT); assertTrue(bcr.doHasNext()); bcr.getNext(jCas.getCas()); assertFilesEquals(f.getPath(), getSource(jCas)); assertFalse(bcr.doHasNext()); bcr.close(); }
@Override public boolean doHasNext() throws IOException, CollectionException { WatchKey key; while ((key = watcher.poll()) != null) { for (WatchEvent<?> event : key.pollEvents()) { processEvent(key, event); getMonitor().meter("events").mark(); } key.reset(); } return !queue.isEmpty(); }
FolderReader extends BaleenCollectionReader { @Override public boolean doHasNext() throws IOException, CollectionException { WatchKey key; while ((key = watcher.poll()) != null) { for (WatchEvent<?> event : key.pollEvents()) { processEvent(key, event); getMonitor().meter("events").mark(); } key.reset(); } return !queue.isEmpty(); } }
FolderReader extends BaleenCollectionReader { @Override public boolean doHasNext() throws IOException, CollectionException { WatchKey key; while ((key = watcher.poll()) != null) { for (WatchEvent<?> event : key.pollEvents()) { processEvent(key, event); getMonitor().meter("events").mark(); } key.reset(); } return !queue.isEmpty(); }  }
FolderReader extends BaleenCollectionReader { @Override public boolean doHasNext() throws IOException, CollectionException { WatchKey key; while ((key = watcher.poll()) != null) { for (WatchEvent<?> event : key.pollEvents()) { processEvent(key, event); getMonitor().meter("events").mark(); } key.reset(); } return !queue.isEmpty(); }  @Override void doInitialize(UimaContext context); @Override void doGetNext(JCas jCas); @Override void doClose(); @Override boolean doHasNext(); }
FolderReader extends BaleenCollectionReader { @Override public boolean doHasNext() throws IOException, CollectionException { WatchKey key; while ((key = watcher.poll()) != null) { for (WatchEvent<?> event : key.pollEvents()) { processEvent(key, event); getMonitor().meter("events").mark(); } key.reset(); } return !queue.isEmpty(); }  @Override void doInitialize(UimaContext context); @Override void doGetNext(JCas jCas); @Override void doClose(); @Override boolean doHasNext(); static final String PARAM_FOLDERS; static final String PARAM_REPROCESS_ON_MODIFY; static final String PARAM_RECURSIVE; static final String PARAM_ACCEPTED_PATTERNS; }