public class ThreadUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.net.URL |
getCurrentThreadResource(java.lang.String relativePath) |
static java.io.InputStream |
getCurrentThreadResourceAsStream(java.lang.String relativePath) |
static void |
sleepUnchecked(long millis)
It wraps a thread-sleep execution in a try-catch block and rethrow a
RuntimeException.RuntimeException(Throwable)
if any exception is thrown. |
public static void sleepUnchecked(long millis)
RuntimeException.RuntimeException(Throwable)
if any exception is thrown.millis - the time in milliseconds to sleep the current thread.Thread.sleep(long)public static java.io.InputStream getCurrentThreadResourceAsStream(java.lang.String relativePath)
relativePath - the resource relative path.ClassLoader.getResourceAsStream(String),
Thread.getContextClassLoader(),
Thread.currentThread()public static java.net.URL getCurrentThreadResource(java.lang.String relativePath)
relativePath - the resource relative path.ClassLoader.getResource(String),
Thread.getContextClassLoader(),
Thread.currentThread()