com.konakartadmin.utils
Class CreatePassword

java.lang.Object
  extended by com.konakartadmin.utils.CreatePassword

public class CreatePassword
extends java.lang.Object

A utility for creating encypted property values for KonaKart


Field Summary
private static java.lang.String consoleEncoding
           
private static boolean debug
           
private static java.lang.String DEFAULT_CONSOLE_ENCODING
           
private static java.lang.String DEFAULT_FILE_ENCODING
           
static int FILE_DOES_NOT_EXIST
          File not found
private static java.lang.String fileEncoding
           
static org.apache.commons.logging.Log log
          logger
private static java.io.PrintStream outPrintStream
           
private static java.lang.String password
           
private static java.lang.String propertiesFilename
           
private static java.lang.String propertyKey
           
static int SUCCESSFUL_COMPLETION
          Success
static int UNSPECIFIED_ERROR
          Other Error
private static java.lang.String usage
           
 
Constructor Summary
CreatePassword()
           
 
Method Summary
static int createPassword(java.lang.String propertyFilename, java.lang.String key, java.lang.String pwd, java.lang.String fEncoding, java.lang.String cEncoding, boolean debugOn)
          Create an encrypted password for the specified key and write the results to the specified properties file
protected static java.lang.String getConsoleEncoding()
           
protected static java.lang.String getFileEncoding()
           
protected static java.lang.String getPassword()
           
protected static java.lang.String getPropertiesFilename()
           
protected static java.lang.String getPropertyKey()
           
private static java.lang.String getPropertyOnLine(java.lang.String line)
           
protected static boolean isDebug()
           
static void main(java.lang.String[] args)
           
private static void println(java.lang.String str)
           
static void processArgs(java.lang.String[] args)
          Process the Args to operate on KonaKart Messages
protected static void setConsoleEncoding(java.lang.String consoleEncoding)
           
protected static void setDebug(boolean debug)
           
protected static void setFileEncoding(java.lang.String fileEncoding)
           
protected static void setPassword(java.lang.String password)
           
protected static void setPropertiesFilename(java.lang.String propertiesFilename)
           
protected static void setPropertyKey(java.lang.String propertyKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static org.apache.commons.logging.Log log
logger


SUCCESSFUL_COMPLETION

public static final int SUCCESSFUL_COMPLETION
Success

See Also:
Constant Field Values

FILE_DOES_NOT_EXIST

public static final int FILE_DOES_NOT_EXIST
File not found

See Also:
Constant Field Values

UNSPECIFIED_ERROR

public static final int UNSPECIFIED_ERROR
Other Error

See Also:
Constant Field Values

DEFAULT_CONSOLE_ENCODING

private static final java.lang.String DEFAULT_CONSOLE_ENCODING

consoleEncoding

private static java.lang.String consoleEncoding

DEFAULT_FILE_ENCODING

private static final java.lang.String DEFAULT_FILE_ENCODING
See Also:
Constant Field Values

fileEncoding

private static java.lang.String fileEncoding

usage

private static final java.lang.String usage

propertiesFilename

private static java.lang.String propertiesFilename

propertyKey

private static java.lang.String propertyKey

password

private static java.lang.String password

debug

private static boolean debug

outPrintStream

private static java.io.PrintStream outPrintStream
Constructor Detail

CreatePassword

public CreatePassword()
Method Detail

main

public static void main(java.lang.String[] args)
Parameters:
args -

processArgs

public static void processArgs(java.lang.String[] args)
                        throws java.lang.Exception
Process the Args to operate on KonaKart Messages

Parameters:
args - command line arguments
Throws:
java.lang.Exception

createPassword

public static int createPassword(java.lang.String propertyFilename,
                                 java.lang.String key,
                                 java.lang.String pwd,
                                 java.lang.String fEncoding,
                                 java.lang.String cEncoding,
                                 boolean debugOn)
Create an encrypted password for the specified key and write the results to the specified properties file

Parameters:
propertyFilename -
key -
pwd - if pwd is null we encrypt the existing password
fEncoding -
cEncoding -
debugOn -
Returns:
0 if successful, otherwise 1

getPropertyOnLine

private static java.lang.String getPropertyOnLine(java.lang.String line)

println

private static void println(java.lang.String str)
                     throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

getConsoleEncoding

protected static java.lang.String getConsoleEncoding()
Returns:
the consoleEncoding

setConsoleEncoding

protected static void setConsoleEncoding(java.lang.String consoleEncoding)
Parameters:
consoleEncoding - the consoleEncoding to set

getFileEncoding

protected static java.lang.String getFileEncoding()
Returns:
the fileEncoding

setFileEncoding

protected static void setFileEncoding(java.lang.String fileEncoding)
Parameters:
fileEncoding - the fileEncoding to set

getPropertiesFilename

protected static java.lang.String getPropertiesFilename()
Returns:
the propertiesFilename

setPropertiesFilename

protected static void setPropertiesFilename(java.lang.String propertiesFilename)
Parameters:
propertiesFilename - the propertiesFilename to set

getPropertyKey

protected static java.lang.String getPropertyKey()
Returns:
the propertyKey

setPropertyKey

protected static void setPropertyKey(java.lang.String propertyKey)
Parameters:
propertyKey - the propertyKey to set

getPassword

protected static java.lang.String getPassword()
Returns:
the password

setPassword

protected static void setPassword(java.lang.String password)
Parameters:
password - the password to set

isDebug

protected static boolean isDebug()
Returns:
the debug

setDebug

protected static void setDebug(boolean debug)
Parameters:
debug - the debug to set


Copyright © 2011 DS Data Systems UK Ltd.