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
APasswordProviderthat 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 aURLPasswordProviderthat reads a password from the specified URL.URLPasswordProvider(String sURL, boolean fFirstLineOnly)Create aURLPasswordProviderthat reads a password from the specified URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InputStreamgetInputStream()Returns theInputStreamto read the password from.StringgetURL()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 aURLPasswordProviderthat reads a password from the specified URL.If the
URLreturns no data, anullpassword will be returned.If the
URLis 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 aURLPasswordProviderthat reads a password from the specified URL.If the
URLis 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-trueto only treat the first line of the data returned from theURLas 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:InputStreamPasswordProviderReturns theInputStreamto read the password from.- Specified by:
getInputStreamin classInputStreamPasswordProvider- Returns:
- the
InputStreamto read the password from - Throws:
IOException- if there is an error opening theInputStream
-
-