net.dpml.transit.artifact
Class ArtifactURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by net.dpml.transit.artifact.ArtifactURLConnection

public class ArtifactURLConnection
extends URLConnection

The connection handler for URLs based on the "artifact" protocol family.

Version:
1.1.0
Author:
Digital Product Meta Library

Field Summary
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Method Summary
 void connect()
          Establish a connection.
 Object getContent()
          Return the content for this artifact.
 Object getContent(Class[] classes)
          Return the content for this artifact.
 String getContentType()
          Reutrn the mimetype of the content.
 InputStream getInputStream()
          Return an input stream to the resource.
 OutputStream getOutputStream()
          Return an output stream to the resource.
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContentEncoding, getContentLength, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, 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
 

Method Detail

connect

public void connect()
             throws IOException
Establish a connection. The implementation will attempt to resolve the resource relative to the cache and associated hosts.

Specified by:
connect in class URLConnection
Throws:
IOException - is an error occurs while attempting to establish the connection.

getInputStream

public InputStream getInputStream()
                           throws IOException
Return an input stream to the resource.

Overrides:
getInputStream in class URLConnection
Returns:
the input stream
Throws:
IOException - is an error occurs

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Return an output stream to the resource.

Overrides:
getOutputStream in class URLConnection
Returns:
the output stream
Throws:
IOException - if any I/O problems occur.

getContentType

public String getContentType()
Reutrn the mimetype of the content.

Overrides:
getContentType in class URLConnection
Returns:
the content mimetype

getContent

public Object getContent()
                  throws IOException
Return the content for this artifact.

Overrides:
getContent in class URLConnection
Returns:
the content object (possibly null)
Throws:
IOException - is an error occurs

getContent

public Object getContent(Class[] classes)
                  throws IOException
Return the content for this artifact.

Overrides:
getContent in class URLConnection
Parameters:
classes - a sequence of classes against which the implementation will attempt to establish a known match
Returns:
the content object (possibly null)
Throws:
IOException - is an error occurs