|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.opencms.util.Utils
This is a general helper class.
| Field Summary | |
static int |
C_SORT_LASTMODIFIED_DOWN
Constant for sorting files downward by lastmodified date |
static int |
C_SORT_LASTMODIFIED_UP
Constant for sorting files upward by lastmodified date |
static int |
C_SORT_NAME_DOWN
Constant for sorting files downward by name |
static int |
C_SORT_NAME_UP
Constant for sorting files upward by name |
| Constructor Summary | |
Utils()
|
|
| Method Summary | |
static void |
bubblesort(Vector names,
Vector data)
Sorts two vectors using bubblesort. |
static String |
getFullName(CmsUser user)
Returns a string representation of the full name of a user. |
static void |
getModulPublishMethods(CmsObject cms,
Vector changedLinks)
|
static void |
getModulShutdownMethods(I_CmsRegistry reg)
Calls the startup methode on all module classes that are registerd in the registry. |
static void |
getModulStartUpMethods(CmsObject cms)
Calls the startup methode on all module classes that are registerd in the registry. |
static String |
getNiceDate(long time)
Gets a formated time string form a long time value. |
static String |
getNiceShortDate(long time)
Gets a formated time string form a long time value. |
static String |
getStackTrace(Throwable e)
Gets the stack-trace of a exception, and returns it as a string. |
static boolean |
isHttpsResource(CmsObject cms,
CmsResource res)
Checks if a resource needs the https scheme. |
static String |
mergeAbsolutePath(String basePath,
String relativePath)
Returns the AbsolutePath of an resource based on the base and the relative Path to the resource. |
static String |
removeLineBreaks(String s)
Replaces all line breaks in a given string object by white spaces. |
static String |
replace(String toReplace,
String replaceKey,
String replaceWith)
This method replaces all occurences of the replaceKey in the toReplace string with the replaceWith String. |
static Vector |
sort(Vector unsortedFiles,
int sorting)
Deprecated. this method is deprecated and will be removed in a later OpenCms release |
static String[] |
split(String toSplit,
String at)
This method splits a overgiven string into substrings. |
static long |
splitDate(String dateString)
Converts date string to a long value. |
static void |
validateNewPassword(CmsObject cms,
String password,
String oldPassword)
This method checks if a new password sticks to the rules for new passwords (i.e. a new password must have at least 4 characters). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int C_SORT_NAME_UP
public static final int C_SORT_NAME_DOWN
public static final int C_SORT_LASTMODIFIED_UP
public static final int C_SORT_LASTMODIFIED_DOWN
| Constructor Detail |
public Utils()
| Method Detail |
public static String mergeAbsolutePath(String basePath,
String relativePath)
basePath - The folder where the relativePath starts (or the absolute path of
a file (no folder) in this path)relativePath - The relative path to a reaource.public static String getFullName(CmsUser user)
user - The user to get the full name from
public static String getNiceDate(long time)
time - The time value as a long.
public static String getNiceShortDate(long time)
time - The time value as a long.
public static void getModulPublishMethods(CmsObject cms,
Vector changedLinks)
throws CmsException
changedLinks - A vector of STrings with the links that have changed
during the publishing.
CmsException
public static void getModulStartUpMethods(CmsObject cms)
throws CmsException
CmsException
public static void getModulShutdownMethods(I_CmsRegistry reg)
throws CmsException
CmsExceptionpublic static String getStackTrace(Throwable e)
e - The exception to get the stackTrace from.
public static String removeLineBreaks(String s)
throws CmsException
trimed to
delete all unnecessary white spaces.
s - Input string
CmsException
public static boolean isHttpsResource(CmsObject cms,
CmsResource res)
throws CmsException
cms - The cms Object, used for reading the parent folder and the properties.res - The resource to be checked.
CmsException.
CmsException
public static Vector sort(Vector unsortedFiles,
int sorting)
unsortedFiles - Vector containing a list of unsorted filessorting - The sorting method to be used.
public static final String[] split(String toSplit,
String at)
toSplit - the String to split.at - the delimeter.
public static final String replace(String toReplace,
String replaceKey,
String replaceWith)
toReplace - the String to replace something in.replaceKey - the String that will be replaced.replaceWith - The string that is inserted in the place marked with the replaceKey.
public static long splitDate(String dateString)
dateString - The date as a string.
public static void bubblesort(Vector names,
Vector data)
names - The vector to sortdata - Vector with data that accompanies names.
public static void validateNewPassword(CmsObject cms,
String password,
String oldPassword)
throws CmsException
cms - The CmsObject.password - The new password that has to be checked.oldPassword - The old password or null if not needed.
CmsException - is thrown if the password is not valid.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||