org.eclipse.jst.jsf.core.jsfappconfig
Class JSFAppConfigUtils
java.lang.Object
org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils
-
public class JSFAppConfigUtils
- extends java.lang.Object
JSFAppConfigUtils provides utility methods useful in processing of a JSF
application configuration.
Provisional API - subject to change
Field Summary
|
static java.lang.String
|
CONFIG_FILES_CONTEXT_PARAM_NAME
Name of JSF CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES"). |
static java.lang.String
|
FACES_CONFIG_IN_JAR_PATH
Location in JAR file of application configuration resource file
("META-INF/faces-config.xml"). |
Method Summary
|
static java.util.List
|
getConfigFileJARsFromClasspath
(IProject project)
Gets list of JAR file names, where each file name represents a JAR on
the classpath that contains a /META-INF/faces-config.xml entry. |
static java.util.List
|
getConfigFilesFromContextParam
(IProject project)
Gets list of application configuration file names as listed in the JSF
CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES"). |
static IProjectFacetVersion
|
getProjectFacet
(IProject project)
Get the facet version for the project |
static IVirtualFolder
|
getWebContentFolder
(IProject project)
Gets an IVirtualFolder instance which represents the root context's
web content folder. |
static IPath
|
getWebContentFolderRelativePath
(IFile file)
Gets an IPath instance representing the path of the passed IFile
instance relative to the web content folder. |
static boolean
|
isValidJSFProject
(IProject project)
Tests if the passed IProject instance is a valid JSF project in the
following ways:
project is not null and is accessible,
project has the JSF facet set on it. |
static boolean
|
isValidJSFProject
(IProject project,
java.lang.String minVersion)
|
Methods inherited from class java.lang.Object
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
CONFIG_FILES_CONTEXT_PARAM_NAME
public static final java.lang.String CONFIG_FILES_CONTEXT_PARAM_NAME
- Name of JSF CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES").
-
See Also:
-
Constant Field Values
FACES_CONFIG_IN_JAR_PATH
public static final java.lang.String FACES_CONFIG_IN_JAR_PATH
- Location in JAR file of application configuration resource file
("META-INF/faces-config.xml").
-
See Also:
-
Constant Field Values
JSFAppConfigUtils
public JSFAppConfigUtils()
isValidJSFProject
public static boolean isValidJSFProject(IProject project,
java.lang.String minVersion)
-
-
Parameters:
-
project
- -
minVersion
-
-
Returns:
- true if project is a JSF facet project and the version of the project
is at least minVersion.
isValidJSFProject
public static boolean isValidJSFProject(IProject project)
- Tests if the passed IProject instance is a valid JSF project in the
following ways:
- project is not null and is accessible,
- project has the JSF facet set on it.
-
-
Parameters:
-
project
- IProject instance to be tested.
-
Returns:
- true if the IProject instance is a valid JSF project, else
false.
getProjectFacet
public static IProjectFacetVersion getProjectFacet(IProject project)
- Get the facet version for the project
-
-
Parameters:
-
project
-
-
Returns:
- the project facet version or null if could not be found or if
project is not accessible
getWebContentFolder
public static IVirtualFolder getWebContentFolder(IProject project)
- Gets an IVirtualFolder instance which represents the root context's
web content folder.
-
-
Parameters:
-
project
- IProject instance for which to get the folder.
-
Returns:
- IVirtualFolder instance which represents the root context's
web content folder.
getWebContentFolderRelativePath
public static IPath getWebContentFolderRelativePath(IFile file)
- Gets an IPath instance representing the path of the passed IFile
instance relative to the web content folder.
-
-
Parameters:
-
file
- IFile instance for which a path is required.
-
Returns:
- IPath instance representing the path relative to the web content
folder.
getConfigFilesFromContextParam
public static java.util.List getConfigFilesFromContextParam(IProject project)
- Gets list of application configuration file names as listed in the JSF
CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES"). Will return
an empty list if WebArtifactEdit is null, if WebApp is null, if context
parameter does not exist, or if trimmed context parameter's value is
an empty String.
-
-
Parameters:
-
project
- IProject instance for which to get the context
parameter's value.
-
Returns:
- List of application configuration file names as listed in the
JSF CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES"); list
may be empty.
getConfigFileJARsFromClasspath
public static java.util.List getConfigFileJARsFromClasspath(IProject project)
throws CoreException,
java.io.IOException
- Gets list of JAR file names, where each file name represents a JAR on
the classpath that contains a /META-INF/faces-config.xml entry. Will
return an empty list if no such JAR files are located.
-
-
Parameters:
-
project
- IProject instance for which to scan the classpath.
-
Returns:
- List of JAR file names, where each file name represents a JAR
on the classpath that contains a ...META-INF/faces-config.xml entry;
list may be empty.
-
Throws:
-
CoreException
- Thrown when underlying calls into JavaCore fail.
-
java.io.IOException
- Thrown when attempt to open JAR to determine if it
contains a /META-INF/faces-config.xml entry fails.