|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.URLConnection
org.apache.sling.launchpad.base.impl.ContextConnection
public class ContextConnection
The ContextConnection
extends the
java.net.URLConnection
to provide access to a resource which
is available from LaunchpadContentProvider
provided to Sling
.
This class is implemented by actually connecting to a resource URL which is
provided by the resource provider and delegating the relevant method calls.
Currently only getContentLength()
, getContentType()
,
getInputStream()
and getLastModified()
are supported.
Field Summary |
---|
Fields inherited from class java.net.URLConnection |
---|
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches |
Method Summary | |
---|---|
void |
connect()
Accesses the the resource from the underlaying resource provider at the URL's path. |
int |
getContentLength()
Returns the length in bytes of the resource or -1 if this connection has not been connected yet. |
String |
getContentType()
Returns a guess at the content type of the resource or null
if this connection has not been connected yet. |
InputStream |
getInputStream()
Returns a InputStream on the resource. |
long |
getLastModified()
Returns the last modification timestamp of the resource or -1 if this connection has not been connected yet. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void connect() throws IOException
connect
in class URLConnection
IOException
public int getContentLength()
getContentLength
in class URLConnection
public String getContentType()
null
if this connection has not been connected yet.
getContentType
in class URLConnection
public InputStream getInputStream() throws IOException
InputStream
on the resource. If this connection
is not connected yet, the conneciton is opened.
getInputStream
in class URLConnection
IOException
- may be thrown if an error occurrs opening the
connection or accessing the content as an
InputStream
.public long getLastModified()
getLastModified
in class URLConnection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |