Class WorkflowComponentHelper

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

public class WorkflowComponentHelper extends Object
Helper class that provides some utility methods for workflow components.
  • Constructor Details

    • WorkflowComponentHelper

      public WorkflowComponentHelper()
  • Method Details

    • isLegalFile

      public static boolean isLegalFile(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(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(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(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(String uri, 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(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(String classname)
      Proves that a class could be loaded.
      Parameters:
      classname - The classname to check
      Returns:
      true if the class was successfully loaded