| Constructor and Description |
|---|
IoUtil() |
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
getInputStream(Class<?> cls,
String path)
This method attempts to create an input stream from the given path by:
Trying to parse it as a URL
Trying to find it on the classpath, relative to the given class
Trying to find it as a file on the file system
|
public IoUtil()
public static InputStream getInputStream(Class<?> cls, String path) throws IOException
cls - this will generally be the class of the caller.path - should be the path of a resource on the classpath (e.g. "/models/en-sent.bin") or the
path of a file on the local file system (e.g. "src/main/resources/models/en-sent.bin")IOException - if the path was not found as a URL, resource or file.Copyright © 2014. All rights reserved.