|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.cinecolombia.common.utilcomponents.CommonUtil
Various general algorithms implemented as static methods.
Field Summary | |
private static Debug |
debug
|
static int |
OK
A verification is OK. |
Constructor Summary | |
CommonUtil()
|
Method Summary | |
static boolean |
allNull(java.lang.Object[] arr)
Decide si un arreglo de Objetos solamente contiene valores nulos. |
static void |
cleanTemporaldirectory(java.io.File dirPath)
Delete files from a temporal directory and all its subdirectories, excepting those with extensions ".log" or ".war". |
static void |
cleanTemporaldirectory(java.lang.String pathName)
Delete files from a temporal directory and its subdirectories, excepting those with extensions ".log" or ".war". |
static boolean |
controlTimeout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext context)
control time out in a servlet when it is invoked several times without MVC participation, and in a separate window |
static java.lang.String |
fixedLengthString(java.lang.String cadena,
int longitudDisplay)
obtiene una cadena para HTML restringida a una longitud maxima, truncadola o ampliandola con blancos. |
static java.lang.String |
getApplicationProperty(java.lang.String nameJNDI)
gets the value of an application property (of String type) |
static java.lang.String |
getUserId(javax.servlet.http.HttpServletRequest req)
find the current user from the HttpServletRequest: NOTE: another similar method is request.getRemoteUser(); |
static java.util.Hashtable |
getWebContextVariable(javax.servlet.ServletContext context,
java.lang.String variableName)
method for instantiating and returning a context variable that is a Hashtable with an entry for each company |
static boolean |
isUserInRole(javax.servlet.http.HttpServletRequest req,
java.lang.String rol)
determine if the current user belongs to a role |
static oracle.xml.parser.v2.XMLDocument |
parseInfo(java.lang.String xmlData)
Auxiliary method for building a XMLDocument from a XML string |
static java.util.List |
parseKeywords(java.lang.String keywordString,
java.util.Locale locale)
parsing of a string composed of words |
static void |
putVariableInContext(javax.servlet.ServletContext context,
java.lang.String companyId,
java.lang.String tableName,
java.lang.Object variableValue)
method for putting the value of a company variable in a Hashtable context variable (with an entry for each company) |
static void |
putVariableInRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext context,
java.lang.String companyId,
java.lang.String tableName,
java.lang.String variableName)
method for putting in the current request, a company variable obtained from a Hashtable context variable (with an entry for each company) |
static java.util.Date |
rightNow()
Method for getting the current time |
static java.util.Set |
setOfZipEntryNames(java.util.zip.ZipInputStream zin)
Calcula el conjunto de nombres de las entradas (archivos o directorios) de un ZipInputStream |
static java.lang.String |
stackTraceToString(java.lang.Throwable thw)
Produces --as a String-- the "stacktrace" corresponding to a Throwable object (exceptions, errors). |
static java.lang.String[] |
stringToArray(java.lang.String s,
java.lang.String separador)
Convierte una cadena de caracteres, con tokens separados por un separador, en un arreglo de tokens en el mismo orden en el que aparecen en la cadena. |
static java.lang.String |
toSafeJavaString(java.lang.String in)
Method for transforming a String with special characters in a Java String. |
static java.lang.String |
toSafeOracleString(java.lang.String in)
Method for transforming in a String the ' character in '' characters in order to be understood by Oracle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int OK
private static Debug debug
Constructor Detail |
public CommonUtil()
Method Detail |
public static java.util.Hashtable getWebContextVariable(javax.servlet.ServletContext context, java.lang.String variableName)
context
- web contextvariableName
- name of context variable enumeration)
public static void putVariableInContext(javax.servlet.ServletContext context, java.lang.String companyId, java.lang.String tableName, java.lang.Object variableValue)
context
- web contextcompanyId
- current company idtableName
- name of Hashtable context variable WebKeys enumeration)variableValue
- value of the company variablepublic static void putVariableInRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext context, java.lang.String companyId, java.lang.String tableName, java.lang.String variableName)
request
- current requestcontext
- web contextcompanyId
- current company numbertableName
- name of Hahtable context variable
(according to WebKeys enumeration)variableName
- name of the company variable
(according to WebKeys enumeration)public static java.lang.String stackTraceToString(java.lang.Throwable thw)
thw
- The throwed object.
public static void cleanTemporaldirectory(java.lang.String pathName)
pathName
- Full path of the directory.public static void cleanTemporaldirectory(java.io.File dirPath)
dirPath
- Directory "abstract" path.public static java.lang.String getUserId(javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
req
- request
java.lang.Exception
public static boolean isUserInRole(javax.servlet.http.HttpServletRequest req, java.lang.String rol) throws java.lang.Exception
req
- HTTP requestrol
- J2EE role
java.lang.Exception
public static oracle.xml.parser.v2.XMLDocument parseInfo(java.lang.String xmlData) throws oracle.xml.parser.v2.XMLParseException, oracle.xml.parser.v2.XSLException, org.xml.sax.SAXException, java.io.IOException
xmlData
- xml string
oracle.xml.parser.v2.XMLParseException
oracle.xml.parser.v2.XSLException
org.xml.sax.SAXException
java.io.IOException
public static java.util.List parseKeywords(java.lang.String keywordString, java.util.Locale locale)
keywordString
- string with wordslocale
- language
public static java.lang.String toSafeJavaString(java.lang.String in)
in
- is the string with special characters.
public static java.lang.String toSafeOracleString(java.lang.String in)
in
- is the string with special characters.
public static java.util.Date rightNow()
public static boolean controlTimeout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext context) throws java.io.IOException, javax.servlet.ServletException
request
- HTTP requestresponse
- HTTP responsecontext
- Description of the Parameter
java.io.IOException
javax.servlet.ServletException
public static java.lang.String getApplicationProperty(java.lang.String nameJNDI)
nameJNDI
- JNDI name of the property
public static java.lang.String[] stringToArray(java.lang.String s, java.lang.String separador)
s
- Description of the Parameterseparador
- Description of the Parameter
public static boolean allNull(java.lang.Object[] arr)
arr
- Description of the Parameter
public static java.util.Set setOfZipEntryNames(java.util.zip.ZipInputStream zin) throws java.io.IOException
zin
- The new ofZipEntryNames value
java.io.IOException
- Description of the Exceptionpublic static java.lang.String fixedLengthString(java.lang.String cadena, int longitudDisplay)
cadena
- cadena a restringirlongitudDisplay
- que debe tener la cadena restringida
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |