T
- the object representation of the filepublic class DirectoryWatcher<T> extends Object implements Runnable, Closeable
Constructor and Description |
---|
DirectoryWatcher(File directory,
FileReloadCallback<T> loader)
Instantiates a new directory watcher.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Set<String> |
getBaseNamesWithExtension(String extension)
Gets the base names with extension.
|
T |
getContents(String fileName)
Gets the contents.
|
Set<String> |
getFileNames()
Gets the file names.
|
void |
join()
Join.
|
void |
run() |
void |
start()
Start.
|
void |
stop()
Stop.
|
public DirectoryWatcher(File directory, FileReloadCallback<T> loader) throws InterruptedException
directory
- the directoryloader
- the loaderInterruptedException
- the interrupted exceptionpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void join() throws InterruptedException
InterruptedException
- the interrupted exceptionpublic void start() throws InterruptedException
InterruptedException
- the interrupted exceptionpublic void stop() throws InterruptedException
InterruptedException
- the interrupted exceptionpublic Set<String> getBaseNamesWithExtension(String extension)
extension
- the extensionpublic T getContents(String fileName) throws FileNotFoundException
fileName
- the file nameFileNotFoundException
- the file not found exceptionCopyright © 2021. All rights reserved.