public class ResourceInput extends StreamInput
Class.getResourceAsStream(String)
.Constructor and Description |
---|
ResourceInput(Class<?> base,
String resource)
Creates an input object opening the given
resource using
Class.getResourceAsStream(String) with the given base class. |
ResourceInput(String resource)
Creates an input object opening the given
resource using
Class.getResourceAsStream(String) with ResourceInput ase
base class. |
close, hasMoreLines, readLine
iterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ResourceInput(String resource)
resource
using
Class.getResourceAsStream(String)
with ResourceInput
ase
base class.resource
- a path to the file on the classpath; if the file is in the
root directory, the filename should be prefixed with a forward
slash, e.g.: "/test-file.txt"
; if the file is in a
package, then the package should be specified prefixed with a
forward slash, and with each dot "." replaced with a forward
slash. e.g.: "/org/company/mypackage/test-file.txt"
Class.getResource(String)
,
Class.getResourceAsStream(String)
public ResourceInput(Class<?> base, String resource)
resource
using
Class.getResourceAsStream(String)
with the given base class.base
- the base class used to load the resourceresource
- a path to the file on the classpath; if the file is in the
root directory, the filename should be prefixed with a forward
slash, e.g.: "/test-file.txt"
; if the file is in a
package, then the package should be specified prefixed with a
forward slash, and with each dot "." replaced with a forward
slash. e.g.: "/org/company/mypackage/test-file.txt"
Class.getResource(String)
,
Class.getResourceAsStream(String)
Copyright © 2024. All rights reserved.