org.kuali.rice.core.util
Class RiceUtilities
java.lang.Object
org.kuali.rice.core.util.RiceUtilities
public class RiceUtilities
- extends Object
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RiceUtilities
public RiceUtilities()
getBooleanValueForString
public static boolean getBooleanValueForString(String value,
boolean defaultValue)
collectStackTrace
public static String collectStackTrace(Throwable t)
getIpNumber
public static String getIpNumber()
getCurrentEnvironmentNetworkIp
public static String getCurrentEnvironmentNetworkIp()
- Returns:
- the current environment's IP address, taking into account the Internet connection to any of the available
machine's Network interfaces. Examples of the outputs can be in octatos or in IPV6 format.
fec0:0:0:9:213:e8ff:fef1:b717%4 siteLocal: true isLoopback: false isIPV6: true
============================================ 130.212.150.216 <<<<<<<<<<<------------- This is the one we
want to grab so that we can. siteLocal: false address the DSP on the network. isLoopback: false isIPV6:
false ==> lo ============================================ 0:0:0:0:0:0:0:1%1 siteLocal: false isLoopback:
true isIPV6: true ============================================ 127.0.0.1 siteLocal: false isLoopback:
true isIPV6: false
getHostName
public static String getHostName()
getResourceAsStream
public static InputStream getResourceAsStream(String resourceLoc)
throws MalformedURLException,
IOException
- Attempts to retrieve the resource stream.
- Parameters:
resourceLoc
- resource location; syntax supported by DefaultResourceLoader
- Returns:
- the resource stream or null if the resource could not be obtained
- Throws:
MalformedURLException
IOException
- See Also:
DefaultResourceLoader
findExceptionInStack
public static <T extends Throwable> T findExceptionInStack(Throwable topLevelException,
Class<T> exceptionClass)
- This method searches for an exception of the specified type in the stack trace of the given
exception.
- Parameters:
topLevelException
- the exception whose stack to traverseexceptionClass
- the exception class to look for
- Returns:
- the first instance of an exception of the specified class if found, or null otherwise
Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.