|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jasperreports.engine.util.JRLoader
public class JRLoader
Constructor Summary | |
---|---|
JRLoader()
|
Method Summary | |
---|---|
protected static void |
collectResources(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
java.util.Set resources)
|
static java.io.InputStream |
getFileInputStream(java.lang.String filename)
Tries to open a file for reading. |
static java.io.InputStream |
getLocationInputStream(java.lang.String location)
Tries to open an input stream for a location. |
static java.net.URL |
getResource(java.lang.String resource)
Returns the resource URL for a specified resource name. |
static java.io.InputStream |
getResourceInputStream(java.lang.String resource)
Tries to open an input stream for a resource. |
static java.util.List |
getResources(java.lang.String resource)
Scans the context classloader and the classload of this class for all resources that have a specified name, and returns a list of URL s for the found resources. |
static java.io.InputStream |
getURLInputStream(java.lang.String spec)
Tries to open an input stream for an URL. |
static byte[] |
loadBytes(java.io.File file)
|
static byte[] |
loadBytes(java.io.InputStream is)
|
static byte[] |
loadBytes(java.net.URL url)
|
static byte[] |
loadBytesFromLocation(java.lang.String location)
|
static byte[] |
loadBytesFromLocation(java.lang.String location,
java.lang.ClassLoader classLoader)
|
static byte[] |
loadBytesFromLocation(java.lang.String location,
java.lang.ClassLoader classLoader,
java.net.URLStreamHandlerFactory urlHandlerFactory)
|
static byte[] |
loadBytesFromLocation(java.lang.String location,
java.lang.ClassLoader classLoader,
java.net.URLStreamHandlerFactory urlHandlerFactory,
FileResolver fileResolver)
|
static java.lang.Object |
loadObject(java.io.File file)
|
static java.lang.Object |
loadObject(java.io.InputStream is)
|
static java.lang.Object |
loadObject(java.lang.String fileName)
|
static java.lang.Object |
loadObject(java.net.URL url)
|
static java.lang.Object |
loadObjectFromLocation(java.lang.String location)
|
static java.lang.Object |
loadObjectFromLocation(java.lang.String location,
java.lang.ClassLoader classLoader)
|
static java.lang.Object |
loadObjectFromLocation(java.lang.String location,
java.lang.ClassLoader classLoader,
java.net.URLStreamHandlerFactory urlHandlerFactory,
FileResolver fileResolver)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JRLoader()
Method Detail |
---|
public static java.lang.Object loadObject(java.lang.String fileName) throws JRException
JRException
public static java.lang.Object loadObject(java.io.File file) throws JRException
JRException
public static java.lang.Object loadObject(java.net.URL url) throws JRException
JRException
public static java.lang.Object loadObject(java.io.InputStream is) throws JRException
JRException
public static java.lang.Object loadObjectFromLocation(java.lang.String location) throws JRException
JRException
public static java.lang.Object loadObjectFromLocation(java.lang.String location, java.lang.ClassLoader classLoader) throws JRException
JRException
public static java.lang.Object loadObjectFromLocation(java.lang.String location, java.lang.ClassLoader classLoader, java.net.URLStreamHandlerFactory urlHandlerFactory, FileResolver fileResolver) throws JRException
JRException
public static byte[] loadBytes(java.io.File file) throws JRException
JRException
public static byte[] loadBytes(java.net.URL url) throws JRException
JRException
public static byte[] loadBytes(java.io.InputStream is) throws JRException
JRException
public static byte[] loadBytesFromLocation(java.lang.String location) throws JRException
JRException
public static byte[] loadBytesFromLocation(java.lang.String location, java.lang.ClassLoader classLoader) throws JRException
JRException
public static byte[] loadBytesFromLocation(java.lang.String location, java.lang.ClassLoader classLoader, java.net.URLStreamHandlerFactory urlHandlerFactory) throws JRException
JRException
public static byte[] loadBytesFromLocation(java.lang.String location, java.lang.ClassLoader classLoader, java.net.URLStreamHandlerFactory urlHandlerFactory, FileResolver fileResolver) throws JRException
JRException
public static java.io.InputStream getLocationInputStream(java.lang.String location) throws JRException
The method tries to interpret the location as a file name, a resource name or an URL. If any of these succeed, an input stream is created and returned.
location
- the location
null
otherwise.
JRException
public static java.io.InputStream getFileInputStream(java.lang.String filename) throws JRException
filename
- the file name
null
if the file was not found
JRException
public static java.io.InputStream getResourceInputStream(java.lang.String resource)
resource
- the resource name
null
if the resource was not foundpublic static java.util.List getResources(java.lang.String resource)
URL
s for the found resources.
resource
- the resource names
URL
s of resources with the specified name;
the list is empty if no resources have been found for the nameClassLoader.getResources(String)
protected static void collectResources(java.lang.String resourceName, java.lang.ClassLoader classLoader, java.util.Set resources)
public static java.net.URL getResource(java.lang.String resource)
resource
- the resource name
null
if none foundClassLoader.getResource(String)
public static java.io.InputStream getURLInputStream(java.lang.String spec) throws JRException
spec
- the string to parse as an URL
spec
is not a valid URL
JRException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |