Save This Page
Home » » » [javadoc | source]
public class: ContextConnection [javadoc | source]
The ContextConnection extends the to provide access to a resource which is available from ResourceProvider 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.
Fields inherited from
url,  doInput,  doOutput,  allowUserInteraction,  useCaches,  ifModifiedSince,  connected,  factory
 ContextConnection(URL url,
    ResourceProvider resourceProvider) 
    Creates an instance of this context connection.
    url - The original URL whose path part is used to address the resource from the resource provider.
    resourceProvider - The ResourceProvider to which requests for content access are delegated.
Method from Summary:
connect,   getContentLength,   getContentType,   getInputStream,   getLastModified
Methods from
access$000,   addRequestProperty,   connect,   getAllowUserInteraction,   getConnectTimeout,   getContent,   getContent,   getContentEncoding,   getContentHandler,   getContentLength,   getContentType,   getDate,   getDefaultAllowUserInteraction,   getDefaultRequestProperty,   getDefaultUseCaches,   getDoInput,   getDoOutput,   getExpiration,   getFileNameMap,   getHeaderField,   getHeaderField,   getHeaderFieldDate,   getHeaderFieldInt,   getHeaderFieldKey,   getHeaderFields,   getIfModifiedSince,   getInputStream,   getLastModified,   getOutputStream,   getPermission,   getReadTimeout,   getRequestProperties,   getRequestProperty,   getURL,   getUseCaches,   guessContentTypeFromName,   guessContentTypeFromStream,   setAllowUserInteraction,   setConnectTimeout,   setContentHandlerFactory,   setDefaultAllowUserInteraction,   setDefaultRequestProperty,   setDefaultUseCaches,   setDoInput,   setDoOutput,   setFileNameMap,   setIfModifiedSince,   setReadTimeout,   setRequestProperty,   setUseCaches,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from Detail:
 public  void connect() throws IOException 
    Accesses the the resource from the underlaying resource provider at the URL's path.
 public int getContentLength() 
    Returns the length in bytes of the resource or -1 if this connection has not been connected yet.
 public String getContentType() 
    Returns a guess at the content type of the resource or null if this connection has not been connected yet.
 public InputStream getInputStream() throws IOException 
    Returns a InputStream on the resource. If this connection is not connected yet, the conneciton is opened.
 public long getLastModified() 
    Returns the last modification timestamp of the resource or -1 if this connection has not been connected yet.