com.sleepycat.je.utilint
Class CmdUtil

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

public class CmdUtil
extends Object

Convenience methods for command line utilities.


Constructor Summary
CmdUtil()
           
 
Method Summary
static void formatEntry(StringBuilder sb, byte[] entryData, boolean formatUsingPrintable)
           
static String getArg(String[] argv, int whichArg)
           
static String getJavaCommand(Class<?> cls)
          Returns a description of the java command for running a utility, without arguments.
static EnvironmentImpl makeUtilityEnvironment(File envHome, boolean readOnly)
          Create an environment suitable for utilities.
static long readLongNumber(String longVal)
          Parse a string into a long.
static long readLsn(String lsnVal)
          Convert a string that is either 0xabc or 0xabc/0x123 into an lsn.
 
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 String getArg(String[] argv,
                            int whichArg)
                     throws IllegalArgumentException
Throws:
IllegalArgumentException - via main

readLongNumber

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


readLsn

public static long readLsn(String lsnVal)
Convert a string that is either 0xabc or 0xabc/0x123 into an lsn.


formatEntry

public static void formatEntry(StringBuilder sb,
                               byte[] entryData,
                               boolean formatUsingPrintable)

makeUtilityEnvironment

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

Throws:
EnvironmentNotFoundException
EnvironmentLockedException

getJavaCommand

public static String getJavaCommand(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 (c) 2004-2012 Oracle. All rights reserved.