org.apache.commons.vfs.util
Class UserAuthenticatorUtils

java.lang.Object
  extended by org.apache.commons.vfs.util.UserAuthenticatorUtils

public final class UserAuthenticatorUtils
extends java.lang.Object

Some helper methods used for authentication.

Author:
Commons VFS team

Method Summary
static UserAuthenticationData authenticate(FileSystemOptions opts, UserAuthenticationData.Type[] authenticatorTypes)
          if there is a authenticator the authentication will take place, else null will be reutrned.
static UserAuthenticationData authenticate(UserAuthenticator auth, UserAuthenticationData.Type[] authenticatorTypes)
          if there is a authenticator the authentication will take place, else null will be reutrned.
static void cleanup(UserAuthenticationData authData)
          cleanup the data in the UerAuthenticationData (null safe).
static char[] getData(UserAuthenticationData data, UserAuthenticationData.Type type, char[] overriddenValue)
          gets data of given type from the UserAuthenticationData or null if there is no data or data of this type available.
static char[] toChar(java.lang.String string)
          Converts a string to a char array (null safe).
static java.lang.String toString(char[] data)
          converts the given data to a string (null safe).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getData

public static char[] getData(UserAuthenticationData data,
                             UserAuthenticationData.Type type,
                             char[] overriddenValue)
gets data of given type from the UserAuthenticationData or null if there is no data or data of this type available.

Parameters:
data - The UserAuthenticationData.
type - The type of the element to retrieve.
overriddenValue - The default value.
Returns:
The data of the given type as a character array or null if the data is not available.

authenticate

public static UserAuthenticationData authenticate(FileSystemOptions opts,
                                                  UserAuthenticationData.Type[] authenticatorTypes)
if there is a authenticator the authentication will take place, else null will be reutrned.

Parameters:
opts - The FileSystemOptions.
authenticatorTypes - An array of types describing the data to be retrieved.
Returns:
A UserAuthenticationData object containing the data requested.

authenticate

public static UserAuthenticationData authenticate(UserAuthenticator auth,
                                                  UserAuthenticationData.Type[] authenticatorTypes)
if there is a authenticator the authentication will take place, else null will be reutrned.

Parameters:
auth - The UserAuthenticator.
authenticatorTypes - An array of types describing the data to be retrieved.
Returns:
A UserAuthenticationData object containing the data requested.

toChar

public static char[] toChar(java.lang.String string)
Converts a string to a char array (null safe).

Parameters:
string - The String to convert.
Returns:
The character array.

cleanup

public static void cleanup(UserAuthenticationData authData)
cleanup the data in the UerAuthenticationData (null safe).

Parameters:
authData - The UserAuthenticationDAta.

toString

public static java.lang.String toString(char[] data)
converts the given data to a string (null safe).

Parameters:
data - A character array containing the data to convert to a String.
Returns:
The String.


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.