Package com.tangosol.net
Class InputStreamPasswordProvider
- java.lang.Object
-
- com.tangosol.net.InputStreamPasswordProvider
-
- All Implemented Interfaces:
PasswordProvider
- Direct Known Subclasses:
URLPasswordProvider
public abstract class InputStreamPasswordProvider extends Object implements PasswordProvider
A base class forPasswordProviderimplementations that read the contents of anInputStreamto 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
Constructors Modifier Constructor Description protectedInputStreamPasswordProvider()Create anInputStreamPasswordProvider.protectedInputStreamPasswordProvider(boolean fFirstLineOnly)Create anInputStreamPasswordProvider.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description char[]get()Returns the password to be used in clear format.protected abstract InputStreamgetInputStream()Returns theInputStreamto read the password from.booleanisFirstLineOnly()Returnstrueto only treat the first line of the data returned by theInputStreamas the password.
-
-
-
Constructor Detail
-
InputStreamPasswordProvider
protected InputStreamPasswordProvider()
Create anInputStreamPasswordProvider.
-
InputStreamPasswordProvider
protected InputStreamPasswordProvider(boolean fFirstLineOnly)
Create anInputStreamPasswordProvider.- Parameters:
fFirstLineOnly-trueto only treat the first line of the data returned by theInputStreamas the password
-
-
Method Detail
-
isFirstLineOnly
public boolean isFirstLineOnly()
Returnstrueto only treat the first line of the data returned by theInputStreamas the password.- Returns:
trueto only treat the first line of the data returned by theInputStreamas the password
-
get
public char[] get()
Description copied from interface:PasswordProviderReturns 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:
getin interfacePasswordProvider- Returns:
- password as char[]
-
getInputStream
protected abstract InputStream getInputStream() throws IOException
Returns theInputStreamto read the password from.- Returns:
- the
InputStreamto read the password from - Throws:
IOException- if there is an error opening theInputStream
-
-