Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.mail.util
Class MailboxURLConnection  view MailboxURLConnection download MailboxURLConnection.java

java.lang.Object
  extended byjava.net.URLConnection
      extended bygnu.mail.util.MailboxURLConnection

public class MailboxURLConnection
extends java.net.URLConnection

A URLConnection that can be used to access mailboxes using the JavaMail API.

Version:
$Revision: 1.1 $ $Date: 2004/05/27 09:11:44 $

Nested Class Summary
(package private) static class MailboxURLConnection.FolderWriter
           
(package private) static class MailboxURLConnection.MessageWriter
           
 
Field Summary
protected  javax.mail.Folder folder
          The mail folder.
private  java.util.List headerKeys
           
protected  java.util.Map headers
          The headers to return.
protected  javax.mail.Message message
          The mail message, if the URL represents a message.
protected  javax.mail.Store store
          The mail store.
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
MailboxURLConnection(java.net.URL url)
          Constructs a new mailbox URL connection using the specified URL.
 
Method Summary
protected static javax.mail.URLName asURLName(java.net.URL url)
          Converts a URL into a URLName.
 void connect()
          Connects to the mailbox.
 java.lang.Object getContent()
          This method returns the content of the document pointed to by the URL as an Object.
 java.lang.String getHeaderField(int index)
          Return a String representing the header value at the specified index.
 java.lang.String getHeaderField(java.lang.String name)
          Returns a String representing the value of the header field having the named key.
 java.lang.String getHeaderFieldKey(int index)
          Returns a String representing the header key at the specified index.
 java.util.Map getHeaderFields()
          Returns an unmodifiable Map containing all sent header fields.
 java.io.InputStream getInputStream()
          Returns an InputStream for this connection.
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderFieldDate, getHeaderFieldInt, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

store

protected javax.mail.Store store
The mail store.


folder

protected javax.mail.Folder folder
The mail folder.


message

protected javax.mail.Message message
The mail message, if the URL represents a message.


headers

protected java.util.Map headers
The headers to return.


headerKeys

private java.util.List headerKeys
Constructor Detail

MailboxURLConnection

public MailboxURLConnection(java.net.URL url)
Constructs a new mailbox URL connection using the specified URL.

Method Detail

connect

public void connect()
             throws java.io.IOException
Connects to the mailbox.


getHeaderField

public java.lang.String getHeaderField(int index)
Description copied from class: java.net.URLConnection
Return a String representing the header value at the specified index. This allows the caller to walk the list of header fields. The analogous URLConnection.getHeaderField(int)>URLConnection.getHeaderField(int) 55 method allows access to the corresponding key for this header field


getHeaderFieldKey

public java.lang.String getHeaderFieldKey(int index)
Description copied from class: java.net.URLConnection
Returns a String representing the header key at the specified index. This allows the caller to walk the list of header fields. The analogous URLConnection.getHeaderField(int)>URLConnection.getHeaderField(int) 55 method allows access to the corresponding value for this tag.


getHeaderField

public java.lang.String getHeaderField(java.lang.String name)
Description copied from class: java.net.URLConnection
Returns a String representing the value of the header field having the named key. Returns null if the header field does not exist.


getHeaderFields

public java.util.Map getHeaderFields()
Description copied from class: java.net.URLConnection
Returns an unmodifiable Map containing all sent header fields.


getContent

public java.lang.Object getContent()
                            throws java.io.IOException
Description copied from class: java.net.URLConnection
This method returns the content of the document pointed to by the URL as an Object. The type of object depends on the MIME type of the object and particular content hander loaded. Most text type content handlers will return a subclass of InputStream. Images usually return a class that implements ImageProducer. There is not guarantee what type of object will be returned, however.

This class first determines the MIME type of the content, then creates a ContentHandler object to process the input. If the ContentHandlerFactory is set, then that object is called to load a content handler, otherwise a class called gnu.java.net.content.<content_type> is tried. If this handler does not exist, the method will simple return the InputStream returned by getInputStream(). Note that the default implementation of getInputStream() throws a UnknownServiceException so subclasses are encouraged to override this method.


getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from class: java.net.URLConnection
Returns an InputStream for this connection. As this default implementation returns null, subclasses should override this method


asURLName

protected static javax.mail.URLName asURLName(java.net.URL url)
Converts a URL into a URLName.