|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.plexus.resource.loader.URLPlexusResource
public class URLPlexusResource
Implementation of PlexusResource
for URL's.
Constructor Summary | |
---|---|
URLPlexusResource(URL url)
|
Method Summary | |
---|---|
File |
getFile()
Returns the resource as a file, if possible. |
InputStream |
getInputStream()
Returns the resource as an InputStream . |
String |
getName()
Returns the resources name, if possible. |
URI |
getURI()
Returns the resources URI, if possible. |
URL |
getURL()
Returns the resources URL, if possible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public URLPlexusResource(URL url)
Method Detail |
---|
public File getFile() throws IOException
PlexusResource
Returns the resource as a file, if possible. A resource doesn't need to be available as a file: If you require a
file, use ResourceManager.getResourceAsFile(PlexusResource)
.
getFile
in interface PlexusResource
File
containing the resources contents, if available, or null.
IOException
public InputStream getInputStream() throws IOException
PlexusResource
Returns the resource as an InputStream
. In general, you should not assume, that this method may me called
more than once. In typical cases (for example, if the Resource is backed by a file or loaded through the
classpath), one may create an InputStream
as often as is necessary. However, you should think of cases
like an URL pointing to a servlet, where the resource contents change with every call.
If you need a reliable way of reloading the resource more than once, then you should use
ResourceManager.getResourceAsFile(PlexusResource)
.
getInputStream
in interface PlexusResource
InputStream
with the resources contents, never null.
IOException
public String getName()
PlexusResource
URL
, the name might be created by invoking URL.toExternalForm()
. In the case of a
File
, it might be File.getPath()
.
getName
in interface PlexusResource
public URI getURI() throws IOException
PlexusResource
Returns the resources URI, if possible. A resource doesn't need to have an URI.
getURI
in interface PlexusResource
IOException
public URL getURL() throws IOException
PlexusResource
Returns the resources URL, if possible. A resource doesn't need to have an URL.
getURL
in interface PlexusResource
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |