com.jboss.jbossnetwork.product.jbpm.handlers
Class HandlerUtils

java.lang.Object
  extended by com.jboss.jbossnetwork.product.jbpm.handlers.HandlerUtils

public class HandlerUtils
extends Object

Utilities provided to handlers that are outside of the JBPM specific methods found in BaseHandler.

Author:
Jason Dobies

Constructor Summary
HandlerUtils()
           
 
Method Summary
static File checkAndReturnParent(String filename)
           
static void checkFilenameDoesNotExist(String filename)
           
static void checkFilenameExists(String filename)
           
static void checkFilenameIsAbsolute(String filename)
           
static void checkFilenameIsADirectory(String filename)
           
static void checkFilenameIsAFile(String filename)
           
static void checkFilenameIsNotEmpty(String filename)
           
static void checkFilenameIsReadable(String filename)
           
static void checkFilenameIsWriteable(String filename)
           
static void checkIsSet(String parameterName, Object parameterValue)
          Utility method to verify a parameter value has been set and is not empty.
static char convertDigit(int value)
           
static String encode(byte[] bytes)
           
static String formatPath(String path)
          Formats a path for display to the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerUtils

public HandlerUtils()
Method Detail

checkIsSet

public static void checkIsSet(String parameterName,
                              Object parameterValue)
                       throws ActionHandlerException
Utility method to verify a parameter value has been set and is not empty. This check will throw an exception if these conditions are not met.

Parameters:
parameterName - name of the parameter being checked
parameterValue - actual value being tested
Throws:
ActionHandlerException - if the value is null or an empty string

formatPath

public static String formatPath(String path)
Formats a path for display to the user.

Parameters:
path - in a format used by the plugin
Returns:
user friendly path

encode

public static String encode(byte[] bytes)

convertDigit

public static char convertDigit(int value)

checkFilenameIsWriteable

public static void checkFilenameIsWriteable(String filename)
                                     throws ActionHandlerException
Throws:
ActionHandlerException

checkFilenameIsReadable

public static void checkFilenameIsReadable(String filename)
                                    throws ActionHandlerException
Throws:
ActionHandlerException

checkFilenameIsAbsolute

public static void checkFilenameIsAbsolute(String filename)
                                    throws ActionHandlerException
Throws:
ActionHandlerException

checkFilenameIsADirectory

public static void checkFilenameIsADirectory(String filename)
                                      throws ActionHandlerException
Throws:
ActionHandlerException

checkFilenameIsAFile

public static void checkFilenameIsAFile(String filename)
                                 throws ActionHandlerException
Throws:
ActionHandlerException

checkFilenameExists

public static void checkFilenameExists(String filename)
                                throws ActionHandlerException
Throws:
ActionHandlerException

checkFilenameIsNotEmpty

public static void checkFilenameIsNotEmpty(String filename)
                                    throws ActionHandlerException
Throws:
ActionHandlerException

checkFilenameDoesNotExist

public static void checkFilenameDoesNotExist(String filename)
                                      throws ActionHandlerException
Throws:
ActionHandlerException

checkAndReturnParent

public static File checkAndReturnParent(String filename)
                                 throws ActionHandlerException
Throws:
ActionHandlerException


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.