@Test public void testAcceptWithoutDRLFile() { doReturn("cheese.txt").when(path).getFileName(); assertFalse(observer.accept(path)); }
@Override public boolean accept(final Path path) { try { final String fileName = path.getFileName(); if (!fileName.endsWith("." + EXTENSION)) { return false; } final String drl = ioService.readAllString(convert(path)); return PATTERN.matcher(drl.toLowerCase()).matches(); } catch (NoSuchFileException e) { return false; } }
ObservableDRLFile implements ResourceChangeObservableFile { @Override public boolean accept(final Path path) { try { final String fileName = path.getFileName(); if (!fileName.endsWith("." + EXTENSION)) { return false; } final String drl = ioService.readAllString(convert(path)); return PATTERN.matcher(drl.toLowerCase()).matches(); } catch (NoSuchFileException e) { return false; } } }
ObservableDRLFile implements ResourceChangeObservableFile { @Override public boolean accept(final Path path) { try { final String fileName = path.getFileName(); if (!fileName.endsWith("." + EXTENSION)) { return false; } final String drl = ioService.readAllString(convert(path)); return PATTERN.matcher(drl.toLowerCase()).matches(); } catch (NoSuchFileException e) { return false; } } ObservableDRLFile(); @Inject  ObservableDRLFile(final @Named("ioStrategy") IOService ioService); }
ObservableDRLFile implements ResourceChangeObservableFile { @Override public boolean accept(final Path path) { try { final String fileName = path.getFileName(); if (!fileName.endsWith("." + EXTENSION)) { return false; } final String drl = ioService.readAllString(convert(path)); return PATTERN.matcher(drl.toLowerCase()).matches(); } catch (NoSuchFileException e) { return false; } } ObservableDRLFile(); @Inject  ObservableDRLFile(final @Named("ioStrategy") IOService ioService); @Override boolean accept(final Path path); }
ObservableDRLFile implements ResourceChangeObservableFile { @Override public boolean accept(final Path path) { try { final String fileName = path.getFileName(); if (!fileName.endsWith("." + EXTENSION)) { return false; } final String drl = ioService.readAllString(convert(path)); return PATTERN.matcher(drl.toLowerCase()).matches(); } catch (NoSuchFileException e) { return false; } } ObservableDRLFile(); @Inject  ObservableDRLFile(final @Named("ioStrategy") IOService ioService); @Override boolean accept(final Path path);  }