Package net.ontopia.utils
Class StreamUtils
- java.lang.Object
-
- net.ontopia.utils.StreamUtils
-
public class StreamUtils extends Object
INTERNAL: Utilities for working with streams and readers.- Since:
- 1.3.3
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLASSPATH_PREFIX
static String
FILE_PREFIX
-
Constructor Summary
Constructors Constructor Description StreamUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static InputStream
getInputStream(File basedir, String name)
INTERNAL: Returns an input stream for the given url.static InputStream
getInputStream(String name)
INTERNAL: Same as getInputStream(null, name);static URL
getResource(String name)
INTERNAL: Returns an input stream for the given url.
-
-
-
Field Detail
-
CLASSPATH_PREFIX
public static final String CLASSPATH_PREFIX
- See Also:
- Constant Field Values
-
FILE_PREFIX
public static final String FILE_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInputStream
public static InputStream getInputStream(String name) throws IOException
INTERNAL: Same as getInputStream(null, name);- Throws:
IOException
- Since:
- 3.4.3
-
getInputStream
public static InputStream getInputStream(File basedir, String name) throws IOException
INTERNAL: Returns an input stream for the given url. Supports file: and classpath:. If no scheme given then file system will be checked before classpath. Exception will be thrown if resource is not found when scheme is given. If no scheme was given null is returned. File references will be interpreted relative to basedir. If basedir is null, it will be ignored.- Throws:
IOException
- Since:
- 5.1.1
-
getResource
public static URL getResource(String name) throws IOException
INTERNAL: Returns an input stream for the given url. Supports file: and classpath:. If no schema given then file system will be checked before classpath. Exception will be thrown if resource is not found when schema is given. If no schema was given null is returned.- Throws:
IOException
- Since:
- 3.4.3
-
-