org.ldaptive.ssl
Class AbstractCredentialReader<T>

java.lang.Object
  extended by org.ldaptive.ssl.AbstractCredentialReader<T>
Type Parameters:
T - Type of credential read by this instance.
All Implemented Interfaces:
CredentialReader<T>
Direct Known Subclasses:
KeyStoreCredentialReader, PrivateKeyCredentialReader, X509CertificateCredentialReader, X509CertificatesCredentialReader

public abstract class AbstractCredentialReader<T>
extends Object
implements CredentialReader<T>

Base class for all credential readers. It provides support for loading files from resources on the classpath or a filepath. If a path is prefixed with the string "classpath:" it is interpreted as a classpath specification. If a path is prefixed with the string "file:" it is interpreted as a file path. Any other input throws IllegalArgumentException.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Field Summary
protected  org.slf4j.Logger logger
          Logger for this class.
 
Constructor Summary
AbstractCredentialReader()
           
 
Method Summary
protected  InputStream getBufferedInputStream(InputStream is)
          Gets a buffered input stream from the given input stream.
 T read(String path, String... params)
          Reads a credential object from a path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ldaptive.ssl.CredentialReader
read
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger for this class.

Constructor Detail

AbstractCredentialReader

public AbstractCredentialReader()
Method Detail

read

public T read(String path,
              String... params)
       throws IOException,
              GeneralSecurityException
Reads a credential object from a path.

Specified by:
read in interface CredentialReader<T>
Parameters:
path - from which to read credential.
params - Arbitrary string parameters, e.g. password, needed to read the credential.
Returns:
credential read from data at path.
Throws:
IOException - On IO errors.
GeneralSecurityException - On errors with the credential data.

getBufferedInputStream

protected InputStream getBufferedInputStream(InputStream is)
Gets a buffered input stream from the given input stream. If the given instance is already buffered, it is simply returned.

Parameters:
is - input stream from which to create buffered instance.
Returns:
buffered input stream. If the given instance is already buffered, it is simply returned.


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.