Java Doc for HttpExample.java in  » IDE-Netbeans » mobility » example » 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 » IDE Netbeans » mobility » example.http 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


example.http.HttpExample

HttpExample
public class HttpExample extends MIDlet implements Runnable(Code)
sample http example MIDlet.


Field Summary
 StringBufferbuffer
     string buffer for assembling HTTP requests.
 Formform
     user interface screen for displaying progress gauge.
 Gaugegauge
     user interface component for displaying network progress.
 Stringurl
    

Constructor Summary
public  HttpExample()
     Create the progress form and gauge.

Method Summary
public  voiddestroyApp(boolean unconditional)
     Destroy must cleanup everything.
 voidgetViaContentConnection(String url)
     Simple read of a url using ContentConnection.
 voidgetViaHttpConnection(String url)
     Read the HTTP headers and the data using HttpConnection.
 voidgetViaStreamConnection(String url)
     Simple read of a url using StreamConnection.
public  voidpauseApp()
    
 voidpostViaHttpConnection(String url)
     Post a request with some headers and content to the server and process the headers and content.
 voidprocess(byte b)
     Process the data one character at a time.
 voidprocess(byte[] b)
     Process the data from the array.
 voidprocessType(String type)
     Process the type.
public  voidrun()
     Run the examples.
 voidsetRequestHeaders(HttpConnection c)
     Add request properties for the configuration, profiles, and locale of this system.
public  voidstartApp()
     Start a thread to run the examples.

Field Detail
buffer
StringBuffer buffer(Code)
string buffer for assembling HTTP requests.



form
Form form(Code)
user interface screen for displaying progress gauge.



gauge
Gauge gauge(Code)
user interface component for displaying network progress.



url
String url(Code)
example URL for HTTP GET




Constructor Detail
HttpExample
public HttpExample()(Code)
Create the progress form and gauge. This program is not interactive, it will exit when done.




Method Detail
destroyApp
public void destroyApp(boolean unconditional)(Code)
Destroy must cleanup everything. The thread is signaled to stop and no result is produced.
Parameters:
  unconditional - true if forced shutdown.



getViaContentConnection
void getViaContentConnection(String url) throws IOException(Code)
Simple read of a url using ContentConnection. No HTTP specific behavior is needed or used.

Connector.open is used to open url and a ContentConnection is returned. The ContentConnection may be able to provide the length. If the length is available, it is used to read the data in bulk. From the StreamConnection the InputStream is opened. It is used to read every character until end of file (-1). If an exception is thrown the connection and stream is closed.
Parameters:
  url - the URL to process.




getViaHttpConnection
void getViaHttpConnection(String url) throws IOException(Code)
Read the HTTP headers and the data using HttpConnection. Check the response code to insure successful retrieval.

Connector.open is used to open url and a HttpConnection is returned. The HTTP headers are read and processed. If the length is available, it is used to read the data in bulk. From the HttpConnection the InputStream is opened. It is used to read every character until end of file (-1). If an exception is thrown the connection and stream is closed.
Parameters:
  url - the URL to process.




getViaStreamConnection
void getViaStreamConnection(String url) throws IOException(Code)
Simple read of a url using StreamConnection. No HTTP specific behavior is needed or used.

Connector.open is used to open url and a StreamConnection is returned. From the StreamConnection the InputStream is opened. It is used to read every character until end of file (-1). If an exception is thrown the connection and stream is closed.
Parameters:
  url - the URL to process.




pauseApp
public void pauseApp()(Code)
Pause, discontinue with the http tests



postViaHttpConnection
void postViaHttpConnection(String url) throws IOException(Code)
Post a request with some headers and content to the server and process the headers and content.

Connector.open is used to open url and a HttpConnection is returned. The request method is set to POST and request headers set. A simple command is written and flushed. The HTTP headers are read and processed. If the length is available, it is used to read the data in bulk. From the StreamConnection the InputStream is opened. It is used to read every character until end of file (-1). If an exception is thrown the connection and stream is closed.
Parameters:
  url - the URL to process.




process
void process(byte b)(Code)
Process the data one character at a time.
Parameters:
  b - one byte of data



process
void process(byte[] b)(Code)
Process the data from the array.
Parameters:
  b - an array of bytes.



processType
void processType(String type)(Code)
Process the type.
Parameters:
  type - that type



run
public void run()(Code)
Run the examples.



setRequestHeaders
void setRequestHeaders(HttpConnection c) throws IOException(Code)
Add request properties for the configuration, profiles, and locale of this system.
Parameters:
  c - current HttpConnection to apply request headers



startApp
public void startApp()(Code)
Start a thread to run the examples.



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