Java Doc for HttpRecorder.java in  » Web-Crawler » heritrix » org » archive » util » 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 » heritrix » org.archive.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.archive.util.HttpRecorder

HttpRecorder
public class HttpRecorder (Code)
Pairs together a RecordingInputStream and RecordingOutputStream to capture exactly a single HTTP transaction. Initially only supports HTTP/1.0 (one request, one response per stream) Call HttpRecorder.markContentBegin() to demarc the transition between HTTP header and body.
author:
   gojomo


Field Summary
protected static  Loggerlogger
    

Constructor Summary
protected  HttpRecorder()
     Constructor with limited access.
public  HttpRecorder(File tempDir, String backingFilenameBase, int outBufferSize, int inBufferSize)
     Create an HttpRecorder.
public  HttpRecorder(File tempDir, String backingFilenameBase)
     Create an HttpRecorder.

Method Summary
public  voidcleanup()
     Cleanup backing files. Call when completely done w/ recorder.
public  voidclose()
     Close all streams.
public  voidcloseRecorders()
     Close both input and output recorders. Recorders are the output streams to which we are recording. HttpRecorder.close() closes the stream that is being recorded and the recorder.
public  StringgetCharacterEncoding()
    
public static  HttpRecordergetHttpRecorder()
     Get the current threads' HttpRecorder. This threads' HttpRecorder.
public  RecordingInputStreamgetRecordedInput()
    
public  RecordingOutputStreamgetRecordedOutput()
    
public  ReplayCharSequencegetReplayCharSequence()
     A ReplayCharSequence.
public  ReplayInputStreamgetReplayInputStream()
    
public  longgetResponseContentLength()
    
public  InputStreaminputWrap(InputStream is)
     Wrap the provided stream with the internal RecordingInputStream open() throws an exception if RecordingInputStream is already open.
Parameters:
  is - InputStream to wrap.
public  voidmarkContentBegin()
     Mark current position as the point where the HTTP headers end.
public  OutputStreamoutputWrap(OutputStream os)
     Wrap the provided stream with the internal RecordingOutputStream open() throws an exception if RecordingOutputStream is already open.
Parameters:
  os - The output stream to wrap.
public  voidsetCharacterEncoding(String characterEncoding)
    
public static  HttpRecorderwrapInputStreamWithHttpRecord(File dir, String basename, InputStream in, String encoding)
     Record the input stream for later playback by an extractor, etc.

Field Detail
logger
protected static Logger logger(Code)




Constructor Detail
HttpRecorder
protected HttpRecorder()(Code)
Constructor with limited access. Used internally for case where we're wrapping an already downloaded stream with a HttpRecorder.



HttpRecorder
public HttpRecorder(File tempDir, String backingFilenameBase, int outBufferSize, int inBufferSize)(Code)
Create an HttpRecorder.
Parameters:
  tempDir - Directory into which we drop backing files forrecorded input and output.
Parameters:
  backingFilenameBase - Backing filename base to which we'll appendsuffices ris for recorded input stream andros for recorded output stream.
Parameters:
  outBufferSize - Size of output buffer to use.
Parameters:
  inBufferSize - Size of input buffer to use.



HttpRecorder
public HttpRecorder(File tempDir, String backingFilenameBase)(Code)
Create an HttpRecorder.
Parameters:
  tempDir - Directory into which we drop backing files for recorded inputand output.
Parameters:
  backingFilenameBase - Backing filename base to which we'll append sufficesris for recorded input stream andros for recorded output stream.




Method Detail
cleanup
public void cleanup()(Code)
Cleanup backing files. Call when completely done w/ recorder. Removes any backing files that may have been dropped.



close
public void close()(Code)
Close all streams.



closeRecorders
public void closeRecorders()(Code)
Close both input and output recorders. Recorders are the output streams to which we are recording. HttpRecorder.close() closes the stream that is being recorded and the recorder. This method explicitly closes the recorder only.



getCharacterEncoding
public String getCharacterEncoding()(Code)
Returns the characterEncoding.



getHttpRecorder
public static HttpRecorder getHttpRecorder()(Code)
Get the current threads' HttpRecorder. This threads' HttpRecorder. Returns null if can't find aHttpRecorder in current instance.



getRecordedInput
public RecordingInputStream getRecordedInput()(Code)
Return the internal RecordingInputStream A RIS.



getRecordedOutput
public RecordingOutputStream getRecordedOutput()(Code)
The RecordingOutputStream.



getReplayCharSequence
public ReplayCharSequence getReplayCharSequence() throws IOException(Code)
A ReplayCharSequence. Call close on the RCS when done w/ it.Will return indeterminate results if the underlying recording streamshave not been closed first.
throws:
  IOException -
throws:
  IOException -



getReplayInputStream
public ReplayInputStream getReplayInputStream() throws IOException(Code)
A replay input stream.
throws:
  IOException -



getResponseContentLength
public long getResponseContentLength()(Code)



inputWrap
public InputStream inputWrap(InputStream is) throws IOException(Code)
Wrap the provided stream with the internal RecordingInputStream open() throws an exception if RecordingInputStream is already open.
Parameters:
  is - InputStream to wrap. The input stream wrapper which itself is an input stream.Pass this in place of the passed stream so input can be recorded.
throws:
  IOException -



markContentBegin
public void markContentBegin()(Code)
Mark current position as the point where the HTTP headers end.



outputWrap
public OutputStream outputWrap(OutputStream os) throws IOException(Code)
Wrap the provided stream with the internal RecordingOutputStream open() throws an exception if RecordingOutputStream is already open.
Parameters:
  os - The output stream to wrap. The output stream wrapper which is itself an output stream.Pass this in place of the passed stream so output can be recorded.
throws:
  IOException -



setCharacterEncoding
public void setCharacterEncoding(String characterEncoding)(Code)

Parameters:
  characterEncoding - Character encoding of recording.



wrapInputStreamWithHttpRecord
public static HttpRecorder wrapInputStreamWithHttpRecord(File dir, String basename, InputStream in, String encoding) throws IOException(Code)
Record the input stream for later playback by an extractor, etc. This is convenience method used to setup an artificial HttpRecorder scenario used in unit tests, etc.
Parameters:
  dir - Directory to write backing file to.
Parameters:
  basename - of what we're recording.
Parameters:
  in - Stream to read.
Parameters:
  encoding - Stream encoding.
throws:
  IOException - An org.archive.util.HttpRecorder.



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.