@Evolving
public class ThreadUtil
extends java.lang.Object
| Constructor | Description |
|---|---|
ThreadUtil() |
| Modifier and Type | Method | Description |
|---|---|---|
static java.io.InputStream |
getResourceAsStream(java.lang.ClassLoader cl,
java.lang.String resourceName) |
Convenience method that returns a resource as inputstream from the
classpath using given classloader.
|
static java.io.InputStream |
getResourceAsStream(java.lang.String resourceName) |
Convenience method that returns a resource as inputstream from the
classpath.
|
static void |
joinUninterruptibly(java.lang.Thread toJoin) |
Join a thread as uninterruptible.
|
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 void joinUninterruptibly(java.lang.Thread toJoin)
InterruptedException then will re-interrupt
the thread.toJoin - the thread to Join on.public static java.io.InputStream getResourceAsStream(java.lang.String resourceName)
throws java.io.IOException
Uses the Thread's context classloader to load resource.
resourceName - resource to retrieve.java.io.IOException - thrown if resource cannot be loadedpublic static java.io.InputStream getResourceAsStream(java.lang.ClassLoader cl,
java.lang.String resourceName)
throws java.io.IOException
cl - ClassLoader to be used to retrieve resource.resourceName - resource to retrieve.java.io.IOException - thrown if resource cannot be loadedCopyright © 2008–2025 Apache Software Foundation. All rights reserved.