|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectro.isdc.wro.util.WroUtil
public final class WroUtil
Utility class.
| Field Summary | |
|---|---|
static Pattern |
EMTPY_LINE_PATTERN
Empty line pattern. |
| Constructor Summary | |
|---|---|
WroUtil()
|
|
| Method Summary | ||
|---|---|---|
static void |
addNoCacheHeaders(javax.servlet.http.HttpServletResponse response)
Add no-cache headers to response. |
|
static ThreadFactory |
createDaemonThreadFactory(String name)
|
|
static String |
getFilterPath(String filterName,
InputStream is)
Returns the filter path read from the web.xml |
|
static String |
getPathInfoFromLocation(String location)
Retrieve pathInfo from a given location. |
|
static String |
getServletPathFromLocation(String location)
Retrieve servletPath from a given location. |
|
static boolean |
isGzipSupported(javax.servlet.http.HttpServletRequest request)
Analyze headers of the request and searches for mangled (by proxy) for "Accept-Encoding" header and its mangled variations and gzip header value and its mangled variations. |
|
static ResourcePostProcessor |
newResourceProcessor(Resource resource,
ResourcePreProcessor preProcessor)
A factory method for creating a ResourceProcessor based on provided ResourcePreProcessor. |
|
static
|
simpleObjectFactory(T object)
|
|
static boolean |
startsWithIgnoreCase(String str,
String prefix)
Case insensitive check if a String starts with a specified prefix. |
|
static String |
toDateAsString(long milliseconds)
Transforms milliseconds into date format for response header of this form: Sat, 10 Apr 2010 17:31:31 GMT. |
|
static String |
toJSMultiLineString(String data)
Transforms a java multi-line string into javascript multi-line string. |
|
static String |
toPackageAsFolder(Class<?> clazz)
Creates a folder like implementation for a class. |
|
static void |
wrapWithWroRuntimeException(Exception e)
Wraps original exception into WroRuntimeException and throw it. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Pattern EMTPY_LINE_PATTERN
| Constructor Detail |
|---|
public WroUtil()
| Method Detail |
|---|
public static ThreadFactory createDaemonThreadFactory(String name)
ThreadFactory with daemon threads.public static String toDateAsString(long milliseconds)
milliseconds - to transform
public static String getPathInfoFromLocation(String location)
location - where to search contextPath.
public static boolean startsWithIgnoreCase(String str,
String prefix)
Case insensitive check if a String starts with a specified prefix.
nulls are handled without exceptions. Two null references are considered to be equal. The
comparison is case insensitive.
StringUtils.startsWithIgnoreCase(null, null) = true
StringUtils.startsWithIgnoreCase(null, "abcdef") = false
StringUtils.startsWithIgnoreCase("abc", null) = false
StringUtils.startsWithIgnoreCase("abc", "abcdef") = true
StringUtils.startsWithIgnoreCase("abc", "ABCDEF") = true
str - the String to check, may be nullprefix - the prefix to find, may be null
true if the String starts with the prefix, case insensitive, or both nullString.startsWith(String)public static String toPackageAsFolder(Class<?> clazz)
clazz - used as a base location for determining the package path.
public static String getServletPathFromLocation(String location)
location - where to search the servletPath.
public static boolean isGzipSupported(javax.servlet.http.HttpServletRequest request)
public static String toJSMultiLineString(String data)
http://stackoverflow.com/questions/805107/multiline-strings-in-javascript/
data - a string containing new lines.
public static String getFilterPath(String filterName,
InputStream is)
throws javax.servlet.ServletException
filterName - the name of the searched filter.is - Stream of the web.xml file.
javax.servlet.ServletExceptionpublic static void addNoCacheHeaders(javax.servlet.http.HttpServletResponse response)
public static ResourcePostProcessor newResourceProcessor(Resource resource,
ResourcePreProcessor preProcessor)
ResourceProcessor based on provided ResourcePreProcessor.
preProcessor - ResourcePreProcessor to use as a ResourceProcessor.
ResourceProcessor.public static <T> ObjectFactory<T> simpleObjectFactory(T object)
public static void wrapWithWroRuntimeException(Exception e)
WroRuntimeException and throw it.
e - the exception to wrap.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||