Java Doc for Request.java in  » Web-Server » HttpdBase4J » net » homeip » donaldm » httpdbase4j » 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 Server » HttpdBase4J » net.homeip.donaldm.httpdbase4j 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.homeip.donaldm.httpdbase4j.Request

All known Subclasses:   net.homeip.donaldm.httpdbase4j.CombinedRequest,  net.homeip.donaldm.httpdbase4j.ArchiveRequest,  net.homeip.donaldm.httpdbase4j.FileRequest,
Request
abstract public class Request implements DirItemInterface(Code)
Abstraction of an HTTP request
See Also:   ArchiveRequest
See Also:   FileRequest
See Also:   CombinedRequest
author:
   Donald Munro

Inner Class :public static enum HTTP_METHOD

Field Summary
protected static  Filem_cacheDir
    
protected  Filem_cacheFile
    
protected  booleanm_compress
     If true then the output will be compressed with gzip/deflate if the client indicates that it supports compression.
protected  Filem_compressedFile
    
protected  longm_contentLength
    
protected  Stringm_eTag
    
protected  Stringm_encoding
    
protected  HttpExchangem_ex
     The HttpExchange instance for this request.
protected  CloneableHeadersm_getParameters
    
protected  Httpdm_httpd
     The Httpd instance within which the request occurred.
protected  HTTP_METHODm_method
    
protected  Stringm_methodString
    
protected  Stringm_path
    
protected  byte[]m_postData
    
protected  CloneableHeadersm_postParameters
    
protected  CloneableHeadersm_requestHeaders
    
protected  URIm_uri
    

Constructor Summary
public  Request(Httpd httpd, HttpExchange ex)
     Create a Request instance.
public  Request(Request request)
    

Method Summary
public  booleancheckClientCache()
    
public  Objectclone()
    
public  String[]compressEncoding()
     Determine the compression encodings supported by the client.
abstract public  booleanexists()
     Check whether the resource exists.
protected  voidfinalize()
    
abstract public  StringgetAbsolutePath()
    
abstract public  RequestgetChildRequest(String name)
    
public  booleangetContent(long id, HttpHandleable handler)
    
abstract public  longgetContentLength()
     Return the length of the resource.
public  StringgetContentType()
    
abstract public  DategetDate()
    
abstract public  StringgetDir()
    
abstract public  TreeSet<DirItemInterface>getDirListDirectories(DirItemInterface.SORTBY sortBy)
     Return a list of directories in a resource directory.
Parameters:
  sortBy - Specify how the files should be sorted.
abstract public  TreeSet<DirItemInterface>getDirListFiles(DirItemInterface.SORTBY sortBy)
     Return a list of files in a resource directory.
Parameters:
  sortBy - Specify how the files should be sorted.
abstract public  RequestgetDirRequest()
    
abstract public  StringgetETag(boolean refresh)
    
abstract public  StringgetExtension()
     Return the file extension of the resource (ie the text after the final .
public  CloneableHeadersgetGETParameters()
    
abstract protected  HttpHandleablegetHandler()
     Return the handler for this request (a class implementing the HttpHandleable interface).
public  HTTP_METHODgetMethod()
    
public  StringgetMethodString()
    
abstract public  StringgetName()
    
public  CloneableHeadersgetPOSTParameters()
    
public  StringgetPath()
    
abstract protected  PostablegetPostHandler()
     Return the POST handler for this request (a class implementing the Postable interface).
protected  byte[]getRequestBytes(InputStream is, Headers headers)
     Get request contents (eg a POST request contents) into a byte array.
protected  StringgetRequestString(InputStream is, Headers headers)
    
abstract public  InputStreamgetStream(boolean isEncoded)
     Return a stream of the resource contents.
public  InputStreamgetStream()
     A stream of the resource contents (encoded content is returned ifavailable).
public  URIgetURI()
    
public  booleanisCacheable()
    
abstract public  booleanisDirectory()
    
public  booleanisGETorHEAD()
    
abstract public  booleanisReadable()
    
protected  CloneableHeadersprocessParameters(String queryString)
    
public  StringtoString()
    

Field Detail
m_cacheDir
protected static File m_cacheDir(Code)



m_cacheFile
protected File m_cacheFile(Code)



m_compress
protected boolean m_compress(Code)
If true then the output will be compressed with gzip/deflate if the client indicates that it supports compression.



m_compressedFile
protected File m_compressedFile(Code)



m_contentLength
protected long m_contentLength(Code)



m_eTag
protected String m_eTag(Code)



m_encoding
protected String m_encoding(Code)



m_ex
protected HttpExchange m_ex(Code)
The HttpExchange instance for this request.
See Also:   com.sun.net.httpserver.HttpExchange



m_getParameters
protected CloneableHeaders m_getParameters(Code)
Request GET parameters



m_httpd
protected Httpd m_httpd(Code)
The Httpd instance within which the request occurred.
See Also:   net.homeip.donaldm.httpdbase4j.Httpd



m_method
protected HTTP_METHOD m_method(Code)
The HTTP method



m_methodString
protected String m_methodString(Code)
The HTTP method as a String



m_path
protected String m_path(Code)
Request URI path



m_postData
protected byte[] m_postData(Code)



m_postParameters
protected CloneableHeaders m_postParameters(Code)
Request POST parameters



m_requestHeaders
protected CloneableHeaders m_requestHeaders(Code)
The request headers



m_uri
protected URI m_uri(Code)
The request URI
See Also:   net.homeip.donaldm.httpdbase4j.Httpd




Constructor Detail
Request
public Request(Httpd httpd, HttpExchange ex) throws UnsupportedEncodingException, IOException(Code)
Create a Request instance.
Parameters:
  httpd - The Httpd instance within which the request occurred.
See Also:   net.homeip.donaldm.httpdbase4j.Httpd
Parameters:
  ex - The HttpExchange instance for this request.
See Also:   com.sun.net.httpserver.HttpExchange
throws:
  UnsupportedEncodingException -
throws:
  IOException -



Request
public Request(Request request)(Code)




Method Detail
checkClientCache
public boolean checkClientCache()(Code)



clone
public Object clone() throws CloneNotSupportedException(Code)
Implementation of Cloneable interface for Request The cloned Request



compressEncoding
public String[] compressEncoding()(Code)
Determine the compression encodings supported by the client. A String array with the encodings accepted by the client, ordered by most desired encoding:gzip = GZip encodeddeflate = Deflate encodedtxt = No compression



exists
abstract public boolean exists()(Code)
Check whether the resource exists. true if the resource exists, false if it does not



finalize
protected void finalize() throws Throwable(Code)



getAbsolutePath
abstract public String getAbsolutePath()(Code)
Return the full path of the resource the full path of the resource



getChildRequest
abstract public Request getChildRequest(String name)(Code)
Create a request from the current directory request combined with a file or directory in the current directory
Parameters:
  name - The name of a file or directory in the current request if thecurrent request is a directory A new Request or null if request is not a directory



getContent
public boolean getContent(long id, HttpHandleable handler)(Code)



getContentLength
abstract public long getContentLength()(Code)
Return the length of the resource. the resource length or -1 if the length could notbe determined.



getContentType
public String getContentType()(Code)
The content type of the request



getDate
abstract public Date getDate()(Code)
Return the date of the resource the name of the resource



getDir
abstract public String getDir()(Code)
Return the directory of the resource (ie all components of the path before the final /) the path of the resource



getDirListDirectories
abstract public TreeSet<DirItemInterface> getDirListDirectories(DirItemInterface.SORTBY sortBy)(Code)
Return a list of directories in a resource directory.
Parameters:
  sortBy - Specify how the files should be sorted. This is an instanceof DirItemInterface.SORTBY ie NAME, DATE or SIZE). A TreeSet (sortable set) of DirItemInterface implementinginstances. Returns null if the resource is not a directory.
See Also:   net.homeip.donaldm.httpdbase4j.DirItemInterface



getDirListFiles
abstract public TreeSet<DirItemInterface> getDirListFiles(DirItemInterface.SORTBY sortBy)(Code)
Return a list of files in a resource directory.
Parameters:
  sortBy - Specify how the files should be sorted. This is an instanceof DirItemInterface.SORTBY ie NAME, DATE or SIZE). A TreeSet (sortable set) of DirItemInterface implementinginstances. Returns null if the resource is not a directory.
See Also:   net.homeip.donaldm.httpdbase4j.DirItemInterface



getDirRequest
abstract public Request getDirRequest()(Code)
Return the directory of the resource (ie all components of the path before the final / as a Request contructed from this Request) A Request for the directory containing this request



getETag
abstract public String getETag(boolean refresh)(Code)

Parameters:
  refresh - If true recalculate the tag hash even if it has alreadybeen calculated, if false reuse the cached value The ETag cacheing hash for this request



getExtension
abstract public String getExtension()(Code)
Return the file extension of the resource (ie the text after the final . in the path) the extension of the resource



getGETParameters
public CloneableHeaders getGETParameters()(Code)
The request GET parameters



getHandler
abstract protected HttpHandleable getHandler()(Code)
Return the handler for this request (a class implementing the HttpHandleable interface). The request handler
See Also:   net.homeip.donaldm.httpdbase4j.HttpHandleable



getMethod
public HTTP_METHOD getMethod()(Code)
The request method as an HTTP_METHOD enumeration



getMethodString
public String getMethodString()(Code)
The request method as a String



getName
abstract public String getName()(Code)
Return the name of the resource (ie the final component in the path after the final /) the name of the resource



getPOSTParameters
public CloneableHeaders getPOSTParameters()(Code)
The request POST parameters



getPath
public String getPath()(Code)
The request URI path



getPostHandler
abstract protected Postable getPostHandler()(Code)
Return the POST handler for this request (a class implementing the Postable interface). The request POST handler or null if no POST handler is defined
See Also:   Postable



getRequestBytes
protected byte[] getRequestBytes(InputStream is, Headers headers) throws IOException(Code)
Get request contents (eg a POST request contents) into a byte array.
Parameters:
  is - InputStream of request contents
Parameters:
  headers - Request headers An array of bytes of the request contents or null
throws:
  IOException - Note:Uses jchardet for charset detection (http://jchardet.sourceforge.net/)



getRequestString
protected String getRequestString(InputStream is, Headers headers) throws IOException(Code)
Get request contents (eg a POST request contents) as a String
Parameters:
  is - InputStream of request contents
Parameters:
  headers - Request headers A String representation of the request contents or an empty string
throws:
  IOException - Note:Uses jchardet for charset detection (http://jchardet.sourceforge.net/)



getStream
abstract public InputStream getStream(boolean isEncoded)(Code)
Return a stream of the resource contents.
Parameters:
  isEncoded - If true will return a stream for the encoded (eg gzip ordeflate) resource or if cacheing is allowed for this request and the encoded resource is in the cache then a stream for the cached version. If false returns a stream for the unencoded resource. If there is noencoding ie the client does not support encoding then both true andfalse return a stream for the unencoded resource. A stream of the resource contents.



getStream
public InputStream getStream()(Code)
A stream of the resource contents (encoded content is returned ifavailable).



getURI
public URI getURI()(Code)
The request URI



isCacheable
public boolean isCacheable()(Code)
true if the Request result should be cached (checks forCache-Control and Pragma:NoCache headers)



isDirectory
abstract public boolean isDirectory()(Code)
Check whether the resource is a directory true if the resource is a directory, false if it is not.



isGETorHEAD
public boolean isGETorHEAD()(Code)
Return whether this request is an HTTP GET or HEAD true if this request is an HTTP GET or HEAD



isReadable
abstract public boolean isReadable()(Code)
Check whether the resource is readable true if the resource is readable, false if it is not.



processParameters
protected CloneableHeaders processParameters(String queryString) throws UnsupportedEncodingException(Code)
Parses parameters in the form key=value&key2=value2)
Parameters:
  queryString - A key-value Map of the parameters
throws:
  UnsupportedEncodingException -



toString
public String toString()(Code)



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.