com.denova.runtime
Class WindowsUtils

java.lang.Object
  |
  +--com.denova.runtime.WindowsUtils
All Implemented Interfaces:
WindowsConstants

public class WindowsUtils
extends java.lang.Object
implements WindowsConstants

Provides methods that are useful when working with Windows.

Author:
DeNova Copyright © 1997-2008 DeNova All rights reserved worldwide.

Field Summary
 
Fields inherited from interface com.denova.runtime.WindowsConstants
AddRegistryEntry, AllUsers, AppendRegistryEntry, BinaryType, CurrentUser, DeleteRegistryEntry, DesktopSpecFilename, DirectoryResultsFilename, DWordType, EnumKeyRegistryEntry, EnumValueRegistryEntry, EnvOutputFilename, ExistsRegistryEntry, FreeDiskSpaceResultsFilename, InvokerFilename, MenuSpecFilename, NtResultsFilename, PathOutputFilename, PrependRegistryEntry, QueryRegistryEntry, RegistryResultsFilename, RegistrySpecFilename, ReplaceRegistryEntry, ShortnameFilename, StringType, WindowsAddDesktop, WindowsAddProgramsMenu, WindowsAddStartupMenu, WindowsAppDataCommand, WindowsCmdLogFilename, WindowsCommandsFilename, WindowsDelDesktop, WindowsDelProgramsMenu, WindowsDelStartupMenu, WindowsDesktopCommand, WindowsDesktopDirCommand, WindowsDirCommand, WindowsEnvVariableCommand, WindowsFreeDiskSpaceCommand, WindowsMenusDirCommand, WindowsNtCommand, WindowsPathCommand, WindowsPathShortenerCommand, WindowsProgramManagerDirCommand, WindowsProgramsMenuCommand, WindowsRegistryEditorCommand, WindowsStartupMenuCommand, WindowsStartupMenusDirCommand
 
Constructor Summary
WindowsUtils()
           
 
Method Summary
static void clearError()
          Clear previous errors.
static java.lang.String getLastError()
          Gets the last error.
static java.lang.Exception getLastException()
           
static boolean getLogging()
          Returns true if logging enabled.
static java.lang.String getTempDir()
          Gets the temp dir.
static java.lang.String getTempDirName()
          Gets the temp dir name.
static boolean isError()
           
static void log(java.lang.Exception e)
          Log an exception.
static void log(java.lang.String s)
          Add log message.
static void rememberError(java.lang.Exception e)
          Remember this exception.
static void rememberError(java.lang.String s)
          Remember this error message.
static void rememberError(java.lang.String s, java.lang.Exception e)
          Remember this error.
static void runCommand(java.lang.String[] commandArray)
          Run a command.
static void startLog()
          Start logging.
static java.lang.String tempFilename(java.lang.String specFilename)
          Get the temporary filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowsUtils

public WindowsUtils()
Method Detail

runCommand

public static void runCommand(java.lang.String[] commandArray)
                       throws java.lang.Exception
Run a command.

Parameters:
commandArray -
Throws:
java.lang.Exception - Any Exception

isError

public static boolean isError()
Returns:
true if there was an error during the last operation.

getLastException

public static java.lang.Exception getLastException()
Returns:
the last exception detected.

getLastError

public static java.lang.String getLastError()
Gets the last error.

Returns:
last error

clearError

public static void clearError()
Clear previous errors.


rememberError

public static void rememberError(java.lang.Exception e)
Remember this exception.

Parameters:
e -

rememberError

public static void rememberError(java.lang.String s)
Remember this error message.

Parameters:
s - error message

rememberError

public static void rememberError(java.lang.String s,
                                 java.lang.Exception e)
Remember this error.

Parameters:
s - error message
e - exception

tempFilename

public static java.lang.String tempFilename(java.lang.String specFilename)
Get the temporary filename.

Parameters:
specFilename -
Returns:
temporary filename.

getTempDir

public static java.lang.String getTempDir()
Gets the temp dir.

Returns:
temp dir

log

public static void log(java.lang.String s)
Add log message.

Parameters:
s - message

log

public static void log(java.lang.Exception e)
Log an exception.

Parameters:
e - exception

getLogging

public static boolean getLogging()
Returns true if logging enabled.

Returns:
The logging value

startLog

public static void startLog()
Start logging.


getTempDirName

public static java.lang.String getTempDirName()
Gets the temp dir name.

Returns:
temp dir name