|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softslate.commerce.customer.core.AppUtils
public class AppUtils
Provides miscellaneous static methods used by various classes in the Struts layer.
Field Summary | |
---|---|
(package private) static org.apache.commons.logging.Log |
log
|
static java.lang.String |
systemLayoutDirectory
The name of the directory under the "/WEB-INF/layouts" directory in the application where the system's default JSP templates reside. |
Constructor Summary | |
---|---|
AppUtils()
|
Method Summary | |
---|---|
static java.lang.String |
alterURI(java.lang.String uri,
java.lang.String layout,
javax.servlet.ServletContext servletContext)
Replaces strings matching the systemLayoutDirectory with the
user's custom layout directory. |
static java.util.Properties |
loadProperties(java.io.File file)
Load properties from a given File object. |
static java.util.Properties |
loadProperties(java.lang.String path,
java.util.Properties defaults)
Load properties from a given String represent the path to
the properties file.. |
static java.util.Properties |
loadProperties(java.lang.String path,
javax.servlet.ServletContext servletContext)
Load properties from a path to a .properties file in the form of "some/package/settings.properties" represented by the argument. |
static java.lang.String |
replaceLayout(java.lang.String uri,
java.lang.String layout)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static org.apache.commons.logging.Log log
public static final java.lang.String systemLayoutDirectory
Constructor Detail |
---|
public AppUtils()
Method Detail |
---|
public static java.util.Properties loadProperties(java.lang.String path, javax.servlet.ServletContext servletContext)
path
- The path to a .properties file under the application's
classpath.servletContext
- Used to locate the .properties file through its
getRealPath
method.
Properties
object represented by the .properties
file.public static java.util.Properties loadProperties(java.io.File file)
File
object.
file
- The File
object.
File
.public static java.util.Properties loadProperties(java.lang.String path, java.util.Properties defaults)
String
represent the path to
the properties file..
path
- The path to the properties file.
public static java.lang.String alterURI(java.lang.String uri, java.lang.String layout, javax.servlet.ServletContext servletContext)
systemLayoutDirectory
with the
user's custom layout directory. If the resulting path doesn't map to an
existing file, returns the original string. Used by
BaseRequestProcessor
and AppInsertTag
to
handle forwards coming from the Struts request. (See the "Creating a
Custom Layout" chapter of the User Guide.)
uri
- The original uri, containing the
systemLayoutDirectory
.layout
- The user's custom layout directory.servletContext
- Used to determine if the resulting path maps to an existing
file, through the getRealPath
method.
public static java.lang.String replaceLayout(java.lang.String uri, java.lang.String layout)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |