Package org.eclipse.emf.mwe.core
Class WorkflowComponentHelper
java.lang.Object
org.eclipse.emf.mwe.core.WorkflowComponentHelper
Helper class that provides some utility methods for workflow components.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isLegalDir
(String dirname) Proves if the argument points to a existent directory (not file!).static boolean
isLegalFile
(String filename) Proves if the filename points to a existent file (not directory!).static boolean
isLegalURL
(String url) Proves if the given string is a valid URL.static boolean
isLoadableClass
(String classname) Proves that a class could be loaded.static boolean
isParamSet
(String param) Convenience method that proves if a parameter is set.static boolean
isResource
(String uri) Proves if the given name is a valid resource.static boolean
isResource
(String uri, String contextClassName) Proves if the given name is a valid resource.
-
Constructor Details
-
WorkflowComponentHelper
public WorkflowComponentHelper()
-
-
Method Details
-
isLegalFile
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
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
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
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
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 identifiercontextClassName
- The class whose resource is tested- Returns:
- true if the given URI points to a valid resource, otherwise false.
-
isParamSet
Convenience method that proves if a parameter is set.- Parameters:
param
- The parameter- Returns:
- true if the given parameter string is not null.
-
isLoadableClass
Proves that a class could be loaded.- Parameters:
classname
- The classname to check- Returns:
true
if the class was successfully loaded
-