jcifs.http
Class NtlmHttpURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by java.net.HttpURLConnection
          extended by jcifs.http.NtlmHttpURLConnection

public class NtlmHttpURLConnection
extends java.net.HttpURLConnection

Wraps an HttpURLConnection to provide NTLM authentication services. Please read Using jCIFS NTLM Authentication for HTTP Connections.


Field Summary
 
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
NtlmHttpURLConnection(java.net.HttpURLConnection connection)
           
 
Method Summary
 void addRequestProperty(java.lang.String key, java.lang.String value)
           
 void connect()
           
 void disconnect()
           
 boolean getAllowUserInteraction()
           
 java.lang.Object getContent()
           
 java.lang.Object getContent(java.lang.Class[] classes)
           
 java.lang.String getContentEncoding()
           
 int getContentLength()
           
 java.lang.String getContentType()
           
 long getDate()
           
 boolean getDefaultUseCaches()
           
 boolean getDoInput()
           
 boolean getDoOutput()
           
 java.io.InputStream getErrorStream()
           
 long getExpiration()
           
 java.lang.String getHeaderField(int index)
           
 java.lang.String getHeaderField(java.lang.String header)
           
 long getHeaderFieldDate(java.lang.String header, long def)
           
 int getHeaderFieldInt(java.lang.String header, int def)
           
 java.lang.String getHeaderFieldKey(int index)
           
 java.util.Map getHeaderFields()
           
 long getIfModifiedSince()
           
 java.io.InputStream getInputStream()
           
 boolean getInstanceFollowRedirects()
           
 long getLastModified()
           
 java.io.OutputStream getOutputStream()
           
 java.security.Permission getPermission()
           
 java.lang.String getRequestMethod()
           
 java.util.Map getRequestProperties()
           
 java.lang.String getRequestProperty(java.lang.String key)
           
 int getResponseCode()
           
 java.lang.String getResponseMessage()
           
 java.net.URL getURL()
           
 boolean getUseCaches()
           
 void setAllowUserInteraction(boolean allowUserInteraction)
           
 void setDefaultUseCaches(boolean defaultUseCaches)
           
 void setDoInput(boolean doInput)
           
 void setDoOutput(boolean doOutput)
           
 void setIfModifiedSince(long ifModifiedSince)
           
 void setInstanceFollowRedirects(boolean instanceFollowRedirects)
           
 void setRequestMethod(java.lang.String requestMethod)
           
 void setRequestProperty(java.lang.String key, java.lang.String value)
           
 void setUseCaches(boolean useCaches)
           
 java.lang.String toString()
           
 boolean 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NtlmHttpURLConnection

public NtlmHttpURLConnection(java.net.HttpURLConnection connection)
Method Detail

connect

public void connect()
             throws java.io.IOException
Specified by:
connect in class java.net.URLConnection
Throws:
java.io.IOException

getURL

public java.net.URL getURL()
Overrides:
getURL in class java.net.URLConnection

getContentLength

public int getContentLength()
Overrides:
getContentLength in class java.net.URLConnection

getContentType

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

getContentEncoding

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

getExpiration

public long getExpiration()
Overrides:
getExpiration in class java.net.URLConnection

getDate

public long getDate()
Overrides:
getDate in class java.net.URLConnection

getLastModified

public long getLastModified()
Overrides:
getLastModified in class java.net.URLConnection

getHeaderField

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

getHeaderFields

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

getHeaderFieldInt

public int getHeaderFieldInt(java.lang.String header,
                             int def)
Overrides:
getHeaderFieldInt in class java.net.URLConnection

getHeaderFieldDate

public long getHeaderFieldDate(java.lang.String header,
                               long def)
Overrides:
getHeaderFieldDate in class java.net.HttpURLConnection

getHeaderFieldKey

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

getHeaderField

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

getContent

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

getContent

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

getPermission

public java.security.Permission getPermission()
                                       throws java.io.IOException
Overrides:
getPermission in class java.net.HttpURLConnection
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

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Overrides:
getOutputStream in class java.net.URLConnection
Throws:
java.io.IOException

toString

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

setDoInput

public void setDoInput(boolean doInput)
Overrides:
setDoInput in class java.net.URLConnection

getDoInput

public boolean getDoInput()
Overrides:
getDoInput in class java.net.URLConnection

setDoOutput

public void setDoOutput(boolean doOutput)
Overrides:
setDoOutput in class java.net.URLConnection

getDoOutput

public boolean getDoOutput()
Overrides:
getDoOutput in class java.net.URLConnection

setAllowUserInteraction

public void setAllowUserInteraction(boolean allowUserInteraction)
Overrides:
setAllowUserInteraction in class java.net.URLConnection

getAllowUserInteraction

public boolean getAllowUserInteraction()
Overrides:
getAllowUserInteraction in class java.net.URLConnection

setUseCaches

public void setUseCaches(boolean useCaches)
Overrides:
setUseCaches in class java.net.URLConnection

getUseCaches

public boolean getUseCaches()
Overrides:
getUseCaches in class java.net.URLConnection

setIfModifiedSince

public void setIfModifiedSince(long ifModifiedSince)
Overrides:
setIfModifiedSince in class java.net.URLConnection

getIfModifiedSince

public long getIfModifiedSince()
Overrides:
getIfModifiedSince in class java.net.URLConnection

getDefaultUseCaches

public boolean getDefaultUseCaches()
Overrides:
getDefaultUseCaches in class java.net.URLConnection

setDefaultUseCaches

public void setDefaultUseCaches(boolean defaultUseCaches)
Overrides:
setDefaultUseCaches in class java.net.URLConnection

setRequestProperty

public void setRequestProperty(java.lang.String key,
                               java.lang.String value)
Overrides:
setRequestProperty in class java.net.URLConnection

addRequestProperty

public void addRequestProperty(java.lang.String key,
                               java.lang.String value)
Overrides:
addRequestProperty in class java.net.URLConnection

getRequestProperty

public java.lang.String getRequestProperty(java.lang.String key)
Overrides:
getRequestProperty in class java.net.URLConnection

getRequestProperties

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

setInstanceFollowRedirects

public void setInstanceFollowRedirects(boolean instanceFollowRedirects)
Overrides:
setInstanceFollowRedirects in class java.net.HttpURLConnection

getInstanceFollowRedirects

public boolean getInstanceFollowRedirects()
Overrides:
getInstanceFollowRedirects in class java.net.HttpURLConnection

setRequestMethod

public void setRequestMethod(java.lang.String requestMethod)
                      throws java.net.ProtocolException
Overrides:
setRequestMethod in class java.net.HttpURLConnection
Throws:
java.net.ProtocolException

getRequestMethod

public java.lang.String getRequestMethod()
Overrides:
getRequestMethod in class java.net.HttpURLConnection

getResponseCode

public int getResponseCode()
                    throws java.io.IOException
Overrides:
getResponseCode in class java.net.HttpURLConnection
Throws:
java.io.IOException

getResponseMessage

public java.lang.String getResponseMessage()
                                    throws java.io.IOException
Overrides:
getResponseMessage in class java.net.HttpURLConnection
Throws:
java.io.IOException

disconnect

public void disconnect()
Specified by:
disconnect in class java.net.HttpURLConnection

usingProxy

public boolean usingProxy()
Specified by:
usingProxy in class java.net.HttpURLConnection

getErrorStream

public java.io.InputStream getErrorStream()
Overrides:
getErrorStream in class java.net.HttpURLConnection