Package org.apache.commons.vfs2.util
Class UserAuthenticatorUtils
- java.lang.Object
-
- org.apache.commons.vfs2.util.UserAuthenticatorUtils
-
public final class UserAuthenticatorUtils extends java.lang.Object
Helps with authentication.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static UserAuthenticationData
authenticate(FileSystemOptions opts, UserAuthenticationData.Type[] authenticatorTypes)
Authenticates if there is an authenticator, else returns null.static UserAuthenticationData
authenticate(UserAuthenticator auth, UserAuthenticationData.Type[] authenticatorTypes)
Authenticates if there is an authenticator, else returns null.static void
cleanup(UserAuthenticationData authData)
Cleans up 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).
-
-
-
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)
Authenticates if there is an authenticator, else returns null.- 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)
Authenticates if there is an authenticator, else returns null.- 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)
Cleans up 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.
-
-