|
18 | 18 | */ |
19 | 19 | package org.jooby.filewatcher; |
20 | 20 |
|
| 21 | +import java.nio.file.FileSystems; |
| 22 | +import java.nio.file.Path; |
| 23 | +import java.nio.file.Paths; |
| 24 | +import java.nio.file.StandardWatchEventKinds; |
| 25 | +import java.nio.file.WatchService; |
| 26 | +import java.util.ArrayList; |
| 27 | +import java.util.List; |
| 28 | +import java.util.Map; |
| 29 | +import java.util.function.Consumer; |
| 30 | +import java.util.function.Function; |
| 31 | + |
| 32 | +import org.jooby.Env; |
| 33 | +import org.jooby.Jooby.Module; |
| 34 | +import org.slf4j.Logger; |
| 35 | +import org.slf4j.LoggerFactory; |
| 36 | + |
21 | 37 | import com.google.common.collect.ImmutableList; |
22 | 38 | import com.google.inject.Binder; |
23 | 39 | import com.google.inject.multibindings.Multibinder; |
24 | 40 | import com.typesafe.config.Config; |
25 | 41 | import com.typesafe.config.ConfigFactory; |
| 42 | + |
26 | 43 | import javaslang.CheckedFunction1; |
27 | 44 | import javaslang.CheckedFunction2; |
28 | 45 | import javaslang.control.Try.CheckedConsumer; |
29 | | -import org.jooby.Env; |
30 | | -import org.jooby.Jooby.Module; |
31 | | -import org.slf4j.Logger; |
32 | | -import org.slf4j.LoggerFactory; |
33 | | - |
34 | | -import java.nio.file.*; |
35 | | -import java.util.ArrayList; |
36 | | -import java.util.List; |
37 | | -import java.util.Map; |
38 | | -import java.util.function.Consumer; |
39 | | -import java.util.function.Function; |
40 | 46 |
|
41 | 47 | /** |
42 | 48 | * <h1>file watcher</h1> |
@@ -350,7 +356,11 @@ public void configure(final Env env, final Config conf, final Binder binder) thr |
350 | 356 | paths.forEach(it -> log.info("Watching: {}", it)); |
351 | 357 | } |
352 | 358 |
|
353 | | - @SuppressWarnings({"unchecked", "rawtypes"}) |
| 359 | + protected boolean empty() { |
| 360 | + return bindings.isEmpty(); |
| 361 | + } |
| 362 | + |
| 363 | + @SuppressWarnings({"unchecked", "rawtypes" }) |
354 | 364 | private void paths(final ClassLoader loader, final Config conf, final String name, |
355 | 365 | final Consumer<FileEventOptions> callback) throws Throwable { |
356 | 366 | list(conf, name, value -> { |
|
0 commit comments