|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.instantbank.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 | |
(package private) static void |
|
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 |
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: |
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 boolean |
isWorkableDay(java.util.Date selectedDate,
java.lang.String companyCalendar)
Determine if a selected Date is a workable day or not in a company calendar |
static oracle.xml.parser.v2.XMLDocument |
parseInfo(java.lang.String xmlData)
Auxiliary method for building a XMLDocument from a XML string method for building a XMLDocument from a XML string |
static java.util.Vector |
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.lang.String |
stackTraceToString(java.lang.Throwable thw)
Produces --as a String-- the "stacktrace" corresponding to a Throwable object (exceptions, errors). |
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 |
static java.util.Date |
workableOffset(java.util.Date selectedDate,
int offset,
java.util.Hashtable companyCalendars)
Add a workable offset (positive or negative) to a selected date, accordingly to the calendars of a company. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Field Detail |
public static final int OK
private static Debug debug
Constructor Detail |
public CommonUtil()
Method Detail |
static void()
public static java.util.Hashtable getWebContextVariable(javax.servlet.ServletContext context, java.lang.String variableName)
context
- web contextvariableName
- name of context variable (according to WebKeys
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 (according to
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
- requestjava.lang.Exception
- public static boolean isUserInRole(javax.servlet.http.HttpServletRequest req, java.lang.String rol) throws java.lang.Exception
req
- HTTP requestrol
- J2EE rolejava.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 stringoracle.xml.parser.v2.XMLParseException
- oracle.xml.parser.v2.XSLException
- org.xml.sax.SAXException
- java.io.IOException
- public static java.util.Vector parseKeywords(java.lang.String keywordString, java.util.Locale locale)
keywordString
- string with wordslocale
- languagepublic 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 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 Parameterjava.io.IOException
- javax.servlet.ServletException
- public static java.lang.String getApplicationProperty(java.lang.String nameJNDI)
nameJNDI
- JNDI name of the propertypublic static boolean isWorkableDay(java.util.Date selectedDate, java.lang.String companyCalendar)
selectedDate
- selected Date to determine if it is workable day or notcompanyCalendar
- company calendar corresponding to year of
selectedDate; each day of year is a character :
'P' is it is workable(processing) day, 'N' otherwisepublic static java.util.Date workableOffset(java.util.Date selectedDate, int offset, java.util.Hashtable companyCalendars)
selectedDate
- selected DatecompanyCalendars
- hash table of company calendars:
key: year (Integer),
value: String representing the year calendar
(each day of year is a character :
'P' is it is workable(processing) day, 'N' otherwise)offset
- Description of the Parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |