org.productivity.java.habitat4j.junit.examples.decoder
Class SampleBase64EncoderDecoder

java.lang.Object
  extended by org.productivity.java.habitat4j.junit.examples.decoder.SampleBase64EncoderDecoder
All Implemented Interfaces:
DecoderIF

public class SampleBase64EncoderDecoder
extends java.lang.Object
implements DecoderIF

This sample BASE64 encoder/decoder class implements a simple interface to the sun.misc.BASE64Decoder & sun.misc.BASE64Encoder.

## LICENSE INFORMATION ##

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Version:
$Id: SampleBase64EncoderDecoder.html,v 1.2 2008/11/24 15:15:26 cvs Exp $
Author:
Justin Yunke <habitat4j@productivity.org>

Constructor Summary
SampleBase64EncoderDecoder()
           
 
Method Summary
 java.lang.String decode(java.lang.String propertyListName, java.lang.String name, java.lang.String value)
           
static java.lang.String doBase64(java.lang.String value, boolean encode)
           
 void initialize(java.lang.String appName, java.lang.String propertyListName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleBase64EncoderDecoder

public SampleBase64EncoderDecoder()
Method Detail

initialize

public void initialize(java.lang.String appName,
                       java.lang.String propertyListName)
Specified by:
initialize in interface DecoderIF
Parameters:
appName - - the name of the calling application (use is optional)
propertyListName - - the name of the PropertyList that's calling this method (use is optional)

decode

public java.lang.String decode(java.lang.String propertyListName,
                               java.lang.String name,
                               java.lang.String value)
Specified by:
decode in interface DecoderIF
Parameters:
propertyListName - - the name of the PropertyList that's calling this method (use is optional)
name - - the Property name (use is optional)
value - - the String value to decode
Returns:
Returns a decoded String from parameter "value"

doBase64

public static java.lang.String doBase64(java.lang.String value,
                                        boolean encode)