Package com.tangosol.net
Class InputStreamPasswordProvider
java.lang.Object
com.tangosol.net.InputStreamPasswordProvider
- All Implemented Interfaces:
PasswordProvider
- Direct Known Subclasses:
URLPasswordProvider
A base class for
PasswordProvider
implementations that read the
contents of an InputStream
to obtain a password.- Since:
- 22.06
- Author:
- Jonathan Knight 2020.01.25
-
Field Summary
Fields inherited from interface com.tangosol.net.PasswordProvider
NullImplementation
-
Constructor Summary
ModifierConstructorDescriptionprotected
Create anInputStreamPasswordProvider
.protected
InputStreamPasswordProvider
(boolean fFirstLineOnly) Create anInputStreamPasswordProvider
. -
Method Summary
Modifier and TypeMethodDescriptionchar[]
get()
Returns the password to be used in clear format.protected abstract InputStream
Returns theInputStream
to read the password from.boolean
Returnstrue
to only treat the first line of the data returned by theInputStream
as the password.
-
Constructor Details
-
InputStreamPasswordProvider
protected InputStreamPasswordProvider()Create anInputStreamPasswordProvider
. -
InputStreamPasswordProvider
protected InputStreamPasswordProvider(boolean fFirstLineOnly) Create anInputStreamPasswordProvider
.- Parameters:
fFirstLineOnly
-true
to only treat the first line of the data returned by theInputStream
as the password
-
-
Method Details
-
isFirstLineOnly
public boolean isFirstLineOnly()Returnstrue
to only treat the first line of the data returned by theInputStream
as the password.- Returns:
true
to only treat the first line of the data returned by theInputStream
as the password
-
get
public char[] get()Description copied from interface:PasswordProvider
Returns the password to be used in clear format. The char[] returned from the get() method is not retained by the provider, and it is expected that the consumer zero's out the array once it is done with the password.- Specified by:
get
in interfacePasswordProvider
- Returns:
- password as char[]
-
getInputStream
Returns theInputStream
to read the password from.- Returns:
- the
InputStream
to read the password from - Throws:
IOException
- if there is an error opening theInputStream
-