com.sleepycat.je.utilint
Class CmdUtil

java.lang.Object
  extended by com.sleepycat.je.utilint.CmdUtil

public class CmdUtil
extends java.lang.Object

Convenience methods for command line utilities.


Constructor Summary
CmdUtil()
           
 
Method Summary
static void formatEntry(java.lang.StringBuffer sb, byte[] entryData, boolean formatUsingPrintable)
           
static java.lang.String getArg(java.lang.String[] argv, int whichArg)
           
static java.lang.String getJavaCommand(java.lang.Class cls)
          Returns a description of the java command for running a utility, without arguments.
static EnvironmentImpl makeUtilityEnvironment(java.io.File envHome, boolean readOnly)
          Create an environment suitable for utilities.
static long readLongNumber(java.lang.String longVal)
          Parse a string into a long.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmdUtil

public CmdUtil()
Method Detail

getArg

public static java.lang.String getArg(java.lang.String[] argv,
                                      int whichArg)
                               throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

readLongNumber

public static long readLongNumber(java.lang.String longVal)
Parse a string into a long. If the string starts with 0x, this is a hex number, else it's decimal.


formatEntry

public static void formatEntry(java.lang.StringBuffer sb,
                               byte[] entryData,
                               boolean formatUsingPrintable)

makeUtilityEnvironment

public static EnvironmentImpl makeUtilityEnvironment(java.io.File envHome,
                                                     boolean readOnly)
                                              throws DatabaseException
Create an environment suitable for utilities. Utilities should in general send trace output to the console and not to the db log.

Throws:
DatabaseException

getJavaCommand

public static java.lang.String getJavaCommand(java.lang.Class cls)
Returns a description of the java command for running a utility, without arguments. For utilities the last name of the class name can be specified when "-jar je.jar" is used.



Copyright 2004,2008 Oracle. All rights reserved.