Merge branch '2.0.x'

This commit is contained in:
Andy Wilkinson
2018-07-02 16:26:27 +01:00
4 changed files with 29 additions and 19 deletions

View File

@@ -125,8 +125,7 @@ public class FileSystemWatcher {
*/
public void addSourceFolder(File folder) {
Assert.notNull(folder, "Folder must not be null");
Assert.isTrue(folder.isDirectory(),
"Folder '" + folder + "' must exist and must" + " be a directory");
Assert.isTrue(!folder.isFile(), "Folder '" + folder + "' must not be a file");
synchronized (this.monitor) {
checkNotStarted();
this.folders.put(folder, null);

View File

@@ -52,7 +52,7 @@ class FolderSnapshot {
*/
FolderSnapshot(File folder) {
Assert.notNull(folder, "Folder must not be null");
Assert.isTrue(folder.isDirectory(), "Folder must not be a file");
Assert.isTrue(!folder.isFile(), "Folder '" + folder + "' must not be a file");
this.folder = folder;
this.time = new Date();
Set<FileSnapshot> files = new LinkedHashSet<>();