|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.fopps.share.Util
Useful things to make live easier. Special thanks to the authors of the ant project
| Field Summary | |
static boolean |
DEBUG
Debug enabled |
static java.lang.Class[] |
EMPTY_CLASS_ARRAY
Empty class array (Class[0]) |
static java.lang.Object[] |
EMPTY_OBJECT_ARRAY
Empty object array (Object[0]) |
static java.lang.String |
FILE_SEPARATOR
|
static boolean |
IS_WINDOWS_OS
Trze, if windows present |
static boolean |
ISJDK_14
True, if JDK 1.4 present |
static java.lang.String |
NEWLINE
Newline character(s) |
static java.lang.String |
PATH_SEPARATOR
|
static java.io.File |
USERDIR
Value of property 'user.dir' as File object |
static java.lang.String |
USERDIR_NAME
Value of property 'user.dir' |
| Constructor Summary | |
Util()
|
|
| Method Summary | |
static void |
assertWithMessage(java.lang.Object pMsg)
Assert form program execution (throws a runtime exception) |
static void |
copyFile(java.io.File sourceFile,
java.io.File destFile,
boolean overwrite,
boolean preserveLastModified)
Convienence method to copy a file from a source to a destination specifying if token filtering must be used, if filter chains must be used, if source files may overwrite newer destination files and the last modified time of destFile file should be made equal
to the last modified time of sourceFile. |
static void |
copyFile(java.lang.String sourceFile,
java.lang.String destFile)
Convienence method to copy a file from a source to a destination. |
static void |
copyFile(java.lang.String sourceFile,
java.lang.String destFile,
boolean overwrite)
Convienence method to copy a file from a source to a destination specifying if token filtering must be used and if source files may overwrite newer destination files. |
static void |
debug(java.lang.Throwable t)
Issues an error with stack trace |
static void |
dumpStack()
Print out call stack. |
static java.lang.String |
enum2String(java.util.Enumeration v)
Converts an enumeration to a comma seperated string |
static void |
error(java.lang.Throwable t)
Issues an error without stack trace |
static java.lang.String |
exception2String(java.lang.Throwable e)
Converts an exception stack trace into a string |
static java.lang.String |
findRelativeDirectory(java.lang.String pFilepath)
Transforms an absolute path to a relative path, if possible. |
static java.lang.String |
findRelativeDirectory(java.lang.String pRefPath,
java.lang.String pOtherPath)
Transforms an absolute path to a relative path, if possible. |
static int |
getCurrentDayOfMonth()
Returns the current day |
static int |
getCurrentMonth()
Returns the current month |
static int |
getCurrentYear()
Returns the current year |
static void |
info(java.lang.Object pMsg)
Logs an info message |
static java.io.File[] |
locateFile(java.lang.String pName,
java.lang.String pSearchPath,
boolean pMustBeFile)
Searches the file in the given search path. |
static void |
log(java.lang.Object pMsg)
Logs a message |
static void |
setFileLastModified(java.io.File file,
long time)
Set last file modified (needs jdk 1.2 or higher!) |
static void |
warn(java.lang.Object pMsg)
Issues a warning message |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String USERDIR_NAME
public static final java.io.File USERDIR
public static final java.lang.String NEWLINE
public static final java.lang.String PATH_SEPARATOR
public static final java.lang.String FILE_SEPARATOR
public static final boolean DEBUG
public static final java.lang.Object[] EMPTY_OBJECT_ARRAY
public static final java.lang.Class[] EMPTY_CLASS_ARRAY
public static final boolean ISJDK_14
public static final boolean IS_WINDOWS_OS
| Constructor Detail |
public Util()
| Method Detail |
public static void info(java.lang.Object pMsg)
public static void log(java.lang.Object pMsg)
public static void warn(java.lang.Object pMsg)
public static void error(java.lang.Throwable t)
public static void debug(java.lang.Throwable t)
public static void assertWithMessage(java.lang.Object pMsg)
public static void dumpStack()
public static int getCurrentYear()
public static int getCurrentMonth()
public static int getCurrentDayOfMonth()
public static java.io.File[] locateFile(java.lang.String pName,
java.lang.String pSearchPath,
boolean pMustBeFile)
pName - Name of the file to search forpSearchPath - Search path to search in. The seperation of each entry is platform dependent
(see java.io.File.pathSeparator for details)pMustBeFile - If set, this method ignores matching directories
public static java.lang.String enum2String(java.util.Enumeration v)
public static void copyFile(java.lang.String sourceFile,
java.lang.String destFile)
throws java.io.IOException
java.io.IOException
public static void copyFile(java.lang.String sourceFile,
java.lang.String destFile,
boolean overwrite)
throws java.io.IOException
java.io.IOException
public static void copyFile(java.io.File sourceFile,
java.io.File destFile,
boolean overwrite,
boolean preserveLastModified)
throws java.io.IOException
destFile file should be made equal
to the last modified time of sourceFile.
java.io.IOException
public static void setFileLastModified(java.io.File file,
long time)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String findRelativeDirectory(java.lang.String pFilepath)
public static java.lang.String findRelativeDirectory(java.lang.String pRefPath,
java.lang.String pOtherPath)
pRefPath - Reference pathpOtherPath - Path to search a relative path forpublic static java.lang.String exception2String(java.lang.Throwable e)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||