org.eclipse.emf.mwe.core
Class WorkflowComponentHelper

java.lang.Object
  extended by org.eclipse.emf.mwe.core.WorkflowComponentHelper

public class WorkflowComponentHelper
extends java.lang.Object

Helper class that provides some utility methods for workflow components.


Constructor Summary
WorkflowComponentHelper()
           
 
Method Summary
static boolean isLegalDir(java.lang.String dirname)
          Proves if the argument points to a existent directory (not file!).
static boolean isLegalFile(java.lang.String filename)
          Proves if the filename points to a existent file (not directory!).
static boolean isLegalURL(java.lang.String url)
          Proves if the given string is a valid URL.
static boolean isLoadableClass(java.lang.String classname)
          Proves that a class could be loaded.
static boolean isParamSet(java.lang.String param)
          Convenience method that proves if a parameter is set.
static boolean isResource(java.lang.String uri)
          Proves if the given name is a valid resource.
static boolean isResource(java.lang.String uri, java.lang.String contextClassName)
          Proves if the given name is a valid resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowComponentHelper

public WorkflowComponentHelper()
Method Detail

isLegalFile

public static boolean isLegalFile(java.lang.String filename)
Proves if the filename points to a existent file (not directory!).

Parameters:
filename - Path to a file
Returns:
true if the path points to a file, false if the file does not exist or is a directory.

isLegalDir

public static boolean isLegalDir(java.lang.String dirname)
Proves if the argument points to a existent directory (not file!).

Parameters:
dirname - Path to a directory
Returns:
true if the path points to a directory, false if the directory does not exist or is a file.

isLegalURL

public static boolean isLegalURL(java.lang.String url)
Proves if the given string is a valid URL. This method tries to open the URL to check its validity.

Parameters:
url - An URL as String
Returns:
true if the string is a valid URL, otherwise false.

isResource

public static boolean isResource(java.lang.String uri)
Proves if the given name is a valid resource. This method tries to open a URL connection to the resource. The resource is located via the Thread Context ClassLoader.

Parameters:
uri - A resource identifier
Returns:
true if the given URI points to a valid resource, otherwise false.

isResource

public static boolean isResource(java.lang.String uri,
                                 java.lang.String contextClassName)
Proves if the given name is a valid resource. This method tries to open a URL connection to the resource. The resource is located as a class resource.

Parameters:
uri - A resource identifier
contextClassName - The class whose resource is tested
Returns:
true if the given URI points to a valid resource, otherwise false.

isParamSet

public static boolean isParamSet(java.lang.String param)
Convenience method that proves if a parameter is set.

Parameters:
param - The parameter
Returns:
true if the given parameter string is not null.

isLoadableClass

public static boolean isLoadableClass(java.lang.String classname)
Proves that a class could be loaded.

Parameters:
classname - The classname to check
Returns:
true if the class was successfully loaded