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 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(HttpURLConnection connection)
           
 
Method Summary
 void addRequestProperty(String key, String value)
           
 void connect()
           
 void disconnect()
           
 boolean getAllowUserInteraction()
           
 Object getContent()
           
 Object getContent(Class[] classes)
           
 String getContentEncoding()
           
 int getContentLength()
           
 String getContentType()
           
 long getDate()
           
 boolean getDefaultUseCaches()
           
 boolean getDoInput()
           
 boolean getDoOutput()
           
 InputStream getErrorStream()
           
 long getExpiration()
           
 String getHeaderField(int index)
           
 String getHeaderField(String header)
           
 long getHeaderFieldDate(String header, long def)
           
 int getHeaderFieldInt(String header, int def)
           
 String getHeaderFieldKey(int index)
           
 Map getHeaderFields()
           
 long getIfModifiedSince()
           
 InputStream getInputStream()
           
 boolean getInstanceFollowRedirects()
           
 long getLastModified()
           
 OutputStream getOutputStream()
           
 Permission getPermission()
           
 String getRequestMethod()
           
 Map getRequestProperties()
           
 String getRequestProperty(String key)
           
 int getResponseCode()
           
 String getResponseMessage()
           
 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(String requestMethod)
           
 void setRequestProperty(String key, String value)
           
 void setUseCaches(boolean useCaches)
           
 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(HttpURLConnection connection)
Method Detail

connect

public void connect()
             throws IOException
Specified by:
connect in class URLConnection
Throws:
IOException

getURL

public URL getURL()
Overrides:
getURL in class URLConnection

getContentLength

public int getContentLength()
Overrides:
getContentLength in class URLConnection

getContentType

public String getContentType()
Overrides:
getContentType in class URLConnection

getContentEncoding

public String getContentEncoding()
Overrides:
getContentEncoding in class URLConnection

getExpiration

public long getExpiration()
Overrides:
getExpiration in class URLConnection

getDate

public long getDate()
Overrides:
getDate in class URLConnection

getLastModified

public long getLastModified()
Overrides:
getLastModified in class URLConnection

getHeaderField

public String getHeaderField(String header)
Overrides:
getHeaderField in class URLConnection

getHeaderFields

public Map getHeaderFields()
Overrides:
getHeaderFields in class URLConnection

getHeaderFieldInt

public int getHeaderFieldInt(String header,
                             int def)
Overrides:
getHeaderFieldInt in class URLConnection

getHeaderFieldDate

public long getHeaderFieldDate(String header,
                               long def)
Overrides:
getHeaderFieldDate in class HttpURLConnection

getHeaderFieldKey

public String getHeaderFieldKey(int index)
Overrides:
getHeaderFieldKey in class HttpURLConnection

getHeaderField

public String getHeaderField(int index)
Overrides:
getHeaderField in class HttpURLConnection

getContent

public Object getContent()
                  throws IOException
Overrides:
getContent in class URLConnection
Throws:
IOException

getContent

public Object getContent(Class[] classes)
                  throws IOException
Overrides:
getContent in class URLConnection
Throws:
IOException

getPermission

public Permission getPermission()
                         throws IOException
Overrides:
getPermission in class HttpURLConnection
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Overrides:
getInputStream in class URLConnection
Throws:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Overrides:
getOutputStream in class URLConnection
Throws:
IOException

toString

public String toString()
Overrides:
toString in class URLConnection

setDoInput

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

getDoInput

public boolean getDoInput()
Overrides:
getDoInput in class URLConnection

setDoOutput

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

getDoOutput

public boolean getDoOutput()
Overrides:
getDoOutput in class URLConnection

setAllowUserInteraction

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

getAllowUserInteraction

public boolean getAllowUserInteraction()
Overrides:
getAllowUserInteraction in class URLConnection

setUseCaches

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

getUseCaches

public boolean getUseCaches()
Overrides:
getUseCaches in class URLConnection

setIfModifiedSince

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

getIfModifiedSince

public long getIfModifiedSince()
Overrides:
getIfModifiedSince in class URLConnection

getDefaultUseCaches

public boolean getDefaultUseCaches()
Overrides:
getDefaultUseCaches in class URLConnection

setDefaultUseCaches

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

setRequestProperty

public void setRequestProperty(String key,
                               String value)
Overrides:
setRequestProperty in class URLConnection

addRequestProperty

public void addRequestProperty(String key,
                               String value)
Overrides:
addRequestProperty in class URLConnection

getRequestProperty

public String getRequestProperty(String key)
Overrides:
getRequestProperty in class URLConnection

getRequestProperties

public Map getRequestProperties()
Overrides:
getRequestProperties in class URLConnection

setInstanceFollowRedirects

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

getInstanceFollowRedirects

public boolean getInstanceFollowRedirects()
Overrides:
getInstanceFollowRedirects in class HttpURLConnection

setRequestMethod

public void setRequestMethod(String requestMethod)
                      throws ProtocolException
Overrides:
setRequestMethod in class HttpURLConnection
Throws:
ProtocolException

getRequestMethod

public String getRequestMethod()
Overrides:
getRequestMethod in class HttpURLConnection

getResponseCode

public int getResponseCode()
                    throws IOException
Overrides:
getResponseCode in class HttpURLConnection
Throws:
IOException

getResponseMessage

public String getResponseMessage()
                          throws IOException
Overrides:
getResponseMessage in class HttpURLConnection
Throws:
IOException

disconnect

public void disconnect()
Specified by:
disconnect in class HttpURLConnection

usingProxy

public boolean usingProxy()
Specified by:
usingProxy in class HttpURLConnection

getErrorStream

public InputStream getErrorStream()
Overrides:
getErrorStream in class HttpURLConnection


Copyright © 2012. All Rights Reserved.