Package io.github.erdos.stencil.impl
Class DirWatcherTemplateFactory
java.lang.Object
io.github.erdos.stencil.impl.DirWatcherTemplateFactory
- All Implemented Interfaces:
TemplateFactory
Watches file system and automatically loads template files on file changes.
-
Constructor Summary
ConstructorsConstructorDescriptionDirWatcherTemplateFactory
(File templatesDirectory, TemplateFactory factory) Default ctor. -
Method Summary
Modifier and TypeMethodDescriptionprepareTemplateFile
(File inputTemplateFile, PrepareOptions options) Preprocesses a raw template file.void
start()
Starts directory watcher and tries to load all files.void
stop()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.erdos.stencil.TemplateFactory
prepareTemplateFile
-
Constructor Details
-
DirWatcherTemplateFactory
Default ctor.- Parameters:
templatesDirectory
- not null absolute path directoryfactory
- wrapped factory
-
-
Method Details
-
getTemplatesDirectory
-
start
Starts directory watcher and tries to load all files.- Throws:
IOException
- on file system errorsIllegalStateException
- if already started
-
stop
public void stop() -
prepareTemplateFile
Description copied from interface:TemplateFactory
Preprocesses a raw template file.- Specified by:
prepareTemplateFile
in interfaceTemplateFactory
- Parameters:
inputTemplateFile
- raw template file of known type.options
- template preparation options.- Returns:
- preprocessed template file
-