java.lang.Object
java.net.URLConnection
java.net.HttpURLConnection
org.codelibs.jcifs.smb1.http.NtlmHttpURLConnection
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, 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, responseMessageFields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches -
Constructor Summary
ConstructorsConstructorDescriptionNtlmHttpURLConnection(HttpURLConnection connection) Creates a new NTLM HTTP URL connection that wraps an existing HTTP connection. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequestProperty(String key, String value) voidconnect()voidbooleangetContent(Class[] classes) intlonggetDate()booleanbooleanbooleanlonggetHeaderField(int index) getHeaderField(String header) longgetHeaderFieldDate(String header, long def) intgetHeaderFieldInt(String header, int def) getHeaderFieldKey(int index) longbooleanlonggetRequestProperty(String key) intgetURL()booleanvoidsetAllowUserInteraction(boolean allowUserInteraction) voidsetDefaultUseCaches(boolean defaultUseCaches) voidsetDoInput(boolean doInput) voidsetDoOutput(boolean doOutput) voidsetIfModifiedSince(long ifModifiedSince) voidsetInstanceFollowRedirects(boolean instanceFollowRedirects) voidsetRequestMethod(String requestMethod) voidsetRequestProperty(String key, String value) voidsetUseCaches(boolean useCaches) toString()booleanMethods inherited from class java.net.HttpURLConnection
getFollowRedirects, setAuthenticator, setChunkedStreamingMode, setFixedLengthStreamingMode, setFixedLengthStreamingMode, setFollowRedirectsMethods inherited from class java.net.URLConnection
getConnectTimeout, getContentLengthLong, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getFileNameMap, getHeaderFieldLong, getReadTimeout, guessContentTypeFromName, guessContentTypeFromStream, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setFileNameMap, setReadTimeout
-
Constructor Details
-
NtlmHttpURLConnection
Creates a new NTLM HTTP URL connection that wraps an existing HTTP connection.- Parameters:
connection- the HTTP connection to wrap for NTLM authentication
-
-
Method Details
-
connect
- Specified by:
connectin classURLConnection- Throws:
IOException
-
getURL
- Overrides:
getURLin classURLConnection
-
getContentLength
public int getContentLength()- Overrides:
getContentLengthin classURLConnection
-
getContentType
- Overrides:
getContentTypein classURLConnection
-
getContentEncoding
- Overrides:
getContentEncodingin classURLConnection
-
getExpiration
public long getExpiration()- Overrides:
getExpirationin classURLConnection
-
getDate
public long getDate()- Overrides:
getDatein classURLConnection
-
getLastModified
public long getLastModified()- Overrides:
getLastModifiedin classURLConnection
-
getHeaderField
- Overrides:
getHeaderFieldin classURLConnection
-
getHeaderFields
- Overrides:
getHeaderFieldsin classURLConnection
-
getHeaderFieldInt
- Overrides:
getHeaderFieldIntin classURLConnection
-
getHeaderFieldDate
- Overrides:
getHeaderFieldDatein classHttpURLConnection
-
getHeaderFieldKey
- Overrides:
getHeaderFieldKeyin classHttpURLConnection
-
getHeaderField
- Overrides:
getHeaderFieldin classHttpURLConnection
-
getContent
- Overrides:
getContentin classURLConnection- Throws:
IOException
-
getContent
- Overrides:
getContentin classURLConnection- Throws:
IOException
-
getPermission
- Overrides:
getPermissionin classHttpURLConnection- Throws:
IOException
-
getInputStream
- Overrides:
getInputStreamin classURLConnection- Throws:
IOException
-
getOutputStream
- Overrides:
getOutputStreamin classURLConnection- Throws:
IOException
-
toString
- Overrides:
toStringin classURLConnection
-
setDoInput
public void setDoInput(boolean doInput) - Overrides:
setDoInputin classURLConnection
-
getDoInput
public boolean getDoInput()- Overrides:
getDoInputin classURLConnection
-
setDoOutput
public void setDoOutput(boolean doOutput) - Overrides:
setDoOutputin classURLConnection
-
getDoOutput
public boolean getDoOutput()- Overrides:
getDoOutputin classURLConnection
-
setAllowUserInteraction
public void setAllowUserInteraction(boolean allowUserInteraction) - Overrides:
setAllowUserInteractionin classURLConnection
-
getAllowUserInteraction
public boolean getAllowUserInteraction()- Overrides:
getAllowUserInteractionin classURLConnection
-
setUseCaches
public void setUseCaches(boolean useCaches) - Overrides:
setUseCachesin classURLConnection
-
getUseCaches
public boolean getUseCaches()- Overrides:
getUseCachesin classURLConnection
-
setIfModifiedSince
public void setIfModifiedSince(long ifModifiedSince) - Overrides:
setIfModifiedSincein classURLConnection
-
getIfModifiedSince
public long getIfModifiedSince()- Overrides:
getIfModifiedSincein classURLConnection
-
getDefaultUseCaches
public boolean getDefaultUseCaches()- Overrides:
getDefaultUseCachesin classURLConnection
-
setDefaultUseCaches
public void setDefaultUseCaches(boolean defaultUseCaches) - Overrides:
setDefaultUseCachesin classURLConnection
-
setRequestProperty
- Overrides:
setRequestPropertyin classURLConnection
-
addRequestProperty
- Overrides:
addRequestPropertyin classURLConnection
-
getRequestProperty
- Overrides:
getRequestPropertyin classURLConnection
-
getRequestProperties
- Overrides:
getRequestPropertiesin classURLConnection
-
setInstanceFollowRedirects
public void setInstanceFollowRedirects(boolean instanceFollowRedirects) - Overrides:
setInstanceFollowRedirectsin classHttpURLConnection
-
getInstanceFollowRedirects
public boolean getInstanceFollowRedirects()- Overrides:
getInstanceFollowRedirectsin classHttpURLConnection
-
setRequestMethod
- Overrides:
setRequestMethodin classHttpURLConnection- Throws:
ProtocolException
-
getRequestMethod
- Overrides:
getRequestMethodin classHttpURLConnection
-
getResponseCode
- Overrides:
getResponseCodein classHttpURLConnection- Throws:
IOException
-
getResponseMessage
- Overrides:
getResponseMessagein classHttpURLConnection- Throws:
IOException
-
disconnect
public void disconnect()- Specified by:
disconnectin classHttpURLConnection
-
usingProxy
public boolean usingProxy()- Specified by:
usingProxyin classHttpURLConnection
-
getErrorStream
- Overrides:
getErrorStreamin classHttpURLConnection
-