Package org.frankframework.larva
Class FileListener
java.lang.Object
org.frankframework.larva.FileListener
- All Implemented Interfaces:
AutoCloseable,IConfigurable
File listener for the Test Tool.
- Author:
- Jaco de Groot
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidConfigure this component.Read the message from the specified file.voidsetDirectory(String directory) Set the directory to read the file from.voidsetFilename(String filename) Set the filename of the file to read the message from.voidsetFilename2(String filename2) When used, filename and filename2 are binary compared (returns 'true' or 'false' instead of the file content).voidsetInterval(long interval) Set the interval time in milliseconds between checks for creation of the file.voidsetTimeout(long timeout) Set the timeout in milliseconds waiting for creation of the file.voidsetWaitBeforeRead(long waitBeforeRead) Set the time to wait in milliseconds before starting to read the file.voidsetWildcard(String wildcard) Set the wildcard to find the file to read the message from.
-
Constructor Details
-
FileListener
public FileListener()
-
-
Method Details
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Throws:
ConfigurationException- in case it was not able to configure the component.
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
ConfigurationException
-
getMessage
Read the message from the specified file. If the file doesn't exist, this methods waits a specified time before it attempts to read the file.- Returns:
- The message read from the specified file
- Throws:
TimeoutExceptionListenerException
-
setFilename
Set the filename of the file to read the message from. -
setFilename2
When used, filename and filename2 are binary compared (returns 'true' or 'false' instead of the file content). -
setDirectory
Set the directory to read the file from. -
setWildcard
Set the wildcard to find the file to read the message from.- Parameters:
wildcard- to search for files in a directory
-
setWaitBeforeRead
public void setWaitBeforeRead(long waitBeforeRead) Set the time to wait in milliseconds before starting to read the file. Set to -1 (default) to start reading the file directly. -
setTimeout
public void setTimeout(long timeout) Set the timeout in milliseconds waiting for creation of the file. -
setInterval
public void setInterval(long interval) Set the interval time in milliseconds between checks for creation of the file.
-