Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.jst.jsf.core.internal.provisional.jsfappconfig
Class JSFAppConfigUtils

    java.lang.Object
      org.eclipse.jst.jsf.core.internal.provisional.jsfappconfig.JSFAppConfigUtils

public class JSFAppConfigUtils
extends java.lang.Object

JSFAppConfigUtils provides utility methods useful in processing of a JSF application configuration.

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").

Constructor Summary
`JSFAppConfigUtils()`

Method Summary
`static java.util.List` | `getConfigFileJARsFromClasspath(org.eclipse.core.resources.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(org.eclipse.core.resources.IProject project)` Gets list of application configuration file names as listed in the JSF CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES").
`static org.eclipse.wst.common.componentcore.resources.IVirtualFolder` | `getWebContentFolder(org.eclipse.core.resources.IProject project)` Gets an IVirtualFolder instance which represents the root context's web content folder.
`static org.eclipse.core.runtime.IPath` | `getWebContentFolderRelativePath(org.eclipse.core.resources.IFile file)` Gets an IPath instance representing the path of the passed IFile instance relative to the web content folder.
`static boolean` | `isValidJSFProject(org.eclipse.core.resources.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 "jst.jsf" facet set on it.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### 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

Constructor Detail

### JSFAppConfigUtils

    public JSFAppConfigUtils()

Method Detail

### isValidJSFProject

    public static boolean isValidJSFProject(org.eclipse.core.resources.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 "jst.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.

### getWebContentFolder

    public static org.eclipse.wst.common.componentcore.resources.IVirtualFolder getWebContentFolder(org.eclipse.core.resources.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 org.eclipse.core.runtime.IPath getWebContentFolderRelativePath(org.eclipse.core.resources.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(org.eclipse.core.resources.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(org.eclipse.core.resources.IProject project)
                                                         throws org.eclipse.core.runtime.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:
    `org.eclipse.core.runtime.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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD