Java Doc for HttpDoc.java in  » Web-Crawler » JoBo » net » matuschek » 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 » Web Crawler » JoBo » net.matuschek.http 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.matuschek.http.HttpDoc

HttpDoc
public class HttpDoc (Code)
A HTTP document. It consists of the contents and HTTP headers.
author:
   Daniel Matuschek (daniel@matuschek.net)
author:
   ptah
version:
   $Id: HttpDoc.java,v 1.11 2004/08/09 17:36:49 matuschd Exp $



Constructor Summary
public  HttpDoc()
    

Method Summary
public  voidaddHeader(HttpHeader header)
    
public  byte[]getContent()
     Gets the content of the document an array of bytes containing the document content.
protected static  StringgetContentMD5(byte[] content)
    
public  StringgetContentMD5()
     Gets MD5 key of document content.
public  longgetDateAsMilliSeconds()
     Gets date as milliseconds.
public  HttpHeadergetHeader(String name)
    
public  StringgetHeaderValue(String headerName)
    
public  intgetHttpCode()
    
public  VectorgetHttpHeader()
    
public  HttpHeadergetHttpHeader(String headerName)
    
public  VectorgetHttpHeaders()
     Get all the HTTP headers.
public  longgetLastModifiedAsMilliSeconds()
     Gets lastModified date as milliseconds.
public  ListgetLinks()
     Gets List of links (if set previously).
public  StringgetLocation()
     Get the content of the Location header.
public  URLgetURL()
    
public  booleanisCached()
    
public  booleanisHTML()
    
public  booleanisJavaScript()
    
public  booleanisNotFound()
    
public  booleanisNotModified()
    
public  booleanisOk()
    
public  booleanisRedirect()
    
public  booleanisUnauthorized()
    
public  HttpHeaderremoveHeader(String name)
    
public  voidsetCached(boolean cached)
    
public  voidsetContent(byte[] content)
    
public  voidsetDate(long d)
     Sets date in milliseconds.
public  voidsetHeaderValue(String headerName, String headerValue)
    
public  voidsetHttpCode(String httpCode)
    
public  voidsetHttpCode(int code)
    
public  voidsetLastModified(long d)
     Sets lastModified date in milliseconds.
public  voidsetLinks(List links)
     Store calculated links of a HttpDoc.
public  voidsetURL(URL url)
    
public  StringtoString()
     Convert this object to a String. a String representation of this HttpDoc.


Constructor Detail
HttpDoc
public HttpDoc()(Code)
Default constructor, initializes a new HttpDoc with empty headers and no content




Method Detail
addHeader
public void addHeader(HttpHeader header)(Code)
Add another HTTP header
Parameters:
  header - an HttpHeader object to add to the lisof headers



getContent
public byte[] getContent()(Code)
Gets the content of the document an array of bytes containing the document content. Thismay represent text or binary data



getContentMD5
protected static String getContentMD5(byte[] content)(Code)
Calculates MD5 key for given content
Parameters:
  content - MD5 key for content



getContentMD5
public String getContentMD5()(Code)
Gets MD5 key of document content. A calculated key is stored as a header and reused in successive calls of this method. MD5 key



getDateAsMilliSeconds
public long getDateAsMilliSeconds()(Code)
Gets date as milliseconds. date as milliseconds or -1 if not specified



getHeader
public HttpHeader getHeader(String name)(Code)
Gets the HttpHeader with the given name
Parameters:
  headerName -



getHeaderValue
public String getHeaderValue(String headerName)(Code)
Get the header value with the given name
Parameters:
  headerName - a HttpHeader.value with the given name or null if not found



getHttpCode
public int getHttpCode()(Code)
Get the Http Return-Code Http Return-Code



getHttpHeader
public Vector getHttpHeader()(Code)
Get all HTTP header lines a Vector of HttpHeader objects



getHttpHeader
public HttpHeader getHttpHeader(String headerName)(Code)
Get the HTTP header with the given name
Parameters:
  headerName - a HttpHeader with the given name or null if not found



getHttpHeaders
public Vector getHttpHeaders()(Code)
Get all the HTTP headers. This function is useful if you don't know what headers exists and you want to have ALL headers a Vector containing HttpHeader objects



getLastModifiedAsMilliSeconds
public long getLastModifiedAsMilliSeconds()(Code)
Gets lastModified date as milliseconds. lastModified as milliseconds or -1 if not specified



getLinks
public List getLinks()(Code)
Gets List of links (if set previously). List



getLocation
public String getLocation()(Code)
Get the content of the Location header. This header will be used for REDIRECTs. the value of the HTTP Location header.



getURL
public URL getURL()(Code)
Get the full URL where this document was retrieved from an URL object containing the location where thisdocument was retrieved from



isCached
public boolean isCached()(Code)
Was this document retrieved from cache? cached



isHTML
public boolean isHTML()(Code)
is the content-type text/html ? true if the HTTP Content-Type header has thevalue text/html



isJavaScript
public boolean isJavaScript()(Code)
is this a Javascript document ? true if the Content-Type is text/x-javascript



isNotFound
public boolean isNotFound()(Code)
Was it not found ?



isNotModified
public boolean isNotModified()(Code)
Was it not modified ?



isOk
public boolean isOk()(Code)
Was it a "normal" document ?



isRedirect
public boolean isRedirect()(Code)
Was it a redirect ? true if this document is a HTTP REDIRECT



isUnauthorized
public boolean isUnauthorized()(Code)
did we get "Authorization required"



removeHeader
public HttpHeader removeHeader(String name)(Code)
Removes the HttpHeader with the given name
Parameters:
  headerName -



setCached
public void setCached(boolean cached)(Code)
Set flag that indicates if this document is retrieved from cache
Parameters:
  cached -



setContent
public void setContent(byte[] content)(Code)
Set the content of the document
Parameters:
  content -



setDate
public void setDate(long d)(Code)
Sets date in milliseconds.
Parameters:
  lastModified - in milliseconds



setHeaderValue
public void setHeaderValue(String headerName, String headerValue)(Code)
Set a HTTP header value with the given name (creates one if not found)
Parameters:
  headerName -
Parameters:
  headerValue - a HttpHeader.value with the given name or null if not found



setHttpCode
public void setHttpCode(String httpCode)(Code)



setHttpCode
public void setHttpCode(int code)(Code)



setLastModified
public void setLastModified(long d)(Code)
Sets lastModified date in milliseconds.
Parameters:
  lastModified - in milliseconds



setLinks
public void setLinks(List links)(Code)
Store calculated links of a HttpDoc.
Parameters:
  links -



setURL
public void setURL(URL url)(Code)
Set the location where this document was retrieved from
Parameters:
  url - the original location of this document



toString
public String toString()(Code)
Convert this object to a String. a String representation of this HttpDoc. Formatmay change, therefore this should be used only forlogging or debugging



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.