T
- Type of credential read by this instance.public abstract class AbstractCredentialReader<T> extends Object implements CredentialReader<T>
Modifier and Type | Field and Description |
---|---|
static String |
CLASSPATH_PREFIX
Prefix used to indicate a classpath resource.
|
static String |
FILE_PREFIX
Prefix used to indicate a file resource.
|
protected org.apache.commons.logging.Log |
logger
Log for this class.
|
Constructor and Description |
---|
AbstractCredentialReader() |
Modifier and Type | Method and Description |
---|---|
protected InputStream |
getBufferedInputStream(InputStream is)
Gets a buffered input stream from the given input stream.
|
abstract T |
read(InputStream is,
String... params)
Reads a credential object from an input stream.
|
T |
read(String path,
String... params)
Reads a credential object from a path.
|
public static final String CLASSPATH_PREFIX
public static final String FILE_PREFIX
protected final org.apache.commons.logging.Log logger
public T read(String path, String... params) throws IOException, GeneralSecurityException
read
in interface CredentialReader<T>
path
- Path from which to read credential.params
- Arbitrary string parameters, e.g. password, needed to read
the credential.IOException
- On IO errors.GeneralSecurityException
- On errors with the credential data.public abstract T read(InputStream is, String... params) throws IOException, GeneralSecurityException
read
in interface CredentialReader<T>
is
- Input stream from which to read credential.params
- Arbitrary string parameters, e.g. password, needed to read
the credential.IOException
- On IO errors.GeneralSecurityException
- On errors with the credential data.protected InputStream getBufferedInputStream(InputStream is)
is
- Input stream from which to create buffered instance.Copyright © 2016. All rights reserved.