net.jini.url.httpmd
Class HttpmdURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by java.net.HttpURLConnection
          extended by net.jini.url.httpmd.DelegatingHttpURLConnection
              extended by net.jini.url.httpmd.HttpmdURLConnection

 class HttpmdURLConnection
extends DelegatingHttpURLConnection

An HTTP URL connection for HTTPMD URLs.

Author:
Sun Microsystems, Inc.

Field Summary
private  String algorithm
          The message digest algorithm.
private  URL content
          The URL specifying the location of the data.
private  byte[] expectedDigest
          The expected message digest for the URL data.
 
Fields inherited from class net.jini.url.httpmd.DelegatingHttpURLConnection
delegateConnection
 
Fields inherited from class java.net.HttpURLConnection
chunkLength, fixedContentLength, HTTP_ACCEPTED, HTTP_BAD_GATEWAY, HTTP_BAD_METHOD, HTTP_BAD_REQUEST, HTTP_CLIENT_TIMEOUT, HTTP_CONFLICT, HTTP_CREATED, HTTP_ENTITY_TOO_LARGE, HTTP_FORBIDDEN, HTTP_GATEWAY_TIMEOUT, HTTP_GONE, HTTP_INTERNAL_ERROR, HTTP_LENGTH_REQUIRED, HTTP_MOVED_PERM, HTTP_MOVED_TEMP, HTTP_MULT_CHOICE, HTTP_NO_CONTENT, HTTP_NOT_ACCEPTABLE, HTTP_NOT_AUTHORITATIVE, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_NOT_MODIFIED, HTTP_OK, HTTP_PARTIAL, HTTP_PAYMENT_REQUIRED, HTTP_PRECON_FAILED, HTTP_PROXY_AUTH, HTTP_REQ_TOO_LONG, HTTP_RESET, HTTP_SEE_OTHER, HTTP_SERVER_ERROR, HTTP_UNAUTHORIZED, HTTP_UNAVAILABLE, HTTP_UNSUPPORTED_TYPE, HTTP_USE_PROXY, HTTP_VERSION, instanceFollowRedirects, method, responseCode, responseMessage
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
HttpmdURLConnection(URL url)
          Creates an HTTP URL connection for an HTTPMD URL.
 
Method Summary
 InputStream getInputStream()
          Returns an input stream that uses MdInputStream to check that the input has the expected message digest.
 URL getURL()
          Returns our URL, not the one for the HTTP connection.
 
Methods inherited from class net.jini.url.httpmd.DelegatingHttpURLConnection
addRequestProperty, connect, disconnect, getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultUseCaches, getDoInput, getDoOutput, getErrorStream, getExpiration, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getInstanceFollowRedirects, getLastModified, getOutputStream, getPermission, getRequestMethod, getRequestProperties, getRequestProperty, getResponseCode, getResponseMessage, getUseCaches, setAllowUserInteraction, setDefaultUseCaches, setDoInput, setDoOutput, setIfModifiedSince, setInstanceFollowRedirects, setRequestMethod, setRequestProperty, setUseCaches, usingProxy
 
Methods inherited from class java.net.HttpURLConnection
getFollowRedirects, setChunkedStreamingMode, setFixedLengthStreamingMode, setFollowRedirects
 
Methods inherited from class java.net.URLConnection
getConnectTimeout, getDefaultAllowUserInteraction, getDefaultRequestProperty, getFileNameMap, getReadTimeout, guessContentTypeFromName, guessContentTypeFromStream, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setFileNameMap, setReadTimeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

algorithm

private final String algorithm
The message digest algorithm.


expectedDigest

private final byte[] expectedDigest
The expected message digest for the URL data.


content

private final URL content
The URL specifying the location of the data.

Constructor Detail

HttpmdURLConnection

HttpmdURLConnection(URL url)
              throws IOException,
                     MalformedURLException
Creates an HTTP URL connection for an HTTPMD URL.

Throws:
IOException
MalformedURLException
Method Detail

getURL

public URL getURL()
Returns our URL, not the one for the HTTP connection.

Overrides:
getURL in class DelegatingHttpURLConnection

getInputStream

public InputStream getInputStream()
                           throws IOException
Returns an input stream that uses MdInputStream to check that the input has the expected message digest.

Overrides:
getInputStream in class DelegatingHttpURLConnection
Throws:
IOException


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.