|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ckkloverdos.resource.ClassLoaderResource
public class ClassLoaderResource
A resource obtained from a class loader. The underlying implementation is URL-based.
Constructor Summary | |
---|---|
ClassLoaderResource(java.net.URL url)
Contructs a new resource whose URL is the provided one. |
Method Summary | |
---|---|
boolean |
exists()
Returns true iff the underlying URL is not null . |
java.io.File |
getFile()
Returns a file object generated from the path of the
underlying URL. |
java.io.InputStream |
getInputStream()
Returns the input stream as obtained from the underlying URL. |
java.lang.String |
getName()
Returns the string representation of the underlying resource URL. |
java.net.URL |
getURL()
Returns the underlying URL. |
boolean |
isFile()
Returns true iff the protocol
of the underlying URL is "file" . |
java.lang.String |
toString()
|
void |
toStringAware(ToString ts)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClassLoaderResource(java.net.URL url)
ClassLoader.getResource(String)
.
url
- Method Detail |
---|
public java.lang.String getName()
getName
in interface IResource
public java.net.URL getURL()
getURL
in interface IResource
public java.io.InputStream getInputStream() throws java.io.IOException
null
is returned.
getInputStream
in interface IResource
java.io.IOException
public boolean exists()
true
iff the underlying URL is not null
.
exists
in interface IResource
public boolean isFile()
true
iff the protocol
of the underlying URL is "file"
.
isFile
in interface IResource
public java.io.File getFile()
path
of the
underlying URL. If this resource doesnot represent a file, then null
is returned.
getFile
in interface IResource
public java.lang.String toString()
toString
in class java.lang.Object
public void toStringAware(ToString ts)
toStringAware
in interface IToStringAware
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |