|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.uva.vlet.util.ResourceLoader
public class ResourceLoader
Alternative ResourceLoader which supports VRLs and URIs. Note: since this class might be used at init time, the VRS/Registry can't be used ! To be compatible with 'applet' mode an be usefull at init time, the URL class is used to provide input streams. If the Registry is properly initialezed URL class can handle VRLs, if not it will defaul to standaard URLs (And exception will be trown is the VRL is not an URL).
Field Summary | |
---|---|
static java.lang.String |
CHARSET_ISO_8859_1
8-bits US/Euro 'standard' encoding |
static java.lang.String |
CHARSET_LATIN
Same as ISO-8859-1 |
static java.lang.String |
CHARSET_US_ASCII
7-bits (US) Ascii, mother of all ASCII's |
static java.lang.String |
CHARSET_UTF16BE
|
static java.lang.String |
CHARSET_UTF16LE
|
static java.lang.String |
CHARSET_UTF8
|
static java.lang.String |
DEFAULT_CHARSET
|
Constructor Summary | |
---|---|
ResourceLoader()
|
Method Summary | |
---|---|
static javax.swing.ImageIcon |
getIcon(java.lang.String vrl)
Just fetch uncached icon from specified (relative) url or full path. |
static javax.swing.Icon |
getIconOrDefault(java.lang.String url)
|
static java.awt.Image |
getImage(java.lang.String url)
Load (a)synchronously an image specified by VRL URI. |
static java.io.InputStream |
getInputstream(java.lang.String urlstr)
Tries to load resource from relative or absolute url: - get current classLoader to resource 'urlstr' - get thread classload to resolve 'urlstr' - tries if urlstr is an absolute url and performs openConnection().getInputStream() |
static java.io.InputStream |
getInputstream(VRL uri)
Returns an inputstream from the specified URI. |
static java.io.OutputStream |
getOutputStream(java.lang.String locstr)
|
static java.io.OutputStream |
getOutputStream(VRL vrl)
|
static java.lang.String |
getText(java.io.InputStream inps,
int maxSize,
java.lang.String charset)
Read text from input stream in encoding 'charset'. |
static java.lang.String |
getText(java.io.InputStream inps,
java.lang.String charset)
|
static java.lang.String |
getText(VNode node)
|
static java.lang.String |
getText(VRL loc)
|
static java.lang.String |
getText(VRL location,
int maxSize,
java.lang.String charset)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CHARSET_UTF8
public static final java.lang.String CHARSET_UTF16BE
public static final java.lang.String CHARSET_UTF16LE
public static final java.lang.String CHARSET_US_ASCII
public static final java.lang.String CHARSET_ISO_8859_1
public static final java.lang.String CHARSET_LATIN
public static final java.lang.String DEFAULT_CHARSET
Constructor Detail |
---|
public ResourceLoader()
Method Detail |
---|
public static java.awt.Image getImage(java.lang.String url)
public static javax.swing.ImageIcon getIcon(java.lang.String vrl)
vrl
-
VlException
public static java.io.InputStream getInputstream(java.lang.String urlstr) throws VlIOException, VlURISyntaxException
urlstr
-
VlIOException
VlURISyntaxException
public static java.io.InputStream getInputstream(VRL uri) throws VlException
uri
-
VlException
public static java.lang.String getText(java.io.InputStream inps, java.lang.String charset) throws VlIOException
VlIOException
public static java.lang.String getText(VRL location, int maxSize, java.lang.String charset) throws VlException
VlException
public static java.lang.String getText(VRL loc) throws VlException
VlException
public static java.lang.String getText(VNode node) throws VlException
VlException
public static java.lang.String getText(java.io.InputStream inps, int maxSize, java.lang.String charset) throws VlIOException
inps
- charset
-
VlIOException
public static java.io.OutputStream getOutputStream(java.lang.String locstr) throws VlException
VlException
public static java.io.OutputStream getOutputStream(VRL vrl) throws VlException
VlException
public static javax.swing.Icon getIconOrDefault(java.lang.String url)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |