public class DirectoryWatcher extends Object
| Constructor and Description |
|---|
DirectoryWatcher() |
| Modifier and Type | Method and Description |
|---|---|
static ExecutorService |
watchDirectoryForNewFiles(String directoryPathStr,
Consumer<org.apache.commons.vfs2.FileObject> eventFunction)
Watches a given directory for new files being added to it and when they are executes the provided function.
|
public static ExecutorService watchDirectoryForNewFiles(String directoryPathStr, Consumer<org.apache.commons.vfs2.FileObject> eventFunction) throws IOException
directoryPathStr - The directory to watch.eventFunction - Function to execute when new files added to the directory. Path of new file will be passed to function.IOException - If unable to resolve the filepath provided.Copyright © 2015–2017 Hewlett Packard Enterprise Development LP. All rights reserved.