PasswordParameterImplpublic class PasswordParameterImpl extends ParameterImpl implements org.gudy.azureus2.plugins.ui.config.PasswordParameter
Fields Summary |
---|
protected byte[] | defaultValue | protected int | encoding_type |
Constructors Summary |
---|
public PasswordParameterImpl(org.gudy.azureus2.plugins.PluginConfig config, String key, String label, int _encoding_type, byte[] _defaultValue)
super(config,key, label);
if ( _defaultValue == null ){
defaultValue = new byte[0];
}else{
defaultValue = _defaultValue;
if ( _encoding_type == ET_SHA1 ){
SHA1Hasher hasher = new SHA1Hasher();
defaultValue = hasher.calculateHash(defaultValue);
}else if ( _encoding_type == ET_MD5 ){
try{
defaultValue = MessageDigest.getInstance( "md5").digest( defaultValue );
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
}
COConfigurationManager.setByteDefault( getKey(), defaultValue );
encoding_type = _encoding_type;
|
Methods Summary |
---|
public byte[] | getDefaultValue()
return defaultValue;
| public int | getEncodingType()
return( encoding_type );
| public byte[] | getValue()
return( config.getByteParameter( getKey(), getDefaultValue()));
|
|