org.apache.naming.resources

Class DirContextURLConnection

public class DirContextURLConnection extends URLConnection

Connection to a JNDI directory context.

Note: All the object attribute names are the WebDAV names, not the HTTP names, so this class overrides some methods from URLConnection to do the queries using the right names. Content handler is also not used; the content is directly returned.

Version: $Revision: 666821 $

Author: Remy Maucherat

Field Summary
protected Attributesattributes
Attributes.
protected DirContextcollection
Associated DirContext.
protected DirContextcontext
Directory context.
protected longdate
Date.
protected Objectobject
Other unknown object.
protected Permissionpermission
Permission
protected Resourceresource
Associated resource.
Constructor Summary
DirContextURLConnection(DirContext context, URL url)
Method Summary
voidconnect()
Connect to the DirContext, and retrive the bound object, as well as its attributes.
ObjectgetContent()
Get object content.
ObjectgetContent(Class[] classes)
Get object content.
intgetContentLength()
Return the content length value.
StringgetContentType()
Return the content type value.
longgetDate()
Return the last modified date.
StringgetHeaderField(String name)
Returns the name of the specified header field.
MapgetHeaderFields()
Returns an unmodifiable Map of the header fields.
protected StringgetHeaderValueAsString(Object headerValue)
InputStreamgetInputStream()
Get input stream.
longgetLastModified()
Return the last modified date.
PermissiongetPermission()
Get the Permission for this URL
Enumerationlist()
List children of this collection.

Field Detail

attributes

protected Attributes attributes
Attributes.

collection

protected DirContext collection
Associated DirContext.

context

protected DirContext context
Directory context.

date

protected long date
Date.

object

protected Object object
Other unknown object.

permission

protected Permission permission
Permission

resource

protected Resource resource
Associated resource.

Constructor Detail

DirContextURLConnection

public DirContextURLConnection(DirContext context, URL url)

Method Detail

connect

public void connect()
Connect to the DirContext, and retrive the bound object, as well as its attributes. If no object is bound with the name specified in the URL, then an IOException is thrown.

Throws: IOException Object not found

getContent

public Object getContent()
Get object content.

getContent

public Object getContent(Class[] classes)
Get object content.

getContentLength

public int getContentLength()
Return the content length value.

getContentType

public String getContentType()
Return the content type value.

getDate

public long getDate()
Return the last modified date.

getHeaderField

public String getHeaderField(String name)
Returns the name of the specified header field.

getHeaderFields

public Map getHeaderFields()
Returns an unmodifiable Map of the header fields.

getHeaderValueAsString

protected String getHeaderValueAsString(Object headerValue)

getInputStream

public InputStream getInputStream()
Get input stream.

getLastModified

public long getLastModified()
Return the last modified date.

getPermission

public Permission getPermission()
Get the Permission for this URL

list

public Enumeration list()
List children of this collection. The names given are relative to this URI's path. The full uri of the children is then : path + "/" + name.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.