Class PropertiesFileAuthorizationCallback

All Implemented Interfaces:
IConfigurable, AuthorizationCallback

public class PropertiesFileAuthorizationCallback
extends DefaultAuthorizationCallback
Implements authorization information retrieval from a properties file.

Configuration:

 <AuthorizationCallback class="rs.baselib.security.PropertiesFileAuthorizationCallback">
 
    <!-- The properties file name. -->
    <File>/path/to/file.properties</File>
    
 </AuthorizationCallback>
 

The properties file itself shall look like this:

 login=your-login
 password=your-password
 
Author:
Ralph Schuster
  • Constructor Summary

    Constructors 
    Constructor Description
    PropertiesFileAuthorizationCallback()
    Default Constructor.
  • Method Summary

    Modifier and Type Method Description
    void configure​(java.io.File file)
    Configures the callback from the properties file.
    void configure​(java.lang.String file)
    Configures the callback from the properties file.
    void configure​(org.apache.commons.configuration.Configuration config)
    Configures the callback.

    Methods inherited from class rs.baselib.security.AbstractAuthorizationCallback

    getName, getPassword, setName, setPassword

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • configure

      public void configure​(org.apache.commons.configuration.Configuration config) throws org.apache.commons.configuration.ConfigurationException
      Configures the callback. Configuration takes place from a Properties file whose path is contained within element <File>. The properties file itself must contain values for "login" and "password" properties.
      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class DefaultAuthorizationCallback
      Parameters:
      config - - configuration object
      Throws:
      org.apache.commons.configuration.ConfigurationException - - when configuration fails
    • configure

      public void configure​(java.lang.String file) throws org.apache.commons.configuration.ConfigurationException
      Configures the callback from the properties file.
      Parameters:
      file - filename
      Throws:
      org.apache.commons.configuration.ConfigurationException - when configuration fails
    • configure

      public void configure​(java.io.File file) throws org.apache.commons.configuration.ConfigurationException
      Configures the callback from the properties file.
      Parameters:
      file - file
      Throws:
      org.apache.commons.configuration.ConfigurationException - when configuration fails