Package com.tangosol.net
Class URLPasswordProvider
- java.lang.Object
-
- com.tangosol.net.InputStreamPasswordProvider
-
- com.tangosol.net.URLPasswordProvider
-
- All Implemented Interfaces:
PasswordProvider
public class URLPasswordProvider extends InputStreamPasswordProvider
APasswordProvider
that reads the contents of a URL 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
Constructors Constructor Description URLPasswordProvider(String sURL)
Create aURLPasswordProvider
that reads a password from the specified URL.URLPasswordProvider(String sURL, boolean fFirstLineOnly)
Create aURLPasswordProvider
that reads a password from the specified URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InputStream
getInputStream()
Returns theInputStream
to read the password from.String
getURL()
Returns the URL to read the password from.-
Methods inherited from class com.tangosol.net.InputStreamPasswordProvider
get, isFirstLineOnly
-
-
-
-
Constructor Detail
-
URLPasswordProvider
public URLPasswordProvider(String sURL)
Create aURLPasswordProvider
that reads a password from the specified URL.If the
URL
returns no data, anull
password will be returned.If the
URL
is invalid, does not exist, or returns an error when opening theInputStreamPasswordProvider.get()
method will throw an exception.- Parameters:
sURL
- the URL to read the password from
-
URLPasswordProvider
public URLPasswordProvider(String sURL, boolean fFirstLineOnly)
Create aURLPasswordProvider
that reads a password from the specified URL.If the
URL
is invalid, does not exist, or returns an error when opening theInputStreamPasswordProvider.get()
method will throw an exception.- Parameters:
sURL
- the URL to read the password fromfFirstLineOnly
-true
to only treat the first line of the data returned from theURL
as the password
-
-
Method Detail
-
getURL
public String getURL()
Returns the URL to read the password from.- Returns:
- the URL to read the password from
-
getInputStream
protected InputStream getInputStream() throws IOException
Description copied from class:InputStreamPasswordProvider
Returns theInputStream
to read the password from.- Specified by:
getInputStream
in classInputStreamPasswordProvider
- Returns:
- the
InputStream
to read the password from - Throws:
IOException
- if there is an error opening theInputStream
-
-