Package jcifs.smb1.http
Class NtlmHttpURLConnection
- java.lang.Object
-
- java.net.URLConnection
-
- java.net.HttpURLConnection
-
- jcifs.smb1.http.NtlmHttpURLConnection
-
public class NtlmHttpURLConnection extends HttpURLConnection
Wraps anHttpURLConnection
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, fixedContentLengthLong, 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
Constructors Constructor Description NtlmHttpURLConnection(HttpURLConnection connection)
-
Method Summary
-
Methods inherited from class java.net.HttpURLConnection
getFollowRedirects, setAuthenticator, setChunkedStreamingMode, setFixedLengthStreamingMode, setFixedLengthStreamingMode, setFollowRedirects
-
Methods inherited from class java.net.URLConnection
getConnectTimeout, getContentLengthLong, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getFileNameMap, getHeaderFieldLong, getReadTimeout, guessContentTypeFromName, guessContentTypeFromStream, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setFileNameMap, setReadTimeout
-
-
-
-
Constructor Detail
-
NtlmHttpURLConnection
public NtlmHttpURLConnection(HttpURLConnection connection)
-
-
Method Detail
-
connect
public void connect() throws IOException
- Specified by:
connect
in classURLConnection
- Throws:
IOException
-
getURL
public URL getURL()
- Overrides:
getURL
in classURLConnection
-
getContentLength
public int getContentLength()
- Overrides:
getContentLength
in classURLConnection
-
getContentType
public String getContentType()
- Overrides:
getContentType
in classURLConnection
-
getContentEncoding
public String getContentEncoding()
- Overrides:
getContentEncoding
in classURLConnection
-
getExpiration
public long getExpiration()
- Overrides:
getExpiration
in classURLConnection
-
getDate
public long getDate()
- Overrides:
getDate
in classURLConnection
-
getLastModified
public long getLastModified()
- Overrides:
getLastModified
in classURLConnection
-
getHeaderField
public String getHeaderField(String header)
- Overrides:
getHeaderField
in classURLConnection
-
getHeaderFields
public Map getHeaderFields()
- Overrides:
getHeaderFields
in classURLConnection
-
getHeaderFieldInt
public int getHeaderFieldInt(String header, int def)
- Overrides:
getHeaderFieldInt
in classURLConnection
-
getHeaderFieldDate
public long getHeaderFieldDate(String header, long def)
- Overrides:
getHeaderFieldDate
in classHttpURLConnection
-
getHeaderFieldKey
public String getHeaderFieldKey(int index)
- Overrides:
getHeaderFieldKey
in classHttpURLConnection
-
getHeaderField
public String getHeaderField(int index)
- Overrides:
getHeaderField
in classHttpURLConnection
-
getContent
public Object getContent() throws IOException
- Overrides:
getContent
in classURLConnection
- Throws:
IOException
-
getContent
public Object getContent(Class[] classes) throws IOException
- Overrides:
getContent
in classURLConnection
- Throws:
IOException
-
getPermission
public Permission getPermission() throws IOException
- Overrides:
getPermission
in classHttpURLConnection
- Throws:
IOException
-
getInputStream
public InputStream getInputStream() throws IOException
- Overrides:
getInputStream
in classURLConnection
- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Overrides:
getOutputStream
in classURLConnection
- Throws:
IOException
-
toString
public String toString()
- Overrides:
toString
in classURLConnection
-
setDoInput
public void setDoInput(boolean doInput)
- Overrides:
setDoInput
in classURLConnection
-
getDoInput
public boolean getDoInput()
- Overrides:
getDoInput
in classURLConnection
-
setDoOutput
public void setDoOutput(boolean doOutput)
- Overrides:
setDoOutput
in classURLConnection
-
getDoOutput
public boolean getDoOutput()
- Overrides:
getDoOutput
in classURLConnection
-
setAllowUserInteraction
public void setAllowUserInteraction(boolean allowUserInteraction)
- Overrides:
setAllowUserInteraction
in classURLConnection
-
getAllowUserInteraction
public boolean getAllowUserInteraction()
- Overrides:
getAllowUserInteraction
in classURLConnection
-
setUseCaches
public void setUseCaches(boolean useCaches)
- Overrides:
setUseCaches
in classURLConnection
-
getUseCaches
public boolean getUseCaches()
- Overrides:
getUseCaches
in classURLConnection
-
setIfModifiedSince
public void setIfModifiedSince(long ifModifiedSince)
- Overrides:
setIfModifiedSince
in classURLConnection
-
getIfModifiedSince
public long getIfModifiedSince()
- Overrides:
getIfModifiedSince
in classURLConnection
-
getDefaultUseCaches
public boolean getDefaultUseCaches()
- Overrides:
getDefaultUseCaches
in classURLConnection
-
setDefaultUseCaches
public void setDefaultUseCaches(boolean defaultUseCaches)
- Overrides:
setDefaultUseCaches
in classURLConnection
-
setRequestProperty
public void setRequestProperty(String key, String value)
- Overrides:
setRequestProperty
in classURLConnection
-
addRequestProperty
public void addRequestProperty(String key, String value)
- Overrides:
addRequestProperty
in classURLConnection
-
getRequestProperty
public String getRequestProperty(String key)
- Overrides:
getRequestProperty
in classURLConnection
-
getRequestProperties
public Map getRequestProperties()
- Overrides:
getRequestProperties
in classURLConnection
-
setInstanceFollowRedirects
public void setInstanceFollowRedirects(boolean instanceFollowRedirects)
- Overrides:
setInstanceFollowRedirects
in classHttpURLConnection
-
getInstanceFollowRedirects
public boolean getInstanceFollowRedirects()
- Overrides:
getInstanceFollowRedirects
in classHttpURLConnection
-
setRequestMethod
public void setRequestMethod(String requestMethod) throws ProtocolException
- Overrides:
setRequestMethod
in classHttpURLConnection
- Throws:
ProtocolException
-
getRequestMethod
public String getRequestMethod()
- Overrides:
getRequestMethod
in classHttpURLConnection
-
getResponseCode
public int getResponseCode() throws IOException
- Overrides:
getResponseCode
in classHttpURLConnection
- Throws:
IOException
-
getResponseMessage
public String getResponseMessage() throws IOException
- Overrides:
getResponseMessage
in classHttpURLConnection
- Throws:
IOException
-
disconnect
public void disconnect()
- Specified by:
disconnect
in classHttpURLConnection
-
usingProxy
public boolean usingProxy()
- Specified by:
usingProxy
in classHttpURLConnection
-
getErrorStream
public InputStream getErrorStream()
- Overrides:
getErrorStream
in classHttpURLConnection
-
-