Java Doc for HttpURLConnection.java in  » 6.0-JDK-Modules » j2me » sun » net » www » protocol » http » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » sun.net.www.protocol.http 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.net.URLConnection
      java.net.HttpURLConnection
         sun.net.www.protocol.http.HttpURLConnection

HttpURLConnection
public class HttpURLConnection extends java.net.HttpURLConnection (Code)
A class to represent an HTTP connection to a remote object.

Inner Class :class HttpInputStream extends FilterInputStream

Field Summary
final static  StringacceptString
    
 ObjectauthObj
    
 byte[]cdata
    
 AuthenticationInfocurrentProxyCredentials
    
 AuthenticationInfocurrentServerCredentials
    
final static  intdefaultmaxRedirects
    
 DigestAuthentication.Parametersdigestparams
    
 Stringdomain
    
protected  Handlerhandler
    
protected  HttpClienthttp
    
final static  StringhttpVersion
    
final static  intmaxRedirects
    
 booleanneedToCheck
    
protected  ProgressEntrype
    
protected  PrintStreamps
    
final public static  StringuserAgent
    
final static  booleanvalidateProxy
    
final static  booleanvalidateServer
    
final static  Stringversion
    

Constructor Summary
protected  HttpURLConnection(URL u, Handler handler)
    
public  HttpURLConnection(URL u, String host, int port)
     this constructor is used by other protocol handlers such as ftp that want to use http to fetch urls on their behalf.

Method Summary
public  voidaddRequestProperty(String key, String value)
     Adds a general request property specified by a key-value pair.
public  voidconnect()
    
public  voiddisconnect()
    
protected synchronized  voiddoTunneling()
    
public  voidfinalize()
    
public  InputStreamgetErrorStream()
    
public  StringgetHeaderField(String name)
     Gets a header field by name.
public  StringgetHeaderField(int n)
     Gets a header field by index.
public  StringgetHeaderFieldKey(int n)
     Gets a header field by index.
public  MapgetHeaderFields()
     Returns an unmodifiable Map of the header fields. The Map keys are Strings that represent the response-header field names.
public synchronized  InputStreamgetInputStream()
    
 StringgetMethod()
    
public synchronized  OutputStreamgetOutputStream()
    
public  MapgetRequestProperties()
     Returns an unmodifiable Map of general request properties for this connection.
public  StringgetRequestProperty(String key)
    
public static  InputStreamopenConnectionCheckRedirects(URLConnection c)
     opens a stream allowing redirects only to the same host.
protected  voidplainConnect()
    
protected  voidproxiedConnect(URL url, String proxyHost, int proxyPort, boolean useCache)
    
 voidsetAuthenticationProperty(String key, String value)
    
public static  voidsetDefaultAuthenticator(HttpAuthenticator a)
     Use java.net.Authenticator.setDefault() instead.
protected  voidsetNewClient(URL url)
     Create a new HttpClient object, bypassing the cache of HTTP client objects/connections.
protected  voidsetNewClient(URL url, boolean useCache)
     Obtain a HttpsClient object.
protected  voidsetProxiedClient(URL url, String proxyHost, int proxyPort)
     Create a new HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy.
protected  voidsetProxiedClient(URL url, String proxyHost, int proxyPort, boolean useCache)
     Obtain a HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy.
public  voidsetRequestProperty(String key, String value)
     Sets request property.
public  booleanusingProxy()
    

Field Detail
acceptString
final static String acceptString(Code)



authObj
Object authObj(Code)



cdata
byte[] cdata(Code)



currentProxyCredentials
AuthenticationInfo currentProxyCredentials(Code)



currentServerCredentials
AuthenticationInfo currentServerCredentials(Code)



defaultmaxRedirects
final static int defaultmaxRedirects(Code)



digestparams
DigestAuthentication.Parameters digestparams(Code)



domain
String domain(Code)



handler
protected Handler handler(Code)



http
protected HttpClient http(Code)



httpVersion
final static String httpVersion(Code)



maxRedirects
final static int maxRedirects(Code)



needToCheck
boolean needToCheck(Code)



pe
protected ProgressEntry pe(Code)



ps
protected PrintStream ps(Code)



userAgent
final public static String userAgent(Code)



validateProxy
final static boolean validateProxy(Code)



validateServer
final static boolean validateServer(Code)



version
final static String version(Code)




Constructor Detail
HttpURLConnection
protected HttpURLConnection(URL u, Handler handler) throws IOException(Code)



HttpURLConnection
public HttpURLConnection(URL u, String host, int port) throws IOException(Code)
this constructor is used by other protocol handlers such as ftp that want to use http to fetch urls on their behalf.




Method Detail
addRequestProperty
public void addRequestProperty(String key, String value)(Code)
Adds a general request property specified by a key-value pair. This method will not overwrite existing values associated with the same key.
Parameters:
  key - the keyword by which the request is known(e.g., "accept").
Parameters:
  value - the value associated with it.
See Also:   HttpURLConnection.getRequestProperties(java.lang.String)
since:
   1.4



connect
public void connect() throws IOException(Code)



disconnect
public void disconnect()(Code)
Disconnect from the server (public API)



doTunneling
protected synchronized void doTunneling() throws IOException(Code)
establish a tunnel through proxy server



finalize
public void finalize()(Code)



getErrorStream
public InputStream getErrorStream()(Code)



getHeaderField
public String getHeaderField(String name)(Code)
Gets a header field by name. Returns null if not known.
Parameters:
  name - the name of the header field



getHeaderField
public String getHeaderField(int n)(Code)
Gets a header field by index. Returns null if not known.
Parameters:
  n - the index of the header field



getHeaderFieldKey
public String getHeaderFieldKey(int n)(Code)
Gets a header field by index. Returns null if not known.
Parameters:
  n - the index of the header field



getHeaderFields
public Map getHeaderFields()(Code)
Returns an unmodifiable Map of the header fields. The Map keys are Strings that represent the response-header field names. Each Map value is an unmodifiable List of Strings that represents the corresponding field values. a Map of header fields
since:
   1.4



getInputStream
public synchronized InputStream getInputStream() throws IOException(Code)



getMethod
String getMethod()(Code)



getOutputStream
public synchronized OutputStream getOutputStream() throws IOException(Code)



getRequestProperties
public Map getRequestProperties()(Code)
Returns an unmodifiable Map of general request properties for this connection. The Map keys are Strings that represent the request-header field names. Each Map value is a unmodifiable List of Strings that represents the corresponding field values. a Map of the general request properties for this connection.
throws:
  IllegalStateException - if already connected
since:
   1.4



getRequestProperty
public String getRequestProperty(String key)(Code)



openConnectionCheckRedirects
public static InputStream openConnectionCheckRedirects(URLConnection c) throws IOException(Code)
opens a stream allowing redirects only to the same host.



plainConnect
protected void plainConnect() throws IOException(Code)



proxiedConnect
protected void proxiedConnect(URL url, String proxyHost, int proxyPort, boolean useCache) throws IOException(Code)



setAuthenticationProperty
void setAuthenticationProperty(String key, String value)(Code)



setDefaultAuthenticator
public static void setDefaultAuthenticator(HttpAuthenticator a)(Code)
Use java.net.Authenticator.setDefault() instead.



setNewClient
protected void setNewClient(URL url) throws IOException(Code)
Create a new HttpClient object, bypassing the cache of HTTP client objects/connections.
Parameters:
  url - the URL being accessed



setNewClient
protected void setNewClient(URL url, boolean useCache) throws IOException(Code)
Obtain a HttpsClient object. Use the cached copy if specified.
Parameters:
  url - the URL being accessed
Parameters:
  useCache - whether the cached connection should be usedif present



setProxiedClient
protected void setProxiedClient(URL url, String proxyHost, int proxyPort) throws IOException(Code)
Create a new HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy. This bypasses the cache of HTTP client objects/connections.
Parameters:
  url - the URL being accessed
Parameters:
  proxyHost - the proxy host to use
Parameters:
  proxyPort - the proxy port to use



setProxiedClient
protected void setProxiedClient(URL url, String proxyHost, int proxyPort, boolean useCache) throws IOException(Code)
Obtain a HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy. Use the cached copy of HTTP client objects/connections if specified.
Parameters:
  url - the URL being accessed
Parameters:
  proxyHost - the proxy host to use
Parameters:
  proxyPort - the proxy port to use
Parameters:
  useCache - whether the cached connection should be usedif present



setRequestProperty
public void setRequestProperty(String key, String value)(Code)
Sets request property. If a property with the key already exists, overwrite its value with the new value.
Parameters:
  value - the value to be set



usingProxy
public boolean usingProxy()(Code)



Fields inherited from java.net.HttpURLConnection
final public static int HTTP_ACCEPTED(Code)(Java Doc)
final public static int HTTP_BAD_GATEWAY(Code)(Java Doc)
final public static int HTTP_BAD_METHOD(Code)(Java Doc)
final public static int HTTP_BAD_REQUEST(Code)(Java Doc)
final public static int HTTP_CLIENT_TIMEOUT(Code)(Java Doc)
final public static int HTTP_CONFLICT(Code)(Java Doc)
final public static int HTTP_CREATED(Code)(Java Doc)
final public static int HTTP_ENTITY_TOO_LARGE(Code)(Java Doc)
final public static int HTTP_FORBIDDEN(Code)(Java Doc)
final public static int HTTP_GATEWAY_TIMEOUT(Code)(Java Doc)
final public static int HTTP_GONE(Code)(Java Doc)
final public static int HTTP_INTERNAL_ERROR(Code)(Java Doc)
final public static int HTTP_LENGTH_REQUIRED(Code)(Java Doc)
final public static int HTTP_MOVED_PERM(Code)(Java Doc)
final public static int HTTP_MOVED_TEMP(Code)(Java Doc)
final public static int HTTP_MULT_CHOICE(Code)(Java Doc)
final public static int HTTP_NOT_ACCEPTABLE(Code)(Java Doc)
final public static int HTTP_NOT_AUTHORITATIVE(Code)(Java Doc)
final public static int HTTP_NOT_FOUND(Code)(Java Doc)
final public static int HTTP_NOT_IMPLEMENTED(Code)(Java Doc)
final public static int HTTP_NOT_MODIFIED(Code)(Java Doc)
final public static int HTTP_NO_CONTENT(Code)(Java Doc)
final public static int HTTP_OK(Code)(Java Doc)
final public static int HTTP_PARTIAL(Code)(Java Doc)
final public static int HTTP_PAYMENT_REQUIRED(Code)(Java Doc)
final public static int HTTP_PRECON_FAILED(Code)(Java Doc)
final public static int HTTP_PROXY_AUTH(Code)(Java Doc)
final public static int HTTP_REQ_TOO_LONG(Code)(Java Doc)
final public static int HTTP_RESET(Code)(Java Doc)
final public static int HTTP_SEE_OTHER(Code)(Java Doc)
final public static int HTTP_UNAUTHORIZED(Code)(Java Doc)
final public static int HTTP_UNAVAILABLE(Code)(Java Doc)
final public static int HTTP_UNSUPPORTED_TYPE(Code)(Java Doc)
final public static int HTTP_USE_PROXY(Code)(Java Doc)
final public static int HTTP_VERSION(Code)(Java Doc)
protected boolean instanceFollowRedirects(Code)(Java Doc)
protected String method(Code)(Java Doc)
protected int responseCode(Code)(Java Doc)
protected String responseMessage(Code)(Java Doc)

Methods inherited from java.net.HttpURLConnection
abstract public void disconnect()(Code)(Java Doc)
public InputStream getErrorStream()(Code)(Java Doc)
public static boolean getFollowRedirects()(Code)(Java Doc)
public String getHeaderField(int n)(Code)(Java Doc)
public long getHeaderFieldDate(String name, long Default)(Code)(Java Doc)
public String getHeaderFieldKey(int n)(Code)(Java Doc)
public boolean getInstanceFollowRedirects()(Code)(Java Doc)
public Permission getPermission() throws IOException(Code)(Java Doc)
public String getRequestMethod()(Code)(Java Doc)
public int getResponseCode() throws IOException(Code)(Java Doc)
public String getResponseMessage() throws IOException(Code)(Java Doc)
public static void setFollowRedirects(boolean set)(Code)(Java Doc)
public void setInstanceFollowRedirects(boolean followRedirects)(Code)(Java Doc)
public void setRequestMethod(String method) throws ProtocolException(Code)(Java Doc)
abstract public boolean usingProxy()(Code)(Java Doc)

Fields inherited from java.net.URLConnection
protected boolean allowUserInteraction(Code)(Java Doc)
protected boolean connected(Code)(Java Doc)
protected boolean doInput(Code)(Java Doc)
protected boolean doOutput(Code)(Java Doc)
protected long ifModifiedSince(Code)(Java Doc)
protected URL url(Code)(Java Doc)
protected boolean useCaches(Code)(Java Doc)

Methods inherited from java.net.URLConnection
public void addRequestProperty(String key, String value)(Code)(Java Doc)
abstract public void connect() throws IOException(Code)(Java Doc)
public boolean getAllowUserInteraction()(Code)(Java Doc)
public Object getContent() throws IOException(Code)(Java Doc)
public Object getContent(Class[] classes) throws IOException(Code)(Java Doc)
public String getContentEncoding()(Code)(Java Doc)
public int getContentLength()(Code)(Java Doc)
public String getContentType()(Code)(Java Doc)
public long getDate()(Code)(Java Doc)
public static boolean getDefaultAllowUserInteraction()(Code)(Java Doc)
public boolean getDefaultUseCaches()(Code)(Java Doc)
public boolean getDoInput()(Code)(Java Doc)
public boolean getDoOutput()(Code)(Java Doc)
public long getExpiration()(Code)(Java Doc)
public static synchronized FileNameMap getFileNameMap()(Code)(Java Doc)
public String getHeaderField(String name)(Code)(Java Doc)
public String getHeaderField(int n)(Code)(Java Doc)
public long getHeaderFieldDate(String name, long Default)(Code)(Java Doc)
public int getHeaderFieldInt(String name, int Default)(Code)(Java Doc)
public String getHeaderFieldKey(int n)(Code)(Java Doc)
public Map getHeaderFields()(Code)(Java Doc)
public long getIfModifiedSince()(Code)(Java Doc)
public InputStream getInputStream() throws IOException(Code)(Java Doc)
public long getLastModified()(Code)(Java Doc)
public OutputStream getOutputStream() throws IOException(Code)(Java Doc)
public Permission getPermission() throws IOException(Code)(Java Doc)
public Map getRequestProperties()(Code)(Java Doc)
public String getRequestProperty(String key)(Code)(Java Doc)
public URL getURL()(Code)(Java Doc)
public boolean getUseCaches()(Code)(Java Doc)
public static String guessContentTypeFromName(String fname)(Code)(Java Doc)
public static String guessContentTypeFromStream(InputStream is) throws IOException(Code)(Java Doc)
public void setAllowUserInteraction(boolean allowuserinteraction)(Code)(Java Doc)
public static synchronized void setContentHandlerFactory(ContentHandlerFactory fac)(Code)(Java Doc)
public static void setDefaultAllowUserInteraction(boolean defaultallowuserinteraction)(Code)(Java Doc)
public void setDefaultUseCaches(boolean defaultusecaches)(Code)(Java Doc)
public void setDoInput(boolean doinput)(Code)(Java Doc)
public void setDoOutput(boolean dooutput)(Code)(Java Doc)
public static void setFileNameMap(FileNameMap map)(Code)(Java Doc)
public void setIfModifiedSince(long ifmodifiedsince)(Code)(Java Doc)
public void setRequestProperty(String key, String value)(Code)(Java Doc)
public void setUseCaches(boolean usecaches)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.