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 TypeMethodDescriptionvoid
close()
void
Configure this component.Read the message from the specified file.void
setDirectory
(String directory) Set the directory to read the file from.void
setFilename
(String filename) Set the filename of the file to read the message from.void
setFilename2
(String filename2) When used, filename and filename2 are binary compared (returns 'true' or 'false' instead of the file content).void
setInterval
(long interval) Set the interval time in milliseconds between checks for creation of the file.void
setTimeout
(long timeout) Set the timeout in milliseconds waiting for creation of the file.void
setWaitBeforeRead
(long waitBeforeRead) Set the time to wait in milliseconds before starting to read the file.void
setWildcard
(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:IConfigurable
Configure 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:
configure
in interfaceIConfigurable
- Throws:
ConfigurationException
- in case it was not able to configure the component.
-
close
- Specified by:
close
in 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:
TimeoutException
ListenerException
-
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.
-