gnu.mail.util
Class MailboxURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by gnu.mail.util.MailboxURLConnection

public class MailboxURLConnection
extends java.net.URLConnection

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


Field Summary
protected  Folder folder
          The mail folder.
protected  java.util.Map headers
          The headers to return.
protected  Message message
          The mail message, if the URL represents a message.
protected  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 URLName asURLName(java.net.URL url)
          Converts a URL into a URLName.
 void connect()
          Connects to the mailbox.
 java.lang.Object getContent()
           
 java.lang.String getHeaderField(int index)
           
 java.lang.String getHeaderField(java.lang.String name)
           
 java.lang.String getHeaderFieldKey(int index)
           
 java.util.Map getHeaderFields()
           
 java.io.InputStream getInputStream()
           
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderFieldDate, getHeaderFieldInt, getIfModifiedSince, 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 inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

store

protected Store store
The mail store.


folder

protected Folder folder
The mail folder.


message

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


headers

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

Constructor Detail

MailboxURLConnection

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

Parameters:
url - the URL representing the mailbox to connect to
Method Detail

connect

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

Specified by:
connect in class java.net.URLConnection
Throws:
java.io.IOException

getHeaderField

public java.lang.String getHeaderField(int index)
Overrides:
getHeaderField in class java.net.URLConnection

getHeaderFieldKey

public java.lang.String getHeaderFieldKey(int index)
Overrides:
getHeaderFieldKey in class java.net.URLConnection

getHeaderField

public java.lang.String getHeaderField(java.lang.String name)
Overrides:
getHeaderField in class java.net.URLConnection

getHeaderFields

public java.util.Map getHeaderFields()
Overrides:
getHeaderFields in class java.net.URLConnection

getContent

public java.lang.Object getContent()
                            throws java.io.IOException
Overrides:
getContent in class java.net.URLConnection
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Overrides:
getInputStream in class java.net.URLConnection
Throws:
java.io.IOException

asURLName

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