TrueLicense Core 1.33

de.schlichtherle.license
Class AbstractKeyStoreParam

java.lang.Object
  extended by de.schlichtherle.license.AbstractKeyStoreParam
All Implemented Interfaces:
KeyStoreParam
Direct Known Subclasses:
DefaultKeyStoreParam

public abstract class AbstractKeyStoreParam
extends Object
implements KeyStoreParam

This is a convenience class implementing the KeyStoreParam.getStream() method.

Author:
Christian Schlichtherle

Field Summary
private  Class clazz
           
private  String resource
           
 
Constructor Summary
protected AbstractKeyStoreParam(Class clazz, String resource)
          Creates a new instance of AbstractKeyStoreParam which will look up the given resource using the class loader of the given class when calling getStream().
 
Method Summary
 boolean equals(Object object)
          Returns true if and only if these key store parameters seem to address the same key store entry as the given object.
 InputStream getStream()
          Looks up the resource provided to the constructor using the classloader provided to the constructor and returns it as an InputStream.
 int hashCode()
          Returns a hash code which is consistent with equals(Object).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.schlichtherle.license.KeyStoreParam
getAlias, getKeyPwd, getStorePwd
 

Field Detail

clazz

private final Class clazz

resource

private final String resource
Constructor Detail

AbstractKeyStoreParam

protected AbstractKeyStoreParam(Class clazz,
                                String resource)
Creates a new instance of AbstractKeyStoreParam which will look up the given resource using the class loader of the given class when calling getStream().

Parameters:
clazz - the class which refers to the class loader to use.
resource - the resource to look up.
Method Detail

equals

public final boolean equals(Object object)
Returns true if and only if these key store parameters seem to address the same key store entry as the given object.

Overrides:
equals in class Object
Parameters:
object - the object to compare.
Returns:
true if and only if these key store parameters seem to address the same key store entry as the given object.

getStream

public InputStream getStream()
                      throws IOException
Looks up the resource provided to the constructor using the classloader provided to the constructor and returns it as an InputStream.

Specified by:
getStream in interface KeyStoreParam
Returns:
An input stream for reading the keystore - null is never returned.
Throws:
IOException - If the key store cannot get opened.

hashCode

public final int hashCode()
Returns a hash code which is consistent with equals(Object).

Overrides:
hashCode in class Object
Returns:
A hash code which is consistent with equals(Object).

TrueLicense Core 1.33

Copyright © 2005-2015 Schlichtherle IT Services. All Rights Reserved.