Package rs.baselib.security
Class TextFileAuthorizationCallback
java.lang.Object
rs.baselib.security.AbstractAuthorizationCallback
rs.baselib.security.TextFileAuthorizationCallback
- All Implemented Interfaces:
IConfigurable,AuthorizationCallback
public class TextFileAuthorizationCallback extends AbstractAuthorizationCallback implements IConfigurable
Implements authorization information retrieval from a plain text file.
Configuration:
<AuthorizationCallback class="rs.baselib.security.TextFileAuthorizationCallback">
<!-- The text file name. -->
<File>/path/to/file.txt</File>
</AuthorizationCallback>
The text file itself shall look like this:
your-login:your-password
- Author:
- Ralph Schuster
-
Constructor Summary
Constructors Constructor Description TextFileAuthorizationCallback()Default Constructor. -
Method Summary
Modifier and Type Method Description voidconfigure(java.io.File file)Configures the callback from the text file.voidconfigure(java.lang.String file)Configures the callback from the text file.voidconfigure(Configuration config)Configures the callback.Methods inherited from class rs.baselib.security.AbstractAuthorizationCallback
getName, getPassword, setName, setPassword
-
Constructor Details
-
TextFileAuthorizationCallback
public TextFileAuthorizationCallback()Default Constructor.
-
-
Method Details
-
configure
Configures the callback. Configuration takes place from a plain text filewhose path is contained within element <File>. The text file itself must contain login and password as its only content. Syntax is <login>:<password>- Specified by:
configurein interfaceIConfigurable- Parameters:
config- - configuration object- Throws:
ConfigurationException- - when configuration fails
-
configure
Configures the callback from the text file.- Parameters:
file- filename- Throws:
ConfigurationException- when object cannot be configured from file
-
configure
Configures the callback from the text file.- Parameters:
file- file- Throws:
ConfigurationException- when object cannot be configured from file
-