public final class SystemUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SystemUtil.TemplateLine |
Modifier and Type | Field and Description |
---|---|
static int |
ARCH_32 |
static int |
ARCH_64 |
static int |
ARCH_UNKNOW |
static char |
CHAR_DOLLAR |
static char |
CHAR_EURO |
static char |
CHAR_POUND |
static int |
ERR |
static int |
JAVA_VERSION |
static int |
JAVA_VERSION_1_0 |
static int |
JAVA_VERSION_1_1 |
static int |
JAVA_VERSION_1_2 |
static int |
JAVA_VERSION_1_3 |
static int |
JAVA_VERSION_1_4 |
static int |
JAVA_VERSION_1_5 |
static int |
JAVA_VERSION_1_6 |
static int |
JAVA_VERSION_1_7 |
static int |
JAVA_VERSION_1_8 |
static int |
JAVA_VERSION_1_9 |
static int |
jreArch |
static int |
MEMORY_TYPE_ALL |
static int |
MEMORY_TYPE_HEAP |
static int |
MEMORY_TYPE_NON_HEAP |
static int |
osArch |
static int |
OUT |
Constructor and Description |
---|
SystemUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
addPlaceHolder(Resource file,
Config config,
String defaultValue) |
static String |
addPlaceHolder(Resource file,
String defaultValue) |
static String |
fixWindowsPath(String path)
fixes a java canonical path to a Windows path
e.g.
|
static int |
getAddressSize() |
static long |
getAvailableMemory() |
static Charset |
getCharset() |
static Resource |
getClassLoadeDirectory() |
static Resource[] |
getClassPathes() |
static double |
getCpuUsage(long time) |
static SystemUtil.TemplateLine |
getCurrentContext() |
static long |
getFreeBytes() |
static int |
getFreePermGenSpacePromille() |
static long |
getFreePermGenSpaceSize() |
static Resource |
getHomeDirectory()
returns the Hoome Directory of the System
|
static int |
getJREArch()
return the JRE (Java Runtime Engine) architecture, this can be different from the operating system architecture
|
static double |
getLoaderVersion() |
static String |
getMacAddress() |
static Query |
getMemoryUsageAsQuery(int type) |
static Struct |
getMemoryUsageAsStruct(int type) |
static Struct |
getMemoryUsageCompact(int type) |
static int |
getOSArch()
return the operating system architecture
|
static String |
getOSSpecificLineSeparator() |
static int |
getPermGenFreeSpaceAsAPercentageOfAvailable() |
static MemoryPoolMXBean |
getPermGenSpaceBean() |
static PrintWriter |
getPrintWriter(int type) |
static String |
getPropertyEL(String key) |
static Resource |
getRuningContextRoot() |
static Resource |
getSystemDirectory() |
static Resource |
getTempDirectory()
returns the Temp Directory of the System
|
static Resource |
getTempFile(String extension,
boolean touch)
returns the a unique temp file (with no auto delete)
|
static long |
getTotalBytes() |
static long |
getUsedMemory() |
static String |
hash(javax.servlet.ServletContext sc) |
static boolean |
isCLICall() |
static boolean |
isFSCaseSensitive()
returns if the file system case sensitive or not
|
static boolean |
isUnix() |
static boolean |
isWindows() |
static void |
join(Thread t) |
static long |
microTime() |
static void |
notify(Object lock)
locks the object (synchronized) before calling notify
|
static void |
notifyAll(Object lock)
locks the object (synchronized) before calling notifyAll
|
static String |
parsePlaceHolder(String path)
replace path placeholder with the real path, placeholders are [{temp-directory},{system-directory},{home-directory}]
|
static String |
parsePlaceHolder(String path,
javax.servlet.ServletContext sc) |
static String |
parsePlaceHolder(String path,
javax.servlet.ServletContext sc,
Map<String,String> labels) |
static void |
setCharset(Charset charset) |
static void |
setCharset(String charset) |
static void |
setPrintWriter(int type,
PrintWriter pw) |
static void |
sleep(int time) |
static void |
sleep(long time) |
static void |
stop(PageContext pc,
Log log) |
static void |
stop(PageContext pc,
Throwable t,
Log log) |
static void |
stop(Thread thread,
Log log)
Deprecated.
|
static void |
wait(Object lock)
locks the object (synchronized) before calling wait (no timeout)
|
static void |
wait(Object lock,
long timeout)
locks the object (synchronized) before calling wait
|
public static final int MEMORY_TYPE_ALL
public static final int MEMORY_TYPE_HEAP
public static final int MEMORY_TYPE_NON_HEAP
public static final int ARCH_UNKNOW
public static final int ARCH_32
public static final int ARCH_64
public static final char CHAR_DOLLAR
public static final char CHAR_POUND
public static final char CHAR_EURO
public static final int JAVA_VERSION_1_0
public static final int JAVA_VERSION_1_1
public static final int JAVA_VERSION_1_2
public static final int JAVA_VERSION_1_3
public static final int JAVA_VERSION_1_4
public static final int JAVA_VERSION_1_5
public static final int JAVA_VERSION_1_6
public static final int JAVA_VERSION_1_7
public static final int JAVA_VERSION_1_8
public static final int JAVA_VERSION_1_9
public static final int OUT
public static final int ERR
public static final int JAVA_VERSION
public static int osArch
public static int jreArch
public SystemUtil()
public static MemoryPoolMXBean getPermGenSpaceBean()
public static boolean isFSCaseSensitive()
public static String fixWindowsPath(String path)
path
- public static boolean isWindows()
public static boolean isUnix()
public static Resource getSystemDirectory()
public static Resource getRuningContextRoot()
public static Resource getTempDirectory()
public static Resource getTempFile(String extension, boolean touch) throws IOException
extension
- IOException
public static Resource getHomeDirectory()
public static Resource getClassLoadeDirectory()
public static Resource[] getClassPathes()
public static long getUsedMemory()
public static long getAvailableMemory()
public static String parsePlaceHolder(String path)
path
- public static String addPlaceHolder(Resource file, String defaultValue)
public static String addPlaceHolder(Resource file, Config config, String defaultValue)
public static String parsePlaceHolder(String path, javax.servlet.ServletContext sc, Map<String,String> labels)
public static String parsePlaceHolder(String path, javax.servlet.ServletContext sc)
public static Charset getCharset()
public static void setCharset(String charset)
public static void setCharset(Charset charset)
public static String getOSSpecificLineSeparator()
public static void sleep(int time)
public static void sleep(long time)
public static void wait(Object lock, long timeout)
lock
- timeout
- InterruptedException
public static void wait(Object lock)
lock
- InterruptedException
public static void notify(Object lock)
lock
- timeout
- InterruptedException
public static void notifyAll(Object lock)
lock
- timeout
- InterruptedException
public static int getOSArch()
public static int getJREArch()
public static int getAddressSize()
public static long getFreePermGenSpaceSize()
public static int getPermGenFreeSpaceAsAPercentageOfAvailable()
public static int getFreePermGenSpacePromille()
public static Query getMemoryUsageAsQuery(int type) throws DatabaseException
DatabaseException
public static Struct getMemoryUsageAsStruct(int type)
public static Struct getMemoryUsageCompact(int type)
public static String getPropertyEL(String key)
public static long microTime()
public static SystemUtil.TemplateLine getCurrentContext()
public static long getFreeBytes() throws ApplicationException
ApplicationException
public static long getTotalBytes() throws ApplicationException
ApplicationException
public static double getCpuUsage(long time) throws ApplicationException
ApplicationException
public static void setPrintWriter(int type, PrintWriter pw)
public static PrintWriter getPrintWriter(int type)
public static boolean isCLICall()
public static double getLoaderVersion()
public static String getMacAddress()
@Deprecated public static void stop(Thread thread, Log log)
public static void stop(PageContext pc, Log log)
public static void stop(PageContext pc, Throwable t, Log log)
Copyright © 2015 Lucee