@InterfaceStability.Evolving public class ThreadUtil extends Object
Constructor and Description |
---|
ThreadUtil() |
Modifier and Type | Method and Description |
---|---|
static InputStream |
getResourceAsStream(String resourceName)
Convenience method that returns a resource as inputstream from the
classpath.
|
static void |
sleepAtLeastIgnoreInterrupts(long millis)
Cause the current thread to sleep as close as possible to the provided
number of milliseconds.
|
public static void sleepAtLeastIgnoreInterrupts(long millis)
InterruptedException
encountered.millis
- the number of milliseconds for the current thread to sleeppublic static InputStream getResourceAsStream(String resourceName) throws IOException
It first attempts to use the Thread's context classloader and if not set it uses the class' classloader.
resourceName
- resource to retrieve.IOException
- thrown if resource cannot be loadedCopyright © 2008–2018 Apache Software Foundation. All rights reserved.